diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 3678f6912d04..83707708ebb1 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "xfs_error.h" | 37 | #include "xfs_error.h" |
38 | #include "xfs_rw.h" | 38 | #include "xfs_rw.h" |
39 | #include "xfs_ioctl32.h" | 39 | #include "xfs_ioctl32.h" |
40 | #include "xfs_vnodeops.h" | ||
40 | 41 | ||
41 | #include <linux/dcache.h> | 42 | #include <linux/dcache.h> |
42 | #include <linux/smp_lock.h> | 43 | #include <linux/smp_lock.h> |
@@ -55,13 +56,12 @@ __xfs_file_read( | |||
55 | loff_t pos) | 56 | loff_t pos) |
56 | { | 57 | { |
57 | struct file *file = iocb->ki_filp; | 58 | struct file *file = iocb->ki_filp; |
58 | bhv_vnode_t *vp = vn_from_inode(file->f_path.dentry->d_inode); | ||
59 | 59 | ||
60 | BUG_ON(iocb->ki_pos != pos); | 60 | BUG_ON(iocb->ki_pos != pos); |
61 | if (unlikely(file->f_flags & O_DIRECT)) | 61 | if (unlikely(file->f_flags & O_DIRECT)) |
62 | ioflags |= IO_ISDIRECT; | 62 | ioflags |= IO_ISDIRECT; |
63 | return bhv_vop_read(vp, iocb, iov, nr_segs, &iocb->ki_pos, | 63 | return xfs_read(XFS_I(file->f_path.dentry->d_inode), iocb, iov, |
64 | ioflags, NULL); | 64 | nr_segs, &iocb->ki_pos, ioflags); |
65 | } | 65 | } |
66 | 66 | ||
67 | STATIC ssize_t | 67 | STATIC ssize_t |
@@ -93,14 +93,12 @@ __xfs_file_write( | |||
93 | loff_t pos) | 93 | loff_t pos) |
94 | { | 94 | { |
95 | struct file *file = iocb->ki_filp; | 95 | struct file *file = iocb->ki_filp; |
96 | struct inode *inode = file->f_mapping->host; | ||
97 | bhv_vnode_t *vp = vn_from_inode(inode); | ||
98 | 96 | ||
99 | BUG_ON(iocb->ki_pos != pos); | 97 | BUG_ON(iocb->ki_pos != pos); |
100 | if (unlikely(file->f_flags & O_DIRECT)) | 98 | if (unlikely(file->f_flags & O_DIRECT)) |
101 | ioflags |= IO_ISDIRECT; | 99 | ioflags |= IO_ISDIRECT; |
102 | return bhv_vop_write(vp, iocb, iov, nr_segs, &iocb->ki_pos, | 100 | return xfs_write(XFS_I(file->f_mapping->host), iocb, iov, nr_segs, |
103 | ioflags, NULL); | 101 | &iocb->ki_pos, ioflags); |
104 | } | 102 | } |
105 | 103 | ||
106 | STATIC ssize_t | 104 | STATIC ssize_t |
@@ -131,8 +129,8 @@ xfs_file_splice_read( | |||
131 | size_t len, | 129 | size_t len, |
132 | unsigned int flags) | 130 | unsigned int flags) |
133 | { | 131 | { |
134 | return bhv_vop_splice_read(vn_from_inode(infilp->f_path.dentry->d_inode), | 132 | return xfs_splice_read(XFS_I(infilp->f_path.dentry->d_inode), |
135 | infilp, ppos, pipe, len, flags, 0, NULL); | 133 | infilp, ppos, pipe, len, flags, 0); |
136 | } | 134 | } |
137 | 135 | ||
138 | STATIC ssize_t | 136 | STATIC ssize_t |
@@ -143,9 +141,8 @@ xfs_file_splice_read_invis( | |||
143 | size_t len, | 141 | size_t len, |
144 | unsigned int flags) | 142 | unsigned int flags) |
145 | { | 143 | { |
146 | return bhv_vop_splice_read(vn_from_inode(infilp->f_path.dentry->d_inode), | 144 | return xfs_splice_read(XFS_I(infilp->f_path.dentry->d_inode), |
147 | infilp, ppos, pipe, len, flags, IO_INVIS, | 145 | infilp, ppos, pipe, len, flags, IO_INVIS); |
148 | NULL); | ||
149 | } | 146 | } |
150 | 147 | ||
151 | STATIC ssize_t | 148 | STATIC ssize_t |
@@ -156,8 +153,8 @@ xfs_file_splice_write( | |||
156 | size_t len, | 153 | size_t len, |
157 | unsigned int flags) | 154 | unsigned int flags) |
158 | { | 155 | { |
159 | return bhv_vop_splice_write(vn_from_inode(outfilp->f_path.dentry->d_inode), | 156 | return xfs_splice_write(XFS_I(outfilp->f_path.dentry->d_inode), |
160 | pipe, outfilp, ppos, len, flags, 0, NULL); | 157 | pipe, outfilp, ppos, len, flags, 0); |
161 | } | 158 | } |
162 | 159 | ||
163 | STATIC ssize_t | 160 | STATIC ssize_t |
@@ -168,9 +165,8 @@ xfs_file_splice_write_invis( | |||
168 | size_t len, | 165 | size_t len, |
169 | unsigned int flags) | 166 | unsigned int flags) |
170 | { | 167 | { |
171 | return bhv_vop_splice_write(vn_from_inode(outfilp->f_path.dentry->d_inode), | 168 | return xfs_splice_write(XFS_I(outfilp->f_path.dentry->d_inode), |
172 | pipe, outfilp, ppos, len, flags, IO_INVIS, | 169 | pipe, outfilp, ppos, len, flags, IO_INVIS); |
173 | NULL); | ||
174 | } | 170 | } |
175 | 171 | ||
176 | STATIC int | 172 | STATIC int |
@@ -180,7 +176,7 @@ xfs_file_open( | |||
180 | { | 176 | { |
181 | if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) | 177 | if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) |
182 | return -EFBIG; | 178 | return -EFBIG; |
183 | return -bhv_vop_open(vn_from_inode(inode), NULL); | 179 | return -xfs_open(XFS_I(inode)); |
184 | } | 180 | } |
185 | 181 | ||
186 | STATIC int | 182 | STATIC int |
@@ -188,11 +184,7 @@ xfs_file_release( | |||
188 | struct inode *inode, | 184 | struct inode *inode, |
189 | struct file *filp) | 185 | struct file *filp) |
190 | { | 186 | { |
191 | bhv_vnode_t *vp = vn_from_inode(inode); | 187 | return -xfs_release(XFS_I(inode)); |
192 | |||
193 | if (vp) | ||
194 | return -bhv_vop_release(vp); | ||
195 | return 0; | ||
196 | } | 188 | } |
197 | 189 | ||
198 | STATIC int | 190 | STATIC int |
@@ -208,7 +200,8 @@ xfs_file_fsync( | |||
208 | flags |= FSYNC_DATA; | 200 | flags |= FSYNC_DATA; |
209 | if (VN_TRUNC(vp)) | 201 | if (VN_TRUNC(vp)) |
210 | VUNTRUNCATE(vp); | 202 | VUNTRUNCATE(vp); |
211 | return -bhv_vop_fsync(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1); | 203 | return -xfs_fsync(XFS_I(dentry->d_inode), flags, |
204 | (xfs_off_t)0, (xfs_off_t)-1); | ||
212 | } | 205 | } |
213 | 206 | ||
214 | #ifdef CONFIG_XFS_DMAPI | 207 | #ifdef CONFIG_XFS_DMAPI |
@@ -234,7 +227,7 @@ xfs_file_readdir( | |||
234 | filldir_t filldir) | 227 | filldir_t filldir) |
235 | { | 228 | { |
236 | struct inode *inode = filp->f_path.dentry->d_inode; | 229 | struct inode *inode = filp->f_path.dentry->d_inode; |
237 | bhv_vnode_t *vp = vn_from_inode(inode); | 230 | xfs_inode_t *ip = XFS_I(inode); |
238 | int error; | 231 | int error; |
239 | size_t bufsize; | 232 | size_t bufsize; |
240 | 233 | ||
@@ -252,7 +245,7 @@ xfs_file_readdir( | |||
252 | */ | 245 | */ |
253 | bufsize = (size_t)min_t(loff_t, PAGE_SIZE, inode->i_size); | 246 | bufsize = (size_t)min_t(loff_t, PAGE_SIZE, inode->i_size); |
254 | 247 | ||
255 | error = bhv_vop_readdir(vp, dirent, bufsize, | 248 | error = xfs_readdir(ip, dirent, bufsize, |
256 | (xfs_off_t *)&filp->f_pos, filldir); | 249 | (xfs_off_t *)&filp->f_pos, filldir); |
257 | if (error) | 250 | if (error) |
258 | return -error; | 251 | return -error; |
@@ -286,7 +279,7 @@ xfs_file_ioctl( | |||
286 | struct inode *inode = filp->f_path.dentry->d_inode; | 279 | struct inode *inode = filp->f_path.dentry->d_inode; |
287 | bhv_vnode_t *vp = vn_from_inode(inode); | 280 | bhv_vnode_t *vp = vn_from_inode(inode); |
288 | 281 | ||
289 | error = bhv_vop_ioctl(vp, inode, filp, 0, cmd, (void __user *)p); | 282 | error = xfs_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p); |
290 | VMODIFY(vp); | 283 | VMODIFY(vp); |
291 | 284 | ||
292 | /* NOTE: some of the ioctl's return positive #'s as a | 285 | /* NOTE: some of the ioctl's return positive #'s as a |
@@ -308,7 +301,7 @@ xfs_file_ioctl_invis( | |||
308 | struct inode *inode = filp->f_path.dentry->d_inode; | 301 | struct inode *inode = filp->f_path.dentry->d_inode; |
309 | bhv_vnode_t *vp = vn_from_inode(inode); | 302 | bhv_vnode_t *vp = vn_from_inode(inode); |
310 | 303 | ||
311 | error = bhv_vop_ioctl(vp, inode, filp, IO_INVIS, cmd, (void __user *)p); | 304 | error = xfs_ioctl(XFS_I(inode), filp, IO_INVIS, cmd, (void __user *)p); |
312 | VMODIFY(vp); | 305 | VMODIFY(vp); |
313 | 306 | ||
314 | /* NOTE: some of the ioctl's return positive #'s as a | 307 | /* NOTE: some of the ioctl's return positive #'s as a |