The patch titled Streamline generic_file_* interfaces and filemap cleanups has been removed from the -mm tree. Its filename is streamline-generic_file_-interfaces-and-filemap.patch This patch was probably dropped from -mm because it has now been merged into a subsystem tree or into Linus's tree, or because it was folded into its parent patch in the -mm tree. From: Badari Pulavarty <pbadari@xxxxxxxxxx> Clean 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@xxxxxxxxxx> Signed-off-by: Christoph Hellwig <hch@xxxxxx> Cc: Benjamin LaHaise <bcrl@xxxxxxxxx> Cc: Zach Brown <zab@xxxxxxxxx> Cc: Mark Fasheh <mark.fasheh@xxxxxxxxxx> Cc: Joel Becker <Joel.Becker@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/char/raw.c | 15 ----- fs/adfs/file.c | 6 +- fs/affs/file.c | 6 +- fs/bfs/file.c | 6 +- fs/block_dev.c | 12 ---- fs/ext2/file.c | 4 - fs/fuse/file.c | 6 +- fs/hfs/inode.c | 6 +- fs/hfsplus/inode.c | 6 +- fs/hostfs/hostfs_kern.c | 4 - fs/hpfs/file.c | 6 +- fs/jffs/inode-v23.c | 6 +- fs/jffs2/file.c | 6 +- fs/jfs/file.c | 4 - fs/minix/file.c | 6 +- fs/ntfs/file.c | 2 fs/qnx4/file.c | 6 +- fs/ramfs/file-mmu.c | 6 +- fs/ramfs/file-nommu.c | 6 +- fs/read_write.c | 3 - fs/xfs/linux-2.6/xfs_lrw.c | 4 + include/linux/fs.h | 5 - mm/filemap.c | 88 +---------------------------------- 23 files changed, 72 insertions(+), 147 deletions(-) diff -puN drivers/char/raw.c~streamline-generic_file_-interfaces-and-filemap drivers/char/raw.c --- devel/drivers/char/raw.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/drivers/char/raw.c 2006-05-11 15:19:08.000000000 -0700 @@ -238,21 +238,10 @@ out: return err; } -static ssize_t raw_file_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct iovec local_iov = { - .iov_base = (char __user *)buf, - .iov_len = count - }; - - return generic_file_write_nolock(file, &local_iov, 1, ppos); -} - static struct file_operations raw_fops = { - .read = generic_file_read, + .read = do_sync_read, .aio_read = generic_file_aio_read, - .write = raw_file_write, + .write = do_sync_write, .aio_write = generic_file_aio_write_nolock, .open = raw_open, .release= raw_release, diff -puN fs/adfs/file.c~streamline-generic_file_-interfaces-and-filemap fs/adfs/file.c --- devel/fs/adfs/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/adfs/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -27,10 +27,12 @@ const struct file_operations adfs_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, + .read = do_sync_read, + .aio_read = generic_file_aio_read, .mmap = generic_file_mmap, .fsync = file_fsync, - .write = generic_file_write, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .sendfile = generic_file_sendfile, }; diff -puN fs/affs/file.c~streamline-generic_file_-interfaces-and-filemap fs/affs/file.c --- devel/fs/affs/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/affs/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -27,8 +27,10 @@ static int affs_file_release(struct inod const struct file_operations affs_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, .open = affs_file_open, .release = affs_file_release, diff -puN fs/bfs/file.c~streamline-generic_file_-interfaces-and-filemap fs/bfs/file.c --- devel/fs/bfs/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/bfs/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -19,8 +19,10 @@ const struct file_operations bfs_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, .sendfile = generic_file_sendfile, }; diff -puN fs/block_dev.c~streamline-generic_file_-interfaces-and-filemap fs/block_dev.c --- devel/fs/block_dev.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/block_dev.c 2006-05-11 15:19:08.000000000 -0700 @@ -1073,14 +1073,6 @@ static int blkdev_close(struct inode * i return blkdev_put(bdev); } -static ssize_t blkdev_file_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct iovec local_iov = { .iov_base = (void __user *)buf, .iov_len = count }; - - return generic_file_write_nolock(file, &local_iov, 1, ppos); -} - static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg) { return blkdev_ioctl(file->f_mapping->host, file, cmd, arg); @@ -1100,8 +1092,8 @@ const struct file_operations def_blk_fop .open = blkdev_open, .release = blkdev_close, .llseek = block_llseek, - .read = generic_file_read, - .write = blkdev_file_write, + .read = do_sync_read, + .write = do_sync_write, .aio_read = generic_file_aio_read, .aio_write = generic_file_aio_write_nolock, .mmap = generic_file_mmap, diff -puN fs/ext2/file.c~streamline-generic_file_-interfaces-and-filemap fs/ext2/file.c --- devel/fs/ext2/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/ext2/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -41,8 +41,8 @@ static int ext2_release_file (struct ino */ const struct file_operations ext2_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .write = do_sync_write, .aio_read = generic_file_aio_read, .aio_write = generic_file_aio_write, .ioctl = ext2_ioctl, diff -puN fs/fuse/file.c~streamline-generic_file_-interfaces-and-filemap fs/fuse/file.c --- devel/fs/fuse/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/fuse/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -621,8 +621,10 @@ static int fuse_set_page_dirty(struct pa static const struct file_operations fuse_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = fuse_file_mmap, .open = fuse_open, .flush = fuse_flush, diff -puN fs/hfs/inode.c~streamline-generic_file_-interfaces-and-filemap fs/hfs/inode.c --- devel/fs/hfs/inode.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/hfs/inode.c 2006-05-11 15:19:08.000000000 -0700 @@ -603,8 +603,10 @@ int hfs_inode_setattr(struct dentry *den static const struct file_operations hfs_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, .sendfile = generic_file_sendfile, .fsync = file_fsync, diff -puN fs/hfsplus/inode.c~streamline-generic_file_-interfaces-and-filemap fs/hfsplus/inode.c --- devel/fs/hfsplus/inode.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/hfsplus/inode.c 2006-05-11 15:19:08.000000000 -0700 @@ -282,8 +282,10 @@ static struct inode_operations hfsplus_f static const struct file_operations hfsplus_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, .sendfile = generic_file_sendfile, .fsync = file_fsync, diff -puN fs/hostfs/hostfs_kern.c~streamline-generic_file_-interfaces-and-filemap fs/hostfs/hostfs_kern.c --- devel/fs/hostfs/hostfs_kern.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/hostfs/hostfs_kern.c 2006-05-11 15:19:08.000000000 -0700 @@ -386,11 +386,11 @@ int hostfs_fsync(struct file *file, stru static const struct file_operations hostfs_file_fops = { .llseek = generic_file_llseek, - .read = generic_file_read, + .read = do_sync_read, .sendfile = generic_file_sendfile, .aio_read = generic_file_aio_read, .aio_write = generic_file_aio_write, - .write = generic_file_write, + .write = do_sync_write, .mmap = generic_file_mmap, .open = hostfs_file_open, .release = NULL, diff -puN fs/hpfs/file.c~streamline-generic_file_-interfaces-and-filemap fs/hpfs/file.c --- devel/fs/hpfs/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/hpfs/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -113,7 +113,7 @@ static ssize_t hpfs_file_write(struct fi { ssize_t retval; - retval = generic_file_write(file, buf, count, ppos); + retval = do_sync_write(file, buf, count, ppos); if (retval > 0) hpfs_i(file->f_dentry->d_inode)->i_dirty = 1; return retval; @@ -122,8 +122,10 @@ static ssize_t hpfs_file_write(struct fi const struct file_operations hpfs_file_ops = { .llseek = generic_file_llseek, - .read = generic_file_read, + .read = do_sync_read, + .aio_read = generic_file_aio_read, .write = hpfs_file_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, .release = hpfs_file_release, .fsync = hpfs_file_fsync, diff -puN fs/jffs2/file.c~streamline-generic_file_-interfaces-and-filemap fs/jffs2/file.c --- devel/fs/jffs2/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/jffs2/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -42,8 +42,10 @@ const struct file_operations jffs2_file_ { .llseek = generic_file_llseek, .open = generic_file_open, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_readonly_mmap, .fsync = jffs2_fsync, .sendfile = generic_file_sendfile diff -puN fs/jffs/inode-v23.c~streamline-generic_file_-interfaces-and-filemap fs/jffs/inode-v23.c --- devel/fs/jffs/inode-v23.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/jffs/inode-v23.c 2006-05-11 15:19:08.000000000 -0700 @@ -1633,8 +1633,10 @@ static const struct file_operations jffs { .open = generic_file_open, .llseek = generic_file_llseek, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .ioctl = jffs_ioctl, .mmap = generic_file_readonly_mmap, .fsync = jffs_fsync, diff -puN fs/jfs/file.c~streamline-generic_file_-interfaces-and-filemap fs/jfs/file.c --- devel/fs/jfs/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/jfs/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -103,8 +103,8 @@ struct inode_operations jfs_file_inode_o const struct file_operations jfs_file_operations = { .open = jfs_open, .llseek = generic_file_llseek, - .write = generic_file_write, - .read = generic_file_read, + .write = do_sync_write, + .read = do_sync_read, .aio_read = generic_file_aio_read, .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, diff -puN fs/minix/file.c~streamline-generic_file_-interfaces-and-filemap fs/minix/file.c --- devel/fs/minix/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/minix/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -17,8 +17,10 @@ int minix_sync_file(struct file *, struc const struct file_operations minix_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, .fsync = minix_sync_file, .sendfile = generic_file_sendfile, diff -puN fs/ntfs/file.c~streamline-generic_file_-interfaces-and-filemap fs/ntfs/file.c --- devel/fs/ntfs/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/ntfs/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -2293,7 +2293,7 @@ static int ntfs_file_fsync(struct file * const struct file_operations ntfs_file_ops = { .llseek = generic_file_llseek, /* Seek inside file. */ - .read = generic_file_read, /* Read from file. */ + .read = do_sync_read, /* Read from file. */ .aio_read = generic_file_aio_read, /* Async read from file. */ #ifdef NTFS_RW .write = ntfs_file_write, /* Write to file. */ diff -puN fs/qnx4/file.c~streamline-generic_file_-interfaces-and-filemap fs/qnx4/file.c --- devel/fs/qnx4/file.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/qnx4/file.c 2006-05-11 15:19:08.000000000 -0700 @@ -22,11 +22,13 @@ const struct file_operations qnx4_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, + .read = do_sync_read, + .aio_read = generic_file_aio_read, .mmap = generic_file_mmap, .sendfile = generic_file_sendfile, #ifdef CONFIG_QNX4FS_RW - .write = generic_file_write, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .fsync = qnx4_sync_file, #endif }; diff -puN fs/ramfs/file-mmu.c~streamline-generic_file_-interfaces-and-filemap fs/ramfs/file-mmu.c --- devel/fs/ramfs/file-mmu.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/ramfs/file-mmu.c 2006-05-11 15:19:08.000000000 -0700 @@ -33,8 +33,10 @@ const struct address_space_operations ra }; const struct file_operations ramfs_file_operations = { - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, .fsync = simple_sync_file, .sendfile = generic_file_sendfile, diff -puN fs/ramfs/file-nommu.c~streamline-generic_file_-interfaces-and-filemap fs/ramfs/file-nommu.c --- devel/fs/ramfs/file-nommu.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/ramfs/file-nommu.c 2006-05-11 15:19:08.000000000 -0700 @@ -36,8 +36,10 @@ const struct address_space_operations ra const struct file_operations ramfs_file_operations = { .mmap = ramfs_nommu_mmap, .get_unmapped_area = ramfs_nommu_get_unmapped_area, - .read = generic_file_read, - .write = generic_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .fsync = simple_sync_file, .sendfile = generic_file_sendfile, .llseek = generic_file_llseek, diff -puN fs/read_write.c~streamline-generic_file_-interfaces-and-filemap fs/read_write.c --- devel/fs/read_write.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/read_write.c 2006-05-11 15:19:08.000000000 -0700 @@ -22,7 +22,8 @@ const struct file_operations generic_ro_fops = { .llseek = generic_file_llseek, - .read = generic_file_read, + .read = do_sync_read, + .aio_read = generic_file_aio_read, .mmap = generic_file_readonly_mmap, .sendfile = generic_file_sendfile, }; diff -puN fs/xfs/linux-2.6/xfs_lrw.c~streamline-generic_file_-interfaces-and-filemap fs/xfs/linux-2.6/xfs_lrw.c --- devel/fs/xfs/linux-2.6/xfs_lrw.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/fs/xfs/linux-2.6/xfs_lrw.c 2006-05-11 15:19:08.000000000 -0700 @@ -276,7 +276,9 @@ xfs_read( xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore, (void *)iovp, segs, *offset, ioflags); - ret = __generic_file_aio_read(iocb, iovp, segs, offset); + + iocb->ki_pos = *offset; + ret = generic_file_aio_read(iocb, iovp, segs, *offset); if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) ret = wait_on_sync_kiocb(iocb); if (ret > 0) diff -puN include/linux/fs.h~streamline-generic_file_-interfaces-and-filemap include/linux/fs.h --- devel/include/linux/fs.h~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/include/linux/fs.h 2006-05-11 15:19:08.000000000 -0700 @@ -1610,11 +1610,8 @@ extern int generic_file_mmap(struct file extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); -extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *); int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); -extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *); extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); -extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *); extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, unsigned long, loff_t); @@ -1625,8 +1622,6 @@ extern ssize_t generic_file_buffered_wri extern int generic_file_buffered_write_one_kernel_page(struct file *, pgoff_t, struct page *); extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); -ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos); extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); extern void do_generic_mapping_read(struct address_space *mapping, struct file_ra_state *, struct file *, diff -puN mm/filemap.c~streamline-generic_file_-interfaces-and-filemap mm/filemap.c --- devel/mm/filemap.c~streamline-generic_file_-interfaces-and-filemap 2006-05-11 15:19:08.000000000 -0700 +++ devel-akpm/mm/filemap.c 2006-05-11 15:19:08.000000000 -0700 @@ -1080,13 +1080,14 @@ EXPORT_SYMBOL(file_read_actor); * that can use the page cache directly. */ ssize_t -__generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos) +generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov, + unsigned long nr_segs, loff_t pos) { struct file *filp = iocb->ki_filp; ssize_t retval; unsigned long seg; size_t count; + loff_t *ppos = &iocb->ki_pos; count = 0; for (seg = 0; seg < nr_segs; seg++) { @@ -1110,7 +1111,7 @@ __generic_file_aio_read(struct kiocb *io /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */ if (filp->f_flags & O_DIRECT) { - loff_t pos = *ppos, size; + loff_t size; struct address_space *mapping; struct inode *inode; @@ -1155,33 +1156,8 @@ out: return retval; } -EXPORT_SYMBOL(__generic_file_aio_read); - -ssize_t -generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov, - unsigned long nr_segs, loff_t pos) -{ - BUG_ON(iocb->ki_pos != pos); - return __generic_file_aio_read(iocb, iov, nr_segs, &iocb->ki_pos); -} EXPORT_SYMBOL(generic_file_aio_read); -ssize_t -generic_file_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos) -{ - struct iovec local_iov = { .iov_base = buf, .iov_len = count }; - struct kiocb kiocb; - ssize_t ret; - - init_sync_kiocb(&kiocb, filp); - ret = __generic_file_aio_read(&kiocb, &local_iov, 1, ppos); - if (-EIOCBQUEUED == ret) - ret = wait_on_sync_kiocb(&kiocb); - return ret; -} - -EXPORT_SYMBOL(generic_file_read); - int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size) { ssize_t written; @@ -2338,38 +2314,6 @@ ssize_t generic_file_aio_write_nolock(st } EXPORT_SYMBOL(generic_file_aio_write_nolock); -static ssize_t -__generic_file_write_nolock(struct file *file, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos) -{ - struct kiocb kiocb; - ssize_t ret; - - init_sync_kiocb(&kiocb, file); - kiocb.ki_pos = *ppos; - ret = __generic_file_aio_write_nolock(&kiocb, iov, nr_segs, ppos); - if (-EIOCBQUEUED == ret) - ret = wait_on_sync_kiocb(&kiocb); - return ret; -} - -ssize_t -generic_file_write_nolock(struct file *file, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos) -{ - struct kiocb kiocb; - ssize_t ret; - - init_sync_kiocb(&kiocb, file); - kiocb.ki_pos = *ppos; - ret = generic_file_aio_write_nolock(&kiocb, iov, nr_segs, *ppos); - if (-EIOCBQUEUED == ret) - ret = wait_on_sync_kiocb(&kiocb); - *ppos = kiocb.ki_pos; - return ret; -} -EXPORT_SYMBOL(generic_file_write_nolock); - ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { @@ -2395,30 +2339,6 @@ ssize_t generic_file_aio_write(struct ki } EXPORT_SYMBOL(generic_file_aio_write); -ssize_t generic_file_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct address_space *mapping = file->f_mapping; - struct inode *inode = mapping->host; - ssize_t ret; - struct iovec local_iov = { .iov_base = (void __user *)buf, - .iov_len = count }; - - mutex_lock(&inode->i_mutex); - ret = __generic_file_write_nolock(file, &local_iov, 1, ppos); - mutex_unlock(&inode->i_mutex); - - if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { - ssize_t err; - - err = sync_page_range(inode, mapping, *ppos - ret, ret); - if (err < 0) - ret = err; - } - return ret; -} -EXPORT_SYMBOL(generic_file_write); - /* * Called under i_mutex for writes to S_ISREG files. Returns -EIO if something * went wrong during pagecache shootdown. _ Patches currently in -mm which might be from pbadari@xxxxxxxxxx are streamline-generic_file_-interfaces-and-filemap.patch streamline-generic_file_-interfaces-and-filemap-fix.patch ext3-add-o-bh-option.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html