aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-08-03 07:14:58 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:53:10 -0400
commit7cc015811ef8992dfcce314d0ed9642bc18143d1 (patch)
treecae16766d233563bef102032eb954c05f1814f77 /include/linux/fs.h
parentaca27ba9618276dd2f777bcd5a1419589ccf1ca8 (diff)
bio, fs: separate out bio_types.h and define READ/WRITE constants in terms of BIO_RW_* flags
linux/fs.h hard coded READ/WRITE constants which should match BIO_RW_* flags. This is fragile and caused breakage during BIO_RW_* flag rearrangement. The hardcoding is to avoid include dependency hell. Create linux/bio_types.h which contatins definitions for bio data structures and flags and include it from bio.h and fs.h, and make fs.h define all READ/WRITE related constants in terms of BIO_RW_* flags. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 55dad7bca25b..c53911277210 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -8,6 +8,7 @@
8 8
9#include <linux/limits.h> 9#include <linux/limits.h>
10#include <linux/ioctl.h> 10#include <linux/ioctl.h>
11#include <linux/blk_types.h>
11 12
12/* 13/*
13 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change 14 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -117,7 +118,7 @@ struct inodes_stat_t {
117 * immediately wait on this read without caring about 118 * immediately wait on this read without caring about
118 * unplugging. 119 * unplugging.
119 * READA Used for read-ahead operations. Lower priority, and the 120 * READA Used for read-ahead operations. Lower priority, and the
120 * block layer could (in theory) choose to ignore this 121 * block layer could (in theory) choose to ignore this
121 * request if it runs into resource problems. 122 * request if it runs into resource problems.
122 * WRITE A normal async write. Device will be plugged. 123 * WRITE A normal async write. Device will be plugged.
123 * SWRITE Like WRITE, but a special case for ll_rw_block() that 124 * SWRITE Like WRITE, but a special case for ll_rw_block() that
@@ -144,13 +145,13 @@ struct inodes_stat_t {
144 * of this IO. 145 * of this IO.
145 * 146 *
146 */ 147 */
147#define RW_MASK 1 148#define RW_MASK REQ_WRITE
148#define RWA_MASK 16 149#define RWA_MASK REQ_RAHEAD
149 150
150#define READ 0 151#define READ 0
151#define WRITE 1 152#define WRITE RW_MASK
152#define READA 16 /* readahead - don't block if no resources */ 153#define READA RWA_MASK
153#define SWRITE 17 /* for ll_rw_block(), wait for buffer lock */ 154#define SWRITE (WRITE | READA)
154 155
155#define READ_SYNC (READ | REQ_SYNC | REQ_UNPLUG) 156#define READ_SYNC (READ | REQ_SYNC | REQ_UNPLUG)
156#define READ_META (READ | REQ_META) 157#define READ_META (READ | REQ_META)
@@ -2200,7 +2201,6 @@ static inline void insert_inode_hash(struct inode *inode) {
2200extern void file_move(struct file *f, struct list_head *list); 2201extern void file_move(struct file *f, struct list_head *list);
2201extern void file_kill(struct file *f); 2202extern void file_kill(struct file *f);
2202#ifdef CONFIG_BLOCK 2203#ifdef CONFIG_BLOCK
2203struct bio;
2204extern void submit_bio(int, struct bio *); 2204extern void submit_bio(int, struct bio *);
2205extern int bdev_read_only(struct block_device *); 2205extern int bdev_read_only(struct block_device *);
2206#endif 2206#endif
@@ -2267,7 +2267,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
2267#endif 2267#endif
2268 2268
2269#ifdef CONFIG_BLOCK 2269#ifdef CONFIG_BLOCK
2270struct bio;
2271typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, 2270typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,
2272 loff_t file_offset); 2271 loff_t file_offset);
2273void dio_end_io(struct bio *bio, int error); 2272void dio_end_io(struct bio *bio, int error);