[PATCH] Vectorize aio_read/aio_write fileop methods
This patch vectorizes aio_read() and aio_write() methods to prepare for collapsing all aio & vectored operations into one interface - which is aio_read()/aio_write(). Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Michael Holzheu <HOLZHEU@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
9ea0f9499d
commit
027445c372
@@ -134,12 +134,20 @@ static int hypfs_open(struct inode *inode, struct file *filp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t hypfs_aio_read(struct kiocb *iocb, __user char *buf,
|
||||
size_t count, loff_t offset)
|
||||
static ssize_t hypfs_aio_read(struct kiocb *iocb, const struct iovec *iov,
|
||||
unsigned long nr_segs, loff_t offset)
|
||||
{
|
||||
char *data;
|
||||
size_t len;
|
||||
struct file *filp = iocb->ki_filp;
|
||||
/* XXX: temporary */
|
||||
char __user *buf = iov[0].iov_base;
|
||||
size_t count = iov[0].iov_len;
|
||||
|
||||
if (nr_segs != 1) {
|
||||
count = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
data = filp->private_data;
|
||||
len = strlen(data);
|
||||
@@ -158,12 +166,13 @@ static ssize_t hypfs_aio_read(struct kiocb *iocb, __user char *buf,
|
||||
out:
|
||||
return count;
|
||||
}
|
||||
static ssize_t hypfs_aio_write(struct kiocb *iocb, const char __user *buf,
|
||||
size_t count, loff_t pos)
|
||||
static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
|
||||
unsigned long nr_segs, loff_t offset)
|
||||
{
|
||||
int rc;
|
||||
struct super_block *sb;
|
||||
struct hypfs_sb_info *fs_info;
|
||||
size_t count = iov_length(iov, nr_segs);
|
||||
|
||||
sb = iocb->ki_filp->f_dentry->d_inode->i_sb;
|
||||
fs_info = sb->s_fs_info;
|
||||
|
Reference in New Issue
Block a user