summaryrefslogtreecommitdiff
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2016-06-05 22:32:22 +0300
committerJens Axboe <axboe@fb.com>2016-06-07 22:41:38 +0300
commit4e1b2d52a80d79296a5d899d73249748dea71a53 (patch)
tree6afc956ec1cef2cd00832685225ccac6d8cec868 /include/linux/fs.h
parent6296b9604fcebc2dd8d6ec396de80b2da84d9700 (diff)
downloadlinux-4e1b2d52a80d79296a5d899d73249748dea71a53.tar.xz
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/fs.h')
-rw-r--r--include/linux/fs.h37
1 files changed, 15 insertions, 22 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index af6f3c7e4822..ccd166477487 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -152,9 +152,10 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
#define CHECK_IOVEC_ONLY -1
/*
- * The below are the various read and write types that we support. Some of
+ * The below are the various read and write flags that we support. Some of
* them include behavioral modifiers that send information down to the
- * block layer and IO scheduler. Terminology:
+ * block layer and IO scheduler. They should be used along with a req_op.
+ * Terminology:
*
* The block layer uses device plugging to defer IO a little bit, in
* the hope that we will see more IO very shortly. This increases
@@ -193,19 +194,19 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
* non-volatile media on completion.
*
*/
-#define RW_MASK REQ_WRITE
+#define RW_MASK REQ_OP_WRITE
#define RWA_MASK REQ_RAHEAD
-#define READ 0
+#define READ REQ_OP_READ
#define WRITE RW_MASK
#define READA RWA_MASK
-#define READ_SYNC (READ | REQ_SYNC)
-#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE)
-#define WRITE_ODIRECT (WRITE | REQ_SYNC)
-#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH)
-#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)
-#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
+#define READ_SYNC REQ_SYNC
+#define WRITE_SYNC (REQ_SYNC | REQ_NOIDLE)
+#define WRITE_ODIRECT REQ_SYNC
+#define WRITE_FLUSH (REQ_SYNC | REQ_NOIDLE | REQ_FLUSH)
+#define WRITE_FUA (REQ_SYNC | REQ_NOIDLE | REQ_FUA)
+#define WRITE_FLUSH_FUA (REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
/*
* Attribute flags. These should be or-ed together to figure out what
@@ -2464,17 +2465,9 @@ extern void make_bad_inode(struct inode *);
extern bool is_bad_inode(struct inode *);
#ifdef CONFIG_BLOCK
-/*
- * tmp cpmpat. Users used to set the write bit for all non reads, but
- * we will be dropping the bitmap use for ops. Support both until
- * the end of the patchset.
- */
-static inline bool op_is_write(unsigned long flags)
+static inline bool op_is_write(unsigned int op)
{
- if (flags & (REQ_OP_WRITE | REQ_OP_WRITE_SAME | REQ_OP_DISCARD))
- return true;
- else
- return false;
+ return op == REQ_OP_READ ? false : true;
}
/*
@@ -2482,7 +2475,7 @@ static inline bool op_is_write(unsigned long flags)
*/
static inline int bio_rw(struct bio *bio)
{
- if (op_is_write(op_from_rq_bits(bio->bi_rw)))
+ if (op_is_write(bio_op(bio)))
return WRITE;
return bio->bi_rw & RWA_MASK;
@@ -2493,7 +2486,7 @@ static inline int bio_rw(struct bio *bio)
*/
static inline int bio_data_dir(struct bio *bio)
{
- return op_is_write(op_from_rq_bits(bio->bi_rw)) ? WRITE : READ;
+ return op_is_write(bio_op(bio)) ? WRITE : READ;
}
extern void check_disk_size_change(struct gendisk *disk,