diff options
author | Badari Pulavarty <pbadari@us.ibm.com> | 2006-10-01 02:28:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:28 -0400 |
commit | 543ade1fc901db4c3dbe9fb27241fb977f1f3eea (patch) | |
tree | cdd1a1f67a718adf71e92fe08e4b3d33bf3dbadc /fs | |
parent | ee0b3e671baff681d69fbf0db33b47603c0a8280 (diff) |
[PATCH] Streamline generic_file_* interfaces and filemap cleanups
This patch cleans up generic_file_*_read/write() interfaces. Christoph
Hellwig gave me the idea for this clean ups.
In a nutshell, all filesystems should set .aio_read/.aio_write methods and use
do_sync_read/ do_sync_write() as their .read/.write methods. This allows us
to cleanup all variants of generic_file_* routines.
Final available interfaces:
generic_file_aio_read() - read handler
generic_file_aio_write() - write handler
generic_file_aio_write_nolock() - no lock write handler
__generic_file_aio_write_nolock() - internal worker routine
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/adfs/file.c | 6 | ||||
-rw-r--r-- | fs/affs/file.c | 6 | ||||
-rw-r--r-- | fs/bfs/file.c | 6 | ||||
-rw-r--r-- | fs/block_dev.c | 12 | ||||
-rw-r--r-- | fs/ext2/file.c | 4 | ||||
-rw-r--r-- | fs/fuse/file.c | 6 | ||||
-rw-r--r-- | fs/hfs/inode.c | 6 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 6 | ||||
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 4 | ||||
-rw-r--r-- | fs/hpfs/file.c | 6 | ||||
-rw-r--r-- | fs/jffs/inode-v23.c | 6 | ||||
-rw-r--r-- | fs/jffs2/file.c | 6 | ||||
-rw-r--r-- | fs/jfs/file.c | 4 | ||||
-rw-r--r-- | fs/minix/file.c | 6 | ||||
-rw-r--r-- | fs/ntfs/file.c | 2 | ||||
-rw-r--r-- | fs/qnx4/file.c | 6 | ||||
-rw-r--r-- | fs/ramfs/file-mmu.c | 6 | ||||
-rw-r--r-- | fs/ramfs/file-nommu.c | 6 | ||||
-rw-r--r-- | fs/read_write.c | 3 | ||||
-rw-r--r-- | fs/smbfs/file.c | 24 | ||||
-rw-r--r-- | fs/sysv/file.c | 6 | ||||
-rw-r--r-- | fs/udf/file.c | 16 | ||||
-rw-r--r-- | fs/ufs/file.c | 6 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 4 |
24 files changed, 99 insertions, 64 deletions
diff --git a/fs/adfs/file.c b/fs/adfs/file.c index 1014b9f2117b..6101ea679cb1 100644 --- a/fs/adfs/file.c +++ b/fs/adfs/file.c | |||
@@ -27,10 +27,12 @@ | |||
27 | 27 | ||
28 | const struct file_operations adfs_file_operations = { | 28 | const struct file_operations adfs_file_operations = { |
29 | .llseek = generic_file_llseek, | 29 | .llseek = generic_file_llseek, |
30 | .read = generic_file_read, | 30 | .read = do_sync_read, |
31 | .aio_read = generic_file_aio_read, | ||
31 | .mmap = generic_file_mmap, | 32 | .mmap = generic_file_mmap, |
32 | .fsync = file_fsync, | 33 | .fsync = file_fsync, |
33 | .write = generic_file_write, | 34 | .write = do_sync_write, |
35 | .aio_write = generic_file_aio_write, | ||
34 | .sendfile = generic_file_sendfile, | 36 | .sendfile = generic_file_sendfile, |
35 | }; | 37 | }; |
36 | 38 | ||
diff --git a/fs/affs/file.c b/fs/affs/file.c index 3de8590e4f6a..05b5e22de759 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c | |||
@@ -27,8 +27,10 @@ static int affs_file_release(struct inode *inode, struct file *filp); | |||
27 | 27 | ||
28 | const struct file_operations affs_file_operations = { | 28 | const struct file_operations affs_file_operations = { |
29 | .llseek = generic_file_llseek, | 29 | .llseek = generic_file_llseek, |
30 | .read = generic_file_read, | 30 | .read = do_sync_read, |
31 | .write = generic_file_write, | 31 | .aio_read = generic_file_aio_read, |
32 | .write = do_sync_write, | ||
33 | .aio_write = generic_file_aio_write, | ||
32 | .mmap = generic_file_mmap, | 34 | .mmap = generic_file_mmap, |
33 | .open = affs_file_open, | 35 | .open = affs_file_open, |
34 | .release = affs_file_release, | 36 | .release = affs_file_release, |
diff --git a/fs/bfs/file.c b/fs/bfs/file.c index 3d5aca28a0a0..a9164a87f8de 100644 --- a/fs/bfs/file.c +++ b/fs/bfs/file.c | |||
@@ -19,8 +19,10 @@ | |||
19 | 19 | ||
20 | const struct file_operations bfs_file_operations = { | 20 | const struct file_operations bfs_file_operations = { |
21 | .llseek = generic_file_llseek, | 21 | .llseek = generic_file_llseek, |
22 | .read = generic_file_read, | 22 | .read = do_sync_read, |
23 | .write = generic_file_write, | 23 | .aio_read = generic_file_aio_read, |
24 | .write = do_sync_write, | ||
25 | .aio_write = generic_file_aio_write, | ||
24 | .mmap = generic_file_mmap, | 26 | .mmap = generic_file_mmap, |
25 | .sendfile = generic_file_sendfile, | 27 | .sendfile = generic_file_sendfile, |
26 | }; | 28 | }; |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 0f143094ef1d..bc8f27cc4483 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1154,14 +1154,6 @@ static int blkdev_close(struct inode * inode, struct file * filp) | |||
1154 | return blkdev_put(bdev); | 1154 | return blkdev_put(bdev); |
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | static ssize_t blkdev_file_write(struct file *file, const char __user *buf, | ||
1158 | size_t count, loff_t *ppos) | ||
1159 | { | ||
1160 | struct iovec local_iov = { .iov_base = (void __user *)buf, .iov_len = count }; | ||
1161 | |||
1162 | return generic_file_write_nolock(file, &local_iov, 1, ppos); | ||
1163 | } | ||
1164 | |||
1165 | static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg) | 1157 | static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg) |
1166 | { | 1158 | { |
1167 | return blkdev_ioctl(file->f_mapping->host, file, cmd, arg); | 1159 | return blkdev_ioctl(file->f_mapping->host, file, cmd, arg); |
@@ -1181,8 +1173,8 @@ const struct file_operations def_blk_fops = { | |||
1181 | .open = blkdev_open, | 1173 | .open = blkdev_open, |
1182 | .release = blkdev_close, | 1174 | .release = blkdev_close, |
1183 | .llseek = block_llseek, | 1175 | .llseek = block_llseek, |
1184 | .read = generic_file_read, | 1176 | .read = do_sync_read, |
1185 | .write = blkdev_file_write, | 1177 | .write = do_sync_write, |
1186 | .aio_read = generic_file_aio_read, | 1178 | .aio_read = generic_file_aio_read, |
1187 | .aio_write = generic_file_aio_write_nolock, | 1179 | .aio_write = generic_file_aio_write_nolock, |
1188 | .mmap = generic_file_mmap, | 1180 | .mmap = generic_file_mmap, |
diff --git a/fs/ext2/file.c b/fs/ext2/file.c index e893e2be9ed4..2dba473c524a 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c | |||
@@ -41,8 +41,8 @@ static int ext2_release_file (struct inode * inode, struct file * filp) | |||
41 | */ | 41 | */ |
42 | const struct file_operations ext2_file_operations = { | 42 | const struct file_operations ext2_file_operations = { |
43 | .llseek = generic_file_llseek, | 43 | .llseek = generic_file_llseek, |
44 | .read = generic_file_read, | 44 | .read = do_sync_read, |
45 | .write = generic_file_write, | 45 | .write = do_sync_write, |
46 | .aio_read = generic_file_aio_read, | 46 | .aio_read = generic_file_aio_read, |
47 | .aio_write = generic_file_aio_write, | 47 | .aio_write = generic_file_aio_write, |
48 | .ioctl = ext2_ioctl, | 48 | .ioctl = ext2_ioctl, |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 5c4fcd1dbf59..183626868eea 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -753,8 +753,10 @@ static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl) | |||
753 | 753 | ||
754 | static const struct file_operations fuse_file_operations = { | 754 | static const struct file_operations fuse_file_operations = { |
755 | .llseek = generic_file_llseek, | 755 | .llseek = generic_file_llseek, |
756 | .read = generic_file_read, | 756 | .read = do_sync_read, |
757 | .write = generic_file_write, | 757 | .aio_read = generic_file_aio_read, |
758 | .write = do_sync_write, | ||
759 | .aio_write = generic_file_aio_write, | ||
758 | .mmap = fuse_file_mmap, | 760 | .mmap = fuse_file_mmap, |
759 | .open = fuse_open, | 761 | .open = fuse_open, |
760 | .flush = fuse_flush, | 762 | .flush = fuse_flush, |
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index d05641c35fc9..02f5573e0349 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -601,8 +601,10 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr) | |||
601 | 601 | ||
602 | static const struct file_operations hfs_file_operations = { | 602 | static const struct file_operations hfs_file_operations = { |
603 | .llseek = generic_file_llseek, | 603 | .llseek = generic_file_llseek, |
604 | .read = generic_file_read, | 604 | .read = do_sync_read, |
605 | .write = generic_file_write, | 605 | .aio_read = generic_file_aio_read, |
606 | .write = do_sync_write, | ||
607 | .aio_write = generic_file_aio_write, | ||
606 | .mmap = generic_file_mmap, | 608 | .mmap = generic_file_mmap, |
607 | .sendfile = generic_file_sendfile, | 609 | .sendfile = generic_file_sendfile, |
608 | .fsync = file_fsync, | 610 | .fsync = file_fsync, |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 0eb1a6092668..9e3675249633 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -282,8 +282,10 @@ static struct inode_operations hfsplus_file_inode_operations = { | |||
282 | 282 | ||
283 | static const struct file_operations hfsplus_file_operations = { | 283 | static const struct file_operations hfsplus_file_operations = { |
284 | .llseek = generic_file_llseek, | 284 | .llseek = generic_file_llseek, |
285 | .read = generic_file_read, | 285 | .read = do_sync_read, |
286 | .write = generic_file_write, | 286 | .aio_read = generic_file_aio_read, |
287 | .write = do_sync_write, | ||
288 | .aio_write = generic_file_aio_write, | ||
287 | .mmap = generic_file_mmap, | 289 | .mmap = generic_file_mmap, |
288 | .sendfile = generic_file_sendfile, | 290 | .sendfile = generic_file_sendfile, |
289 | .fsync = file_fsync, | 291 | .fsync = file_fsync, |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 4908c38a5885..b6bd33ca3731 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -385,11 +385,11 @@ int hostfs_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
385 | 385 | ||
386 | static const struct file_operations hostfs_file_fops = { | 386 | static const struct file_operations hostfs_file_fops = { |
387 | .llseek = generic_file_llseek, | 387 | .llseek = generic_file_llseek, |
388 | .read = generic_file_read, | 388 | .read = do_sync_read, |
389 | .sendfile = generic_file_sendfile, | 389 | .sendfile = generic_file_sendfile, |
390 | .aio_read = generic_file_aio_read, | 390 | .aio_read = generic_file_aio_read, |
391 | .aio_write = generic_file_aio_write, | 391 | .aio_write = generic_file_aio_write, |
392 | .write = generic_file_write, | 392 | .write = do_sync_write, |
393 | .mmap = generic_file_mmap, | 393 | .mmap = generic_file_mmap, |
394 | .open = hostfs_file_open, | 394 | .open = hostfs_file_open, |
395 | .release = NULL, | 395 | .release = NULL, |
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c index d9eb19b7b8ae..8b94d24855f0 100644 --- a/fs/hpfs/file.c +++ b/fs/hpfs/file.c | |||
@@ -113,7 +113,7 @@ static ssize_t hpfs_file_write(struct file *file, const char __user *buf, | |||
113 | { | 113 | { |
114 | ssize_t retval; | 114 | ssize_t retval; |
115 | 115 | ||
116 | retval = generic_file_write(file, buf, count, ppos); | 116 | retval = do_sync_write(file, buf, count, ppos); |
117 | if (retval > 0) | 117 | if (retval > 0) |
118 | hpfs_i(file->f_dentry->d_inode)->i_dirty = 1; | 118 | hpfs_i(file->f_dentry->d_inode)->i_dirty = 1; |
119 | return retval; | 119 | return retval; |
@@ -122,8 +122,10 @@ static ssize_t hpfs_file_write(struct file *file, const char __user *buf, | |||
122 | const struct file_operations hpfs_file_ops = | 122 | const struct file_operations hpfs_file_ops = |
123 | { | 123 | { |
124 | .llseek = generic_file_llseek, | 124 | .llseek = generic_file_llseek, |
125 | .read = generic_file_read, | 125 | .read = do_sync_read, |
126 | .aio_read = generic_file_aio_read, | ||
126 | .write = hpfs_file_write, | 127 | .write = hpfs_file_write, |
128 | .aio_write = generic_file_aio_write, | ||
127 | .mmap = generic_file_mmap, | 129 | .mmap = generic_file_mmap, |
128 | .release = hpfs_file_release, | 130 | .release = hpfs_file_release, |
129 | .fsync = hpfs_file_fsync, | 131 | .fsync = hpfs_file_fsync, |
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c index f5cf9c93e243..068ef0de8de2 100644 --- a/fs/jffs/inode-v23.c +++ b/fs/jffs/inode-v23.c | |||
@@ -1632,8 +1632,10 @@ static const struct file_operations jffs_file_operations = | |||
1632 | { | 1632 | { |
1633 | .open = generic_file_open, | 1633 | .open = generic_file_open, |
1634 | .llseek = generic_file_llseek, | 1634 | .llseek = generic_file_llseek, |
1635 | .read = generic_file_read, | 1635 | .read = do_sync_read, |
1636 | .write = generic_file_write, | 1636 | .aio_read = generic_file_aio_read, |
1637 | .write = do_sync_write, | ||
1638 | .aio_write = generic_file_aio_write, | ||
1637 | .ioctl = jffs_ioctl, | 1639 | .ioctl = jffs_ioctl, |
1638 | .mmap = generic_file_readonly_mmap, | 1640 | .mmap = generic_file_readonly_mmap, |
1639 | .fsync = jffs_fsync, | 1641 | .fsync = jffs_fsync, |
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 3ed6e3e120b6..242875f77cb3 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
@@ -42,8 +42,10 @@ const struct file_operations jffs2_file_operations = | |||
42 | { | 42 | { |
43 | .llseek = generic_file_llseek, | 43 | .llseek = generic_file_llseek, |
44 | .open = generic_file_open, | 44 | .open = generic_file_open, |
45 | .read = generic_file_read, | 45 | .read = do_sync_read, |
46 | .write = generic_file_write, | 46 | .aio_read = generic_file_aio_read, |
47 | .write = do_sync_write, | ||
48 | .aio_write = generic_file_aio_write, | ||
47 | .ioctl = jffs2_ioctl, | 49 | .ioctl = jffs2_ioctl, |
48 | .mmap = generic_file_readonly_mmap, | 50 | .mmap = generic_file_readonly_mmap, |
49 | .fsync = jffs2_fsync, | 51 | .fsync = jffs2_fsync, |
diff --git a/fs/jfs/file.c b/fs/jfs/file.c index f535f2911c12..976e90dc2d1b 100644 --- a/fs/jfs/file.c +++ b/fs/jfs/file.c | |||
@@ -103,8 +103,8 @@ struct inode_operations jfs_file_inode_operations = { | |||
103 | const struct file_operations jfs_file_operations = { | 103 | const struct file_operations jfs_file_operations = { |
104 | .open = jfs_open, | 104 | .open = jfs_open, |
105 | .llseek = generic_file_llseek, | 105 | .llseek = generic_file_llseek, |
106 | .write = generic_file_write, | 106 | .write = do_sync_write, |
107 | .read = generic_file_read, | 107 | .read = do_sync_read, |
108 | .aio_read = generic_file_aio_read, | 108 | .aio_read = generic_file_aio_read, |
109 | .aio_write = generic_file_aio_write, | 109 | .aio_write = generic_file_aio_write, |
110 | .mmap = generic_file_mmap, | 110 | .mmap = generic_file_mmap, |
diff --git a/fs/minix/file.c b/fs/minix/file.c index 420b32882a10..40eac2e60d25 100644 --- a/fs/minix/file.c +++ b/fs/minix/file.c | |||
@@ -17,8 +17,10 @@ int minix_sync_file(struct file *, struct dentry *, int); | |||
17 | 17 | ||
18 | const struct file_operations minix_file_operations = { | 18 | const struct file_operations minix_file_operations = { |
19 | .llseek = generic_file_llseek, | 19 | .llseek = generic_file_llseek, |
20 | .read = generic_file_read, | 20 | .read = do_sync_read, |
21 | .write = generic_file_write, | 21 | .aio_read = generic_file_aio_read, |
22 | .write = do_sync_write, | ||
23 | .aio_write = generic_file_aio_write, | ||
22 | .mmap = generic_file_mmap, | 24 | .mmap = generic_file_mmap, |
23 | .fsync = minix_sync_file, | 25 | .fsync = minix_sync_file, |
24 | .sendfile = generic_file_sendfile, | 26 | .sendfile = generic_file_sendfile, |
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index 2f9b5a0953ff..ae2fe0016d2c 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c | |||
@@ -2296,7 +2296,7 @@ static int ntfs_file_fsync(struct file *filp, struct dentry *dentry, | |||
2296 | 2296 | ||
2297 | const struct file_operations ntfs_file_ops = { | 2297 | const struct file_operations ntfs_file_ops = { |
2298 | .llseek = generic_file_llseek, /* Seek inside file. */ | 2298 | .llseek = generic_file_llseek, /* Seek inside file. */ |
2299 | .read = generic_file_read, /* Read from file. */ | 2299 | .read = do_sync_read, /* Read from file. */ |
2300 | .aio_read = generic_file_aio_read, /* Async read from file. */ | 2300 | .aio_read = generic_file_aio_read, /* Async read from file. */ |
2301 | #ifdef NTFS_RW | 2301 | #ifdef NTFS_RW |
2302 | .write = ntfs_file_write, /* Write to file. */ | 2302 | .write = ntfs_file_write, /* Write to file. */ |
diff --git a/fs/qnx4/file.c b/fs/qnx4/file.c index 62af4b1348bd..467e5ac7280e 100644 --- a/fs/qnx4/file.c +++ b/fs/qnx4/file.c | |||
@@ -22,11 +22,13 @@ | |||
22 | const struct file_operations qnx4_file_operations = | 22 | const struct file_operations qnx4_file_operations = |
23 | { | 23 | { |
24 | .llseek = generic_file_llseek, | 24 | .llseek = generic_file_llseek, |
25 | .read = generic_file_read, | 25 | .read = do_sync_read, |
26 | .aio_read = generic_file_aio_read, | ||
26 | .mmap = generic_file_mmap, | 27 | .mmap = generic_file_mmap, |
27 | .sendfile = generic_file_sendfile, | 28 | .sendfile = generic_file_sendfile, |
28 | #ifdef CONFIG_QNX4FS_RW | 29 | #ifdef CONFIG_QNX4FS_RW |
29 | .write = generic_file_write, | 30 | .write = do_sync_write, |
31 | .aio_write = generic_file_aio_write, | ||
30 | .fsync = qnx4_sync_file, | 32 | .fsync = qnx4_sync_file, |
31 | #endif | 33 | #endif |
32 | }; | 34 | }; |
diff --git a/fs/ramfs/file-mmu.c b/fs/ramfs/file-mmu.c index 86f14cacf641..0947fb57dcf3 100644 --- a/fs/ramfs/file-mmu.c +++ b/fs/ramfs/file-mmu.c | |||
@@ -33,8 +33,10 @@ const struct address_space_operations ramfs_aops = { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | const struct file_operations ramfs_file_operations = { | 35 | const struct file_operations ramfs_file_operations = { |
36 | .read = generic_file_read, | 36 | .read = do_sync_read, |
37 | .write = generic_file_write, | 37 | .aio_read = generic_file_aio_read, |
38 | .write = do_sync_write, | ||
39 | .aio_write = generic_file_aio_write, | ||
38 | .mmap = generic_file_mmap, | 40 | .mmap = generic_file_mmap, |
39 | .fsync = simple_sync_file, | 41 | .fsync = simple_sync_file, |
40 | .sendfile = generic_file_sendfile, | 42 | .sendfile = generic_file_sendfile, |
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 677139b48e00..bfe5dbf1002e 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c | |||
@@ -36,8 +36,10 @@ const struct address_space_operations ramfs_aops = { | |||
36 | const struct file_operations ramfs_file_operations = { | 36 | const struct file_operations ramfs_file_operations = { |
37 | .mmap = ramfs_nommu_mmap, | 37 | .mmap = ramfs_nommu_mmap, |
38 | .get_unmapped_area = ramfs_nommu_get_unmapped_area, | 38 | .get_unmapped_area = ramfs_nommu_get_unmapped_area, |
39 | .read = generic_file_read, | 39 | .read = do_sync_read, |
40 | .write = generic_file_write, | 40 | .aio_read = generic_file_aio_read, |
41 | .write = do_sync_write, | ||
42 | .aio_write = generic_file_aio_write, | ||
41 | .fsync = simple_sync_file, | 43 | .fsync = simple_sync_file, |
42 | .sendfile = generic_file_sendfile, | 44 | .sendfile = generic_file_sendfile, |
43 | .llseek = generic_file_llseek, | 45 | .llseek = generic_file_llseek, |
diff --git a/fs/read_write.c b/fs/read_write.c index 32d54cca9bd9..4ed839bcb91c 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -22,7 +22,8 @@ | |||
22 | 22 | ||
23 | const struct file_operations generic_ro_fops = { | 23 | const struct file_operations generic_ro_fops = { |
24 | .llseek = generic_file_llseek, | 24 | .llseek = generic_file_llseek, |
25 | .read = generic_file_read, | 25 | .read = do_sync_read, |
26 | .aio_read = generic_file_aio_read, | ||
26 | .mmap = generic_file_readonly_mmap, | 27 | .mmap = generic_file_readonly_mmap, |
27 | .sendfile = generic_file_sendfile, | 28 | .sendfile = generic_file_sendfile, |
28 | }; | 29 | }; |
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c index dae67048baba..50784d13c87b 100644 --- a/fs/smbfs/file.c +++ b/fs/smbfs/file.c | |||
@@ -214,13 +214,15 @@ smb_updatepage(struct file *file, struct page *page, unsigned long offset, | |||
214 | } | 214 | } |
215 | 215 | ||
216 | static ssize_t | 216 | static ssize_t |
217 | smb_file_read(struct file * file, char __user * buf, size_t count, loff_t *ppos) | 217 | smb_file_aio_read(struct kiocb *iocb, const struct iovec *iov, |
218 | unsigned long nr_segs, loff_t pos) | ||
218 | { | 219 | { |
220 | struct file * file = iocb->ki_filp; | ||
219 | struct dentry * dentry = file->f_dentry; | 221 | struct dentry * dentry = file->f_dentry; |
220 | ssize_t status; | 222 | ssize_t status; |
221 | 223 | ||
222 | VERBOSE("file %s/%s, count=%lu@%lu\n", DENTRY_PATH(dentry), | 224 | VERBOSE("file %s/%s, count=%lu@%lu\n", DENTRY_PATH(dentry), |
223 | (unsigned long) count, (unsigned long) *ppos); | 225 | (unsigned long) iocb->ki_left, (unsigned long) pos); |
224 | 226 | ||
225 | status = smb_revalidate_inode(dentry); | 227 | status = smb_revalidate_inode(dentry); |
226 | if (status) { | 228 | if (status) { |
@@ -233,7 +235,7 @@ smb_file_read(struct file * file, char __user * buf, size_t count, loff_t *ppos) | |||
233 | (long)dentry->d_inode->i_size, | 235 | (long)dentry->d_inode->i_size, |
234 | dentry->d_inode->i_flags, dentry->d_inode->i_atime); | 236 | dentry->d_inode->i_flags, dentry->d_inode->i_atime); |
235 | 237 | ||
236 | status = generic_file_read(file, buf, count, ppos); | 238 | status = generic_file_aio_read(iocb, iov, nr_segs, pos); |
237 | out: | 239 | out: |
238 | return status; | 240 | return status; |
239 | } | 241 | } |
@@ -317,14 +319,16 @@ const struct address_space_operations smb_file_aops = { | |||
317 | * Write to a file (through the page cache). | 319 | * Write to a file (through the page cache). |
318 | */ | 320 | */ |
319 | static ssize_t | 321 | static ssize_t |
320 | smb_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) | 322 | smb_file_aio_write(struct kiocb *iocb, const struct iovec *iov, |
323 | unsigned long nr_segs, loff_t pos) | ||
321 | { | 324 | { |
325 | struct file * file = iocb->ki_filp; | ||
322 | struct dentry * dentry = file->f_dentry; | 326 | struct dentry * dentry = file->f_dentry; |
323 | ssize_t result; | 327 | ssize_t result; |
324 | 328 | ||
325 | VERBOSE("file %s/%s, count=%lu@%lu\n", | 329 | VERBOSE("file %s/%s, count=%lu@%lu\n", |
326 | DENTRY_PATH(dentry), | 330 | DENTRY_PATH(dentry), |
327 | (unsigned long) count, (unsigned long) *ppos); | 331 | (unsigned long) iocb->ki_left, (unsigned long) pos); |
328 | 332 | ||
329 | result = smb_revalidate_inode(dentry); | 333 | result = smb_revalidate_inode(dentry); |
330 | if (result) { | 334 | if (result) { |
@@ -337,8 +341,8 @@ smb_file_write(struct file *file, const char __user *buf, size_t count, loff_t * | |||
337 | if (result) | 341 | if (result) |
338 | goto out; | 342 | goto out; |
339 | 343 | ||
340 | if (count > 0) { | 344 | if (iocb->ki_left > 0) { |
341 | result = generic_file_write(file, buf, count, ppos); | 345 | result = generic_file_aio_write(iocb, iov, nr_segs, pos); |
342 | VERBOSE("pos=%ld, size=%ld, mtime=%ld, atime=%ld\n", | 346 | VERBOSE("pos=%ld, size=%ld, mtime=%ld, atime=%ld\n", |
343 | (long) file->f_pos, (long) dentry->d_inode->i_size, | 347 | (long) file->f_pos, (long) dentry->d_inode->i_size, |
344 | dentry->d_inode->i_mtime, dentry->d_inode->i_atime); | 348 | dentry->d_inode->i_mtime, dentry->d_inode->i_atime); |
@@ -402,8 +406,10 @@ smb_file_permission(struct inode *inode, int mask, struct nameidata *nd) | |||
402 | const struct file_operations smb_file_operations = | 406 | const struct file_operations smb_file_operations = |
403 | { | 407 | { |
404 | .llseek = remote_llseek, | 408 | .llseek = remote_llseek, |
405 | .read = smb_file_read, | 409 | .read = do_sync_read, |
406 | .write = smb_file_write, | 410 | .aio_read = smb_file_aio_read, |
411 | .write = do_sync_write, | ||
412 | .aio_write = smb_file_aio_write, | ||
407 | .ioctl = smb_ioctl, | 413 | .ioctl = smb_ioctl, |
408 | .mmap = smb_file_mmap, | 414 | .mmap = smb_file_mmap, |
409 | .open = smb_file_open, | 415 | .open = smb_file_open, |
diff --git a/fs/sysv/file.c b/fs/sysv/file.c index a59e303135fa..47a4b728f15b 100644 --- a/fs/sysv/file.c +++ b/fs/sysv/file.c | |||
@@ -21,8 +21,10 @@ | |||
21 | */ | 21 | */ |
22 | const struct file_operations sysv_file_operations = { | 22 | const struct file_operations sysv_file_operations = { |
23 | .llseek = generic_file_llseek, | 23 | .llseek = generic_file_llseek, |
24 | .read = generic_file_read, | 24 | .read = do_sync_read, |
25 | .write = generic_file_write, | 25 | .aio_read = generic_file_aio_read, |
26 | .write = do_sync_write, | ||
27 | .aio_write = generic_file_aio_write, | ||
26 | .mmap = generic_file_mmap, | 28 | .mmap = generic_file_mmap, |
27 | .fsync = sysv_sync_file, | 29 | .fsync = sysv_sync_file, |
28 | .sendfile = generic_file_sendfile, | 30 | .sendfile = generic_file_sendfile, |
diff --git a/fs/udf/file.c b/fs/udf/file.c index a59e5f33daf6..7aedd552cba1 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -103,19 +103,21 @@ const struct address_space_operations udf_adinicb_aops = { | |||
103 | .commit_write = udf_adinicb_commit_write, | 103 | .commit_write = udf_adinicb_commit_write, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static ssize_t udf_file_write(struct file * file, const char __user * buf, | 106 | static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov, |
107 | size_t count, loff_t *ppos) | 107 | unsigned long nr_segs, loff_t ppos) |
108 | { | 108 | { |
109 | ssize_t retval; | 109 | ssize_t retval; |
110 | struct file *file = iocb->ki_filp; | ||
110 | struct inode *inode = file->f_dentry->d_inode; | 111 | struct inode *inode = file->f_dentry->d_inode; |
111 | int err, pos; | 112 | int err, pos; |
113 | size_t count = iocb->ki_left; | ||
112 | 114 | ||
113 | if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) | 115 | if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) |
114 | { | 116 | { |
115 | if (file->f_flags & O_APPEND) | 117 | if (file->f_flags & O_APPEND) |
116 | pos = inode->i_size; | 118 | pos = inode->i_size; |
117 | else | 119 | else |
118 | pos = *ppos; | 120 | pos = ppos; |
119 | 121 | ||
120 | if (inode->i_sb->s_blocksize < (udf_file_entry_alloc_offset(inode) + | 122 | if (inode->i_sb->s_blocksize < (udf_file_entry_alloc_offset(inode) + |
121 | pos + count)) | 123 | pos + count)) |
@@ -136,7 +138,7 @@ static ssize_t udf_file_write(struct file * file, const char __user * buf, | |||
136 | } | 138 | } |
137 | } | 139 | } |
138 | 140 | ||
139 | retval = generic_file_write(file, buf, count, ppos); | 141 | retval = generic_file_aio_write(iocb, iov, nr_segs, ppos); |
140 | 142 | ||
141 | if (retval > 0) | 143 | if (retval > 0) |
142 | mark_inode_dirty(inode); | 144 | mark_inode_dirty(inode); |
@@ -249,11 +251,13 @@ static int udf_release_file(struct inode * inode, struct file * filp) | |||
249 | } | 251 | } |
250 | 252 | ||
251 | const struct file_operations udf_file_operations = { | 253 | const struct file_operations udf_file_operations = { |
252 | .read = generic_file_read, | 254 | .read = do_sync_read, |
255 | .aio_read = generic_file_aio_read, | ||
253 | .ioctl = udf_ioctl, | 256 | .ioctl = udf_ioctl, |
254 | .open = generic_file_open, | 257 | .open = generic_file_open, |
255 | .mmap = generic_file_mmap, | 258 | .mmap = generic_file_mmap, |
256 | .write = udf_file_write, | 259 | .write = do_sync_write, |
260 | .aio_write = udf_file_aio_write, | ||
257 | .release = udf_release_file, | 261 | .release = udf_release_file, |
258 | .fsync = udf_fsync_file, | 262 | .fsync = udf_fsync_file, |
259 | .sendfile = generic_file_sendfile, | 263 | .sendfile = generic_file_sendfile, |
diff --git a/fs/ufs/file.c b/fs/ufs/file.c index a9c6e5f04fae..1e096323bad4 100644 --- a/fs/ufs/file.c +++ b/fs/ufs/file.c | |||
@@ -53,8 +53,10 @@ static int ufs_sync_file(struct file *file, struct dentry *dentry, int datasync) | |||
53 | 53 | ||
54 | const struct file_operations ufs_file_operations = { | 54 | const struct file_operations ufs_file_operations = { |
55 | .llseek = generic_file_llseek, | 55 | .llseek = generic_file_llseek, |
56 | .read = generic_file_read, | 56 | .read = do_sync_read, |
57 | .write = generic_file_write, | 57 | .aio_read = generic_file_aio_read, |
58 | .write = do_sync_write, | ||
59 | .aio_write = generic_file_aio_write, | ||
58 | .mmap = generic_file_mmap, | 60 | .mmap = generic_file_mmap, |
59 | .open = generic_file_open, | 61 | .open = generic_file_open, |
60 | .fsync = ufs_sync_file, | 62 | .fsync = ufs_sync_file, |
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 55992b40353c..fa842f1c9fa2 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -279,7 +279,9 @@ xfs_read( | |||
279 | 279 | ||
280 | xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore, | 280 | xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore, |
281 | (void *)iovp, segs, *offset, ioflags); | 281 | (void *)iovp, segs, *offset, ioflags); |
282 | ret = __generic_file_aio_read(iocb, iovp, segs, offset); | 282 | |
283 | iocb->ki_pos = *offset; | ||
284 | ret = generic_file_aio_read(iocb, iovp, segs, *offset); | ||
283 | if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) | 285 | if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) |
284 | ret = wait_on_sync_kiocb(iocb); | 286 | ret = wait_on_sync_kiocb(iocb); |
285 | if (ret > 0) | 287 | if (ret > 0) |