block: better op and flags encoding
Now that we don't need the common flags to overflow outside the range of a 32-bit type we can encode them the same way for both the bio and request fields. This in addition allows us to place the operation first (and make some room for more ops while we're at it) and to stop having to shift around the operation values. In addition this allows passing around only one value in the block layer instead of two (and eventuall also in the file systems, but we can do that later) and thus clean up a lot of code. Last but not least this allows decreasing the size of the cmd_flags field in struct request to 32-bits. Various functions passing this value could also be updated, but I'd like to avoid the churn for now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:

committed by
Jens Axboe

parent
e806402130
commit
ef295ecf09
@@ -30,7 +30,7 @@ typedef int (elevator_dispatch_fn) (struct request_queue *, int);
|
||||
typedef void (elevator_add_req_fn) (struct request_queue *, struct request *);
|
||||
typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *);
|
||||
typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *);
|
||||
typedef int (elevator_may_queue_fn) (struct request_queue *, int, int);
|
||||
typedef int (elevator_may_queue_fn) (struct request_queue *, unsigned int);
|
||||
|
||||
typedef void (elevator_init_icq_fn) (struct io_cq *);
|
||||
typedef void (elevator_exit_icq_fn) (struct io_cq *);
|
||||
@@ -139,7 +139,7 @@ extern struct request *elv_former_request(struct request_queue *, struct request
|
||||
extern struct request *elv_latter_request(struct request_queue *, struct request *);
|
||||
extern int elv_register_queue(struct request_queue *q);
|
||||
extern void elv_unregister_queue(struct request_queue *q);
|
||||
extern int elv_may_queue(struct request_queue *, int, int);
|
||||
extern int elv_may_queue(struct request_queue *, unsigned int);
|
||||
extern void elv_completed_request(struct request_queue *, struct request *);
|
||||
extern int elv_set_request(struct request_queue *q, struct request *rq,
|
||||
struct bio *bio, gfp_t gfp_mask);
|
||||
|
Reference in New Issue
Block a user