]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
block: add a proper block layer data direction encoding
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Oct 2016 13:12:15 +0000 (15:12 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 28 Oct 2016 14:48:54 +0000 (08:48 -0600)
commit87374179c535a98337569904727aa02f960fe79e
tree6c71566fb8bda79fbf683e60e207739cbae50bad
parentef295ecf090d3e86e5b742fc6ab34f1122a43773
block: add a proper block layer data direction encoding

Currently the block layer op_is_write, bio_data_dir and rq_data_dir
helper treat every operation that is not a READ as a data out operation.
This worked surprisingly long, but the new REQ_OP_ZONE_REPORT operation
actually adds a second operation that reads data from the device.
Surprisingly nothing critical relied on this direction, but this might
be a good opportunity to properly fix this issue up.

We take a little inspiration and use the least significant bit of the
operation number to encode the data direction, which just requires us
to renumber the operations to fix this scheme.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Shaun Tancheff <shaun.tancheff@seagate.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
include/linux/blk_types.h
include/linux/fs.h