[PATCH] Vectorize aio_read/aio_write fileop methods
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / xfs / linux-2.6 / xfs_file.c
index 41cfcba7ce49bed9c85e94785c163922e44a57c8..4737971c6a39ba231c5044340dc3e16c03bb7f76 100644 (file)
@@ -49,50 +49,49 @@ static struct vm_operations_struct xfs_dmapi_file_vm_ops;
 STATIC inline ssize_t
 __xfs_file_read(
        struct kiocb            *iocb,
-       char                    __user *buf,
+       const struct iovec      *iov,
+       unsigned long           nr_segs,
        int                     ioflags,
-       size_t                  count,
        loff_t                  pos)
 {
-       struct iovec            iov = {buf, count};
        struct file             *file = iocb->ki_filp;
        bhv_vnode_t             *vp = vn_from_inode(file->f_dentry->d_inode);
 
        BUG_ON(iocb->ki_pos != pos);
        if (unlikely(file->f_flags & O_DIRECT))
                ioflags |= IO_ISDIRECT;
-       return bhv_vop_read(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL);
+       return bhv_vop_read(vp, iocb, iov, nr_segs, &iocb->ki_pos,
+                               ioflags, NULL);
 }
 
 STATIC ssize_t
 xfs_file_aio_read(
        struct kiocb            *iocb,
-       char                    __user *buf,
-       size_t                  count,
+       const struct iovec      *iov,
+       unsigned long           nr_segs,
        loff_t                  pos)
 {
-       return __xfs_file_read(iocb, buf, IO_ISAIO, count, pos);
+       return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO, pos);
 }
 
 STATIC ssize_t
 xfs_file_aio_read_invis(
        struct kiocb            *iocb,
-       char                    __user *buf,
-       size_t                  count,
+       const struct iovec      *iov,
+       unsigned long           nr_segs,
        loff_t                  pos)
 {
-       return __xfs_file_read(iocb, buf, IO_ISAIO|IO_INVIS, count, pos);
+       return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos);
 }
 
 STATIC inline ssize_t
 __xfs_file_write(
-       struct kiocb    *iocb,
-       const char      __user *buf,
-       int             ioflags,
-       size_t          count,
-       loff_t          pos)
+       struct kiocb            *iocb,
+       const struct iovec      *iov,
+       unsigned long           nr_segs,
+       int                     ioflags,
+       loff_t                  pos)
 {
-       struct iovec    iov = {(void __user *)buf, count};
        struct file     *file = iocb->ki_filp;
        struct inode    *inode = file->f_mapping->host;
        bhv_vnode_t     *vp = vn_from_inode(inode);
@@ -100,27 +99,28 @@ __xfs_file_write(
        BUG_ON(iocb->ki_pos != pos);
        if (unlikely(file->f_flags & O_DIRECT))
                ioflags |= IO_ISDIRECT;
-       return bhv_vop_write(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL);
+       return bhv_vop_write(vp, iocb, iov, nr_segs, &iocb->ki_pos,
+                               ioflags, NULL);
 }
 
 STATIC ssize_t
 xfs_file_aio_write(
        struct kiocb            *iocb,
-       const char              __user *buf,
-       size_t                  count,
+       const struct iovec      *iov,
+       unsigned long           nr_segs,
        loff_t                  pos)
 {
-       return __xfs_file_write(iocb, buf, IO_ISAIO, count, pos);
+       return __xfs_file_write(iocb, iov, nr_segs, IO_ISAIO, pos);
 }
 
 STATIC ssize_t
 xfs_file_aio_write_invis(
        struct kiocb            *iocb,
-       const char              __user *buf,
-       size_t                  count,
+       const struct iovec      *iov,
+       unsigned long           nr_segs,
        loff_t                  pos)
 {
-       return __xfs_file_write(iocb, buf, IO_ISAIO|IO_INVIS, count, pos);
+       return __xfs_file_write(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos);
 }
 
 STATIC inline ssize_t