aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_file.c
diff options
context:
space:
mode:
authorBadari Pulavarty <pbadari@us.ibm.com>2006-10-01 02:28:46 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:28 -0400
commit027445c37282bc1ed26add45e573ad2d3e4860a5 (patch)
tree93eab101a938ffebaea64703033c8649df4d73f0 /fs/xfs/linux-2.6/xfs_file.c
parent9ea0f9499d15c49df23e7aac4332d830c40e12d0 (diff)
[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>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 41cfcba7ce49..4737971c6a39 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -49,50 +49,49 @@ static struct vm_operations_struct xfs_dmapi_file_vm_ops;
49STATIC inline ssize_t 49STATIC inline ssize_t
50__xfs_file_read( 50__xfs_file_read(
51 struct kiocb *iocb, 51 struct kiocb *iocb,
52 char __user *buf, 52 const struct iovec *iov,
53 unsigned long nr_segs,
53 int ioflags, 54 int ioflags,
54 size_t count,
55 loff_t pos) 55 loff_t pos)
56{ 56{
57 struct iovec iov = {buf, count};
58 struct file *file = iocb->ki_filp; 57 struct file *file = iocb->ki_filp;
59 bhv_vnode_t *vp = vn_from_inode(file->f_dentry->d_inode); 58 bhv_vnode_t *vp = vn_from_inode(file->f_dentry->d_inode);
60 59
61 BUG_ON(iocb->ki_pos != pos); 60 BUG_ON(iocb->ki_pos != pos);
62 if (unlikely(file->f_flags & O_DIRECT)) 61 if (unlikely(file->f_flags & O_DIRECT))
63 ioflags |= IO_ISDIRECT; 62 ioflags |= IO_ISDIRECT;
64 return bhv_vop_read(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL); 63 return bhv_vop_read(vp, iocb, iov, nr_segs, &iocb->ki_pos,
64 ioflags, NULL);
65} 65}
66 66
67STATIC ssize_t 67STATIC ssize_t
68xfs_file_aio_read( 68xfs_file_aio_read(
69 struct kiocb *iocb, 69 struct kiocb *iocb,
70 char __user *buf, 70 const struct iovec *iov,
71 size_t count, 71 unsigned long nr_segs,
72 loff_t pos) 72 loff_t pos)
73{ 73{
74 return __xfs_file_read(iocb, buf, IO_ISAIO, count, pos); 74 return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO, pos);
75} 75}
76 76
77STATIC ssize_t 77STATIC ssize_t
78xfs_file_aio_read_invis( 78xfs_file_aio_read_invis(
79 struct kiocb *iocb, 79 struct kiocb *iocb,
80 char __user *buf, 80 const struct iovec *iov,
81 size_t count, 81 unsigned long nr_segs,
82 loff_t pos) 82 loff_t pos)
83{ 83{
84 return __xfs_file_read(iocb, buf, IO_ISAIO|IO_INVIS, count, pos); 84 return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos);
85} 85}
86 86
87STATIC inline ssize_t 87STATIC inline ssize_t
88__xfs_file_write( 88__xfs_file_write(
89 struct kiocb *iocb, 89 struct kiocb *iocb,
90 const char __user *buf, 90 const struct iovec *iov,
91 int ioflags, 91 unsigned long nr_segs,
92 size_t count, 92 int ioflags,
93 loff_t pos) 93 loff_t pos)
94{ 94{
95 struct iovec iov = {(void __user *)buf, count};
96 struct file *file = iocb->ki_filp; 95 struct file *file = iocb->ki_filp;
97 struct inode *inode = file->f_mapping->host; 96 struct inode *inode = file->f_mapping->host;
98 bhv_vnode_t *vp = vn_from_inode(inode); 97 bhv_vnode_t *vp = vn_from_inode(inode);
@@ -100,27 +99,28 @@ __xfs_file_write(
100 BUG_ON(iocb->ki_pos != pos); 99 BUG_ON(iocb->ki_pos != pos);
101 if (unlikely(file->f_flags & O_DIRECT)) 100 if (unlikely(file->f_flags & O_DIRECT))
102 ioflags |= IO_ISDIRECT; 101 ioflags |= IO_ISDIRECT;
103 return bhv_vop_write(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL); 102 return bhv_vop_write(vp, iocb, iov, nr_segs, &iocb->ki_pos,
103 ioflags, NULL);
104} 104}
105 105
106STATIC ssize_t 106STATIC ssize_t
107xfs_file_aio_write( 107xfs_file_aio_write(
108 struct kiocb *iocb, 108 struct kiocb *iocb,
109 const char __user *buf, 109 const struct iovec *iov,
110 size_t count, 110 unsigned long nr_segs,
111 loff_t pos) 111 loff_t pos)
112{ 112{
113 return __xfs_file_write(iocb, buf, IO_ISAIO, count, pos); 113 return __xfs_file_write(iocb, iov, nr_segs, IO_ISAIO, pos);
114} 114}
115 115
116STATIC ssize_t 116STATIC ssize_t
117xfs_file_aio_write_invis( 117xfs_file_aio_write_invis(
118 struct kiocb *iocb, 118 struct kiocb *iocb,
119 const char __user *buf, 119 const struct iovec *iov,
120 size_t count, 120 unsigned long nr_segs,
121 loff_t pos) 121 loff_t pos)
122{ 122{
123 return __xfs_file_write(iocb, buf, IO_ISAIO|IO_INVIS, count, pos); 123 return __xfs_file_write(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos);
124} 124}
125 125
126STATIC inline ssize_t 126STATIC inline ssize_t