aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-06-04 05:29:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:47:29 -0400
commiteafdc7d190a944c755a9fe68573c193e6e0217e7 (patch)
tree915c3cc8004706fabf88eae1ab123a3fa0147516 /include/linux/fs.h
parent256249584bda1a9357e2d29987a37f5b2df035f6 (diff)
sort out blockdev_direct_IO variants
Move the call to vmtruncate to get rid of accessive blocks to the callers in prepearation of the new truncate calling sequence. This was only done for DIO_LOCKING filesystems, so the __blockdev_direct_IO_newtrunc variant was not needed anyway. Get rid of blockdev_direct_IO_no_locking and its _newtrunc variant while at it as just opencoding the two additional paramters is shorted than the name suffix. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h42
1 files changed, 6 insertions, 36 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f91affb7d530..b347b2d5666f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2269,16 +2269,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
2269struct bio; 2269struct bio;
2270typedef 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,
2271 loff_t file_offset); 2271 loff_t file_offset);
2272void dio_end_io(struct bio *bio, int error);
2273
2274ssize_t __blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, struct inode *inode,
2275 struct block_device *bdev, const struct iovec *iov, loff_t offset,
2276 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
2277 dio_submit_t submit_io, int lock_type);
2278ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2279 struct block_device *bdev, const struct iovec *iov, loff_t offset,
2280 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
2281 dio_submit_t submit_io, int lock_type);
2282 2272
2283enum { 2273enum {
2284 /* need locking between buffered and direct access */ 2274 /* need locking between buffered and direct access */
@@ -2288,24 +2278,13 @@ enum {
2288 DIO_SKIP_HOLES = 0x02, 2278 DIO_SKIP_HOLES = 0x02,
2289}; 2279};
2290 2280
2291static inline ssize_t blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, 2281void dio_end_io(struct bio *bio, int error);
2292 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 2282
2293 loff_t offset, unsigned long nr_segs, get_block_t get_block, 2283ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2294 dio_iodone_t end_io) 2284 struct block_device *bdev, const struct iovec *iov, loff_t offset,
2295{ 2285 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
2296 return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset, 2286 dio_submit_t submit_io, int flags);
2297 nr_segs, get_block, end_io, NULL,
2298 DIO_LOCKING | DIO_SKIP_HOLES);
2299}
2300 2287
2301static inline ssize_t blockdev_direct_IO_no_locking_newtrunc(int rw, struct kiocb *iocb,
2302 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2303 loff_t offset, unsigned long nr_segs, get_block_t get_block,
2304 dio_iodone_t end_io)
2305{
2306 return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset,
2307 nr_segs, get_block, end_io, NULL, 0);
2308}
2309static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 2288static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
2310 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 2289 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2311 loff_t offset, unsigned long nr_segs, get_block_t get_block, 2290 loff_t offset, unsigned long nr_segs, get_block_t get_block,
@@ -2315,15 +2294,6 @@ static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
2315 nr_segs, get_block, end_io, NULL, 2294 nr_segs, get_block, end_io, NULL,
2316 DIO_LOCKING | DIO_SKIP_HOLES); 2295 DIO_LOCKING | DIO_SKIP_HOLES);
2317} 2296}
2318
2319static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb,
2320 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2321 loff_t offset, unsigned long nr_segs, get_block_t get_block,
2322 dio_iodone_t end_io)
2323{
2324 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
2325 nr_segs, get_block, end_io, NULL, 0);
2326}
2327#endif 2297#endif
2328 2298
2329extern const struct file_operations generic_ro_fops; 2299extern const struct file_operations generic_ro_fops;