aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2016-06-05 15:32:22 -0400
committerJens Axboe <axboe@fb.com>2016-06-07 15:41:38 -0400
commit4e1b2d52a80d79296a5d899d73249748dea71a53 (patch)
tree6afc956ec1cef2cd00832685225ccac6d8cec868 /include/linux/blkdev.h
parent6296b9604fcebc2dd8d6ec396de80b2da84d9700 (diff)
block, fs, drivers: remove REQ_OP compat defs and related code
This patch drops the compat definition of req_op where it matches the rq_flag_bits definitions, and drops the related old and compat code that allowed users to set either the op or flags for the operation. We also then store the operation in the bi_rw/cmd_flags field similar to how we used to store the bio ioprio where it sat in the upper bits of the field. Signed-off-by: Mike Christie <mchristi@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4937c056fcbd..78ae3dbf2de1 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -200,8 +200,15 @@ struct request {
200 struct request *next_rq; 200 struct request *next_rq;
201}; 201};
202 202
203#define req_op(req) (op_from_rq_bits((req)->cmd_flags)) 203#define REQ_OP_SHIFT (8 * sizeof(u64) - REQ_OP_BITS)
204#define req_set_op(req, op) ((req)->cmd_flags |= op) 204#define req_op(req) ((req)->cmd_flags >> REQ_OP_SHIFT)
205
206#define req_set_op(req, op) do { \
207 WARN_ON(op >= (1 << REQ_OP_BITS)); \
208 (req)->cmd_flags &= ((1ULL << REQ_OP_SHIFT) - 1); \
209 (req)->cmd_flags |= ((u64) (op) << REQ_OP_SHIFT); \
210} while (0)
211
205#define req_set_op_attrs(req, op, flags) do { \ 212#define req_set_op_attrs(req, op, flags) do { \
206 req_set_op(req, op); \ 213 req_set_op(req, op); \
207 (req)->cmd_flags |= flags; \ 214 (req)->cmd_flags |= flags; \
@@ -604,8 +611,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
604 611
605#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) 612#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
606 613
607#define rq_data_dir(rq) \ 614#define rq_data_dir(rq) (op_is_write(req_op(rq)) ? WRITE : READ)
608 (op_is_write(op_from_rq_bits(rq->cmd_flags)) ? WRITE : READ)
609 615
610/* 616/*
611 * Driver can handle struct request, if it either has an old style 617 * Driver can handle struct request, if it either has an old style