mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
[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>
This commit is contained in:
parent
ee0b3e671b
commit
543ade1fc9
27 changed files with 105 additions and 165 deletions
|
@ -1154,14 +1154,6 @@ static int blkdev_close(struct inode * inode, struct file * filp)
|
|||
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);
|
||||
|
@ -1181,8 +1173,8 @@ const struct file_operations def_blk_fops = {
|
|||
.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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue