diff options
author | Tejun Heo <tj@kernel.org> | 2010-09-03 05:56:18 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-10 06:35:38 -0400 |
commit | 3a2edd0d6ddbd5fa3b389ea6db811285415ce6c8 (patch) | |
tree | 5752d02cc755e242270f700d442f35b5fc9557d9 | |
parent | e9c7469bb4f502dafc092166201bea1ad5fc0fbf (diff) |
block: make __blk_rq_prep_clone() copy most command flags
Currently __blk_rq_prep_clone() copies only REQ_WRITE and REQ_DISCARD.
There's no reason to omit other command flags and REQ_FUA needs to be
copied to implement FUA support in request-based dm.
REQ_COMMON_MASK which specifies flags to be copied from bio to request
already identifies all the command flags. Define REQ_CLONE_MASK to be
the same as REQ_COMMON_MASK for clarity and make __blk_rq_prep_clone()
copy all flags in the mask.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r-- | block/blk-core.c | 4 | ||||
-rw-r--r-- | include/linux/blk_types.h | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 495bdc4a23d..2a5b1920454 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -2505,9 +2505,7 @@ EXPORT_SYMBOL_GPL(blk_rq_unprep_clone); | |||
2505 | static void __blk_rq_prep_clone(struct request *dst, struct request *src) | 2505 | static void __blk_rq_prep_clone(struct request *dst, struct request *src) |
2506 | { | 2506 | { |
2507 | dst->cpu = src->cpu; | 2507 | dst->cpu = src->cpu; |
2508 | dst->cmd_flags = (rq_data_dir(src) | REQ_NOMERGE); | 2508 | dst->cmd_flags = (src->cmd_flags & REQ_CLONE_MASK) | REQ_NOMERGE; |
2509 | if (src->cmd_flags & REQ_DISCARD) | ||
2510 | dst->cmd_flags |= REQ_DISCARD; | ||
2511 | dst->cmd_type = src->cmd_type; | 2509 | dst->cmd_type = src->cmd_type; |
2512 | dst->__sector = blk_rq_pos(src); | 2510 | dst->__sector = blk_rq_pos(src); |
2513 | dst->__data_len = blk_rq_bytes(src); | 2511 | dst->__data_len = blk_rq_bytes(src); |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 179799479e6..36edadf5b41 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -168,6 +168,7 @@ enum rq_flag_bits { | |||
168 | #define REQ_COMMON_MASK \ | 168 | #define REQ_COMMON_MASK \ |
169 | (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ | 169 | (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ |
170 | REQ_META | REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | 170 | REQ_META | REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
171 | #define REQ_CLONE_MASK REQ_COMMON_MASK | ||
171 | 172 | ||
172 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | 173 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) |
173 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) | 174 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) |