[PATCH] Vectorize aio_read/aio_write fileop methods
[deliverable/linux.git] / fs / xfs / linux-2.6 / xfs_file.c
index 70662371bb11fda80e1be225a9bf32b159595491..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
@@ -299,7 +299,8 @@ xfs_file_open(
 
 STATIC int
 xfs_file_close(
-       struct file     *filp)
+       struct file     *filp,
+       fl_owner_t      id)
 {
        return -bhv_vop_close(vn_from_inode(filp->f_dentry->d_inode), 0,
                                file_count(filp) > 1 ? L_FALSE : L_TRUE, NULL);
@@ -369,7 +370,7 @@ xfs_file_readdir(
 
        /* Try fairly hard to get memory */
        do {
-               if ((read_buf = (caddr_t)kmalloc(rlen, GFP_KERNEL)))
+               if ((read_buf = kmalloc(rlen, GFP_KERNEL)))
                        break;
                rlen >>= 1;
        } while (rlen >= 1024);
This page took 0.026071 seconds and 5 git commands to generate.