diff options
author | Christoph Hellwig <hch@lst.de> | 2016-10-20 15:12:15 +0200 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 4ce229889bcede57b53f3dde83de5eb1c638681c (patch) | |
tree | c74488cb1721000522f16bb7282d17b3c99fb4aa /include/linux/fs.h | |
parent | 130a02bce60ed0addd05d1ed9a4c9eb72683a5d2 (diff) |
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>
(cherry picked from commit 87374179c535a98337569904727aa02f960fe79e)
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index e9867aff53d8..6c99b1297f91 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2506,11 +2506,6 @@ extern void make_bad_inode(struct inode *); extern bool is_bad_inode(struct inode *); #ifdef CONFIG_BLOCK -static inline bool op_is_write(unsigned int op) -{ - return op == REQ_OP_READ ? false : true; -} - /* * return data direction, READ or WRITE */ |