summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
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,