diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-06-24 14:29:47 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 20:47:49 -0400 |
commit | aacfc19c626ebd3daa675652457d71019a1f583f (patch) | |
tree | 9c1cfb5945e939f1ba56b4c0101c211e84e544c0 /fs | |
parent | df2d6f26586f12a24f3ae5df4e236dc5c08d6eb4 (diff) |
fs: simplify the blockdev_direct_IO prototype
Simple filesystems always pass inode->i_sb_bdev as the block device
argument, and never need a end_io handler. Let's simply things for
them and for my grepping activity by dropping these arguments. The
only thing not falling into that scheme is ext4, which passes and
end_io handler without needing special flags (yet), but given how
messy the direct I/O code there is use of __blockdev_direct_IO
in one instead of two out of three cases isn't going to make a large
difference anyway.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext2/inode.c | 4 | ||||
-rw-r--r-- | fs/ext3/inode.c | 5 | ||||
-rw-r--r-- | fs/ext4/inode.c | 12 | ||||
-rw-r--r-- | fs/fat/inode.c | 4 | ||||
-rw-r--r-- | fs/hfs/inode.c | 4 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 4 | ||||
-rw-r--r-- | fs/jfs/inode.c | 4 | ||||
-rw-r--r-- | fs/nilfs2/inode.c | 4 | ||||
-rw-r--r-- | fs/reiserfs/inode.c | 5 |
9 files changed, 22 insertions, 24 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 06e7c767ab35..a8a58f63f07c 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -843,8 +843,8 @@ ext2_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
843 | struct inode *inode = mapping->host; | 843 | struct inode *inode = mapping->host; |
844 | ssize_t ret; | 844 | ssize_t ret; |
845 | 845 | ||
846 | ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, | 846 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
847 | iov, offset, nr_segs, ext2_get_block, NULL); | 847 | ext2_get_block); |
848 | if (ret < 0 && (rw & WRITE)) | 848 | if (ret < 0 && (rw & WRITE)) |
849 | ext2_write_failed(mapping, offset + iov_length(iov, nr_segs)); | 849 | ext2_write_failed(mapping, offset + iov_length(iov, nr_segs)); |
850 | return ret; | 850 | return ret; |
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 99c28b246b89..2978a2a17a59 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -1816,9 +1816,8 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, | |||
1816 | } | 1816 | } |
1817 | 1817 | ||
1818 | retry: | 1818 | retry: |
1819 | ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 1819 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
1820 | offset, nr_segs, | 1820 | ext3_get_block); |
1821 | ext3_get_block, NULL); | ||
1822 | /* | 1821 | /* |
1823 | * In case of error extending write may have instantiated a few | 1822 | * In case of error extending write may have instantiated a few |
1824 | * blocks outside i_size. Trim these off again. | 1823 | * blocks outside i_size. Trim these off again. |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9ec0a2ba2502..1f35573a34e1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3501,10 +3501,8 @@ retry: | |||
3501 | offset, nr_segs, | 3501 | offset, nr_segs, |
3502 | ext4_get_block, NULL, NULL, 0); | 3502 | ext4_get_block, NULL, NULL, 0); |
3503 | else { | 3503 | else { |
3504 | ret = blockdev_direct_IO(rw, iocb, inode, | 3504 | ret = blockdev_direct_IO(rw, iocb, inode, iov, |
3505 | inode->i_sb->s_bdev, iov, | 3505 | offset, nr_segs, ext4_get_block); |
3506 | offset, nr_segs, | ||
3507 | ext4_get_block, NULL); | ||
3508 | 3506 | ||
3509 | if (unlikely((rw & WRITE) && ret < 0)) { | 3507 | if (unlikely((rw & WRITE) && ret < 0)) { |
3510 | loff_t isize = i_size_read(inode); | 3508 | loff_t isize = i_size_read(inode); |
@@ -3748,11 +3746,13 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb, | |||
3748 | EXT4_I(inode)->cur_aio_dio = iocb->private; | 3746 | EXT4_I(inode)->cur_aio_dio = iocb->private; |
3749 | } | 3747 | } |
3750 | 3748 | ||
3751 | ret = blockdev_direct_IO(rw, iocb, inode, | 3749 | ret = __blockdev_direct_IO(rw, iocb, inode, |
3752 | inode->i_sb->s_bdev, iov, | 3750 | inode->i_sb->s_bdev, iov, |
3753 | offset, nr_segs, | 3751 | offset, nr_segs, |
3754 | ext4_get_block_write, | 3752 | ext4_get_block_write, |
3755 | ext4_end_io_dio); | 3753 | ext4_end_io_dio, |
3754 | NULL, | ||
3755 | DIO_LOCKING | DIO_SKIP_HOLES); | ||
3756 | if (iocb->private) | 3756 | if (iocb->private) |
3757 | EXT4_I(inode)->cur_aio_dio = NULL; | 3757 | EXT4_I(inode)->cur_aio_dio = NULL; |
3758 | /* | 3758 | /* |
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 3decce46c38f..5942fec22c65 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -211,8 +211,8 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, | |||
211 | * FAT need to use the DIO_LOCKING for avoiding the race | 211 | * FAT need to use the DIO_LOCKING for avoiding the race |
212 | * condition of fat_get_block() and ->truncate(). | 212 | * condition of fat_get_block() and ->truncate(). |
213 | */ | 213 | */ |
214 | ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, | 214 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
215 | iov, offset, nr_segs, fat_get_block, NULL); | 215 | fat_get_block); |
216 | if (ret < 0 && (rw & WRITE)) | 216 | if (ret < 0 && (rw & WRITE)) |
217 | fat_write_failed(mapping, offset + iov_length(iov, nr_segs)); | 217 | fat_write_failed(mapping, offset + iov_length(iov, nr_segs)); |
218 | 218 | ||
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 48d567cc203e..5e7c3f309617 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -123,8 +123,8 @@ static ssize_t hfs_direct_IO(int rw, struct kiocb *iocb, | |||
123 | struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; | 123 | struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; |
124 | ssize_t ret; | 124 | ssize_t ret; |
125 | 125 | ||
126 | ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 126 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
127 | offset, nr_segs, hfs_get_block, NULL); | 127 | hfs_get_block); |
128 | 128 | ||
129 | /* | 129 | /* |
130 | * In case of error extending write may have instantiated a few | 130 | * In case of error extending write may have instantiated a few |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index b0a0a4b621eb..5b1cb98741cc 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -119,8 +119,8 @@ static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb, | |||
119 | struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; | 119 | struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; |
120 | ssize_t ret; | 120 | ssize_t ret; |
121 | 121 | ||
122 | ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 122 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
123 | offset, nr_segs, hfsplus_get_block, NULL); | 123 | hfsplus_get_block); |
124 | 124 | ||
125 | /* | 125 | /* |
126 | * In case of error extending write may have instantiated a few | 126 | * In case of error extending write may have instantiated a few |
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 109655904bbc..77b69b27f825 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c | |||
@@ -329,8 +329,8 @@ static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb, | |||
329 | struct inode *inode = file->f_mapping->host; | 329 | struct inode *inode = file->f_mapping->host; |
330 | ssize_t ret; | 330 | ssize_t ret; |
331 | 331 | ||
332 | ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 332 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
333 | offset, nr_segs, jfs_get_block, NULL); | 333 | jfs_get_block); |
334 | 334 | ||
335 | /* | 335 | /* |
336 | * In case of error extending write may have instantiated a few | 336 | * In case of error extending write may have instantiated a few |
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 13f113154a9f..666628b395f1 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -259,8 +259,8 @@ nilfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
259 | return 0; | 259 | return 0; |
260 | 260 | ||
261 | /* Needs synchronization with the cleaner */ | 261 | /* Needs synchronization with the cleaner */ |
262 | size = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 262 | size = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
263 | offset, nr_segs, nilfs_get_block, NULL); | 263 | nilfs_get_block); |
264 | 264 | ||
265 | /* | 265 | /* |
266 | * In case of error extending write may have instantiated a few | 266 | * In case of error extending write may have instantiated a few |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index dcf543d8caf1..2922b90ceac1 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -3068,9 +3068,8 @@ static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb, | |||
3068 | struct inode *inode = file->f_mapping->host; | 3068 | struct inode *inode = file->f_mapping->host; |
3069 | ssize_t ret; | 3069 | ssize_t ret; |
3070 | 3070 | ||
3071 | ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 3071 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
3072 | offset, nr_segs, | 3072 | reiserfs_get_blocks_direct_io); |
3073 | reiserfs_get_blocks_direct_io, NULL); | ||
3074 | 3073 | ||
3075 | /* | 3074 | /* |
3076 | * In case of error extending write may have instantiated a few | 3075 | * In case of error extending write may have instantiated a few |