aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-28 20:58:01 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 20:40:00 -0400
commit739bfb2a7dfa369324f74aad1d020d6e0775e4f0 (patch)
tree8fbe3e739e0d550137e3f148a36ce5c083f5ef2c /fs/xfs/linux-2.6
parent993386c19afa53fa54d00c7721e56ba820b3400d (diff)
[XFS] call common xfs vnode-level helpers directly and remove vnode operations
SGI-PV: 969608 SGI-Modid: xfs-linux-melb:xfs-kern:29493a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c25
-rw-r--r--fs/xfs/linux-2.6/xfs_export.c8
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c49
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c40
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl32.c5
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c77
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.h6
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c8
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c44
-rw-r--r--fs/xfs/linux-2.6/xfs_super.h2
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h5
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c8
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h217
14 files changed, 135 insertions, 363 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 5f152f60d74d..28ccca98839b 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.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_iomap.h" 39#include "xfs_iomap.h"
40#include "xfs_vnodeops.h"
40#include <linux/mpage.h> 41#include <linux/mpage.h>
41#include <linux/pagevec.h> 42#include <linux/pagevec.h>
42#include <linux/writeback.h> 43#include <linux/writeback.h>
@@ -232,7 +233,8 @@ xfs_end_bio_unwritten(
232 size_t size = ioend->io_size; 233 size_t size = ioend->io_size;
233 234
234 if (likely(!ioend->io_error)) { 235 if (likely(!ioend->io_error)) {
235 bhv_vop_bmap(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL); 236 xfs_bmap(xfs_vtoi(vp), offset, size,
237 BMAPI_UNWRITTEN, NULL, NULL);
236 xfs_setfilesize(ioend); 238 xfs_setfilesize(ioend);
237 } 239 }
238 xfs_destroy_ioend(ioend); 240 xfs_destroy_ioend(ioend);
@@ -305,7 +307,8 @@ xfs_map_blocks(
305 bhv_vnode_t *vp = vn_from_inode(inode); 307 bhv_vnode_t *vp = vn_from_inode(inode);
306 int error, nmaps = 1; 308 int error, nmaps = 1;
307 309
308 error = bhv_vop_bmap(vp, offset, count, flags, mapp, &nmaps); 310 error = xfs_bmap(xfs_vtoi(vp), offset, count,
311 flags, mapp, &nmaps);
309 if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) 312 if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)))
310 VMODIFY(vp); 313 VMODIFY(vp);
311 return -error; 314 return -error;
@@ -1323,7 +1326,6 @@ __xfs_get_blocks(
1323 int direct, 1326 int direct,
1324 bmapi_flags_t flags) 1327 bmapi_flags_t flags)
1325{ 1328{
1326 bhv_vnode_t *vp = vn_from_inode(inode);
1327 xfs_iomap_t iomap; 1329 xfs_iomap_t iomap;
1328 xfs_off_t offset; 1330 xfs_off_t offset;
1329 ssize_t size; 1331 ssize_t size;
@@ -1333,7 +1335,7 @@ __xfs_get_blocks(
1333 offset = (xfs_off_t)iblock << inode->i_blkbits; 1335 offset = (xfs_off_t)iblock << inode->i_blkbits;
1334 ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); 1336 ASSERT(bh_result->b_size >= (1 << inode->i_blkbits));
1335 size = bh_result->b_size; 1337 size = bh_result->b_size;
1336 error = bhv_vop_bmap(vp, offset, size, 1338 error = xfs_bmap(XFS_I(inode), offset, size,
1337 create ? flags : BMAPI_READ, &iomap, &niomap); 1339 create ? flags : BMAPI_READ, &iomap, &niomap);
1338 if (error) 1340 if (error)
1339 return -error; 1341 return -error;
@@ -1481,13 +1483,13 @@ xfs_vm_direct_IO(
1481{ 1483{
1482 struct file *file = iocb->ki_filp; 1484 struct file *file = iocb->ki_filp;
1483 struct inode *inode = file->f_mapping->host; 1485 struct inode *inode = file->f_mapping->host;
1484 bhv_vnode_t *vp = vn_from_inode(inode);
1485 xfs_iomap_t iomap; 1486 xfs_iomap_t iomap;
1486 int maps = 1; 1487 int maps = 1;
1487 int error; 1488 int error;
1488 ssize_t ret; 1489 ssize_t ret;
1489 1490
1490 error = bhv_vop_bmap(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps); 1491 error = xfs_bmap(XFS_I(inode), offset, 0,
1492 BMAPI_DEVICE, &iomap, &maps);
1491 if (error) 1493 if (error)
1492 return -error; 1494 return -error;
1493 1495
@@ -1528,12 +1530,13 @@ xfs_vm_bmap(
1528 sector_t block) 1530 sector_t block)
1529{ 1531{
1530 struct inode *inode = (struct inode *)mapping->host; 1532 struct inode *inode = (struct inode *)mapping->host;
1531 bhv_vnode_t *vp = vn_from_inode(inode); 1533 struct xfs_inode *ip = XFS_I(inode);
1532 1534
1533 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 1535 vn_trace_entry(vn_from_inode(inode), __FUNCTION__,
1534 bhv_vop_rwlock(vp, VRWLOCK_READ); 1536 (inst_t *)__return_address);
1535 bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF); 1537 xfs_rwlock(ip, VRWLOCK_READ);
1536 bhv_vop_rwunlock(vp, VRWLOCK_READ); 1538 xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF);
1539 xfs_rwunlock(ip, VRWLOCK_READ);
1537 return generic_block_bmap(mapping, block, xfs_get_blocks); 1540 return generic_block_bmap(mapping, block, xfs_get_blocks);
1538} 1541}
1539 1542
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index f6e99fa7a683..0919021d56c4 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -25,6 +25,9 @@
25#include "xfs_dmapi.h" 25#include "xfs_dmapi.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_export.h" 27#include "xfs_export.h"
28#include "xfs_vnodeops.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_inode.h"
28 31
29static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, }; 32static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };
30 33
@@ -161,12 +164,11 @@ xfs_fs_get_parent(
161 struct dentry *child) 164 struct dentry *child)
162{ 165{
163 int error; 166 int error;
164 bhv_vnode_t *vp, *cvp; 167 bhv_vnode_t *cvp;
165 struct dentry *parent; 168 struct dentry *parent;
166 169
167 cvp = NULL; 170 cvp = NULL;
168 vp = vn_from_inode(child->d_inode); 171 error = xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp);
169 error = bhv_vop_lookup(vp, &dotdot, &cvp, 0, NULL, NULL);
170 if (unlikely(error)) 172 if (unlikely(error))
171 return ERR_PTR(-error); 173 return ERR_PTR(-error);
172 174
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
67STATIC ssize_t 67STATIC 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
106STATIC ssize_t 104STATIC 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
138STATIC ssize_t 136STATIC 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
151STATIC ssize_t 148STATIC 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
163STATIC ssize_t 160STATIC 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
176STATIC int 172STATIC 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
186STATIC int 182STATIC 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
198STATIC int 190STATIC 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
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index f36902fa714d..9bba9f8be1eb 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -413,7 +413,7 @@ xfs_readlink_by_handle(
413 if (!link) 413 if (!link)
414 goto out_iput; 414 goto out_iput;
415 415
416 error = -bhv_vop_readlink(vp, link); 416 error = -xfs_readlink(XFS_I(inode), link);
417 if (error) 417 if (error)
418 goto out_kfree; 418 goto out_kfree;
419 error = do_readlink(hreq.ohandle, olen, link); 419 error = do_readlink(hreq.ohandle, olen, link);
@@ -497,8 +497,8 @@ xfs_attrlist_by_handle(
497 goto out_vn_rele; 497 goto out_vn_rele;
498 498
499 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; 499 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
500 error = bhv_vop_attr_list(vp, kbuf, al_hreq.buflen, al_hreq.flags, 500 error = xfs_attr_list(XFS_I(inode), kbuf, al_hreq.buflen,
501 cursor, NULL); 501 al_hreq.flags, cursor);
502 if (error) 502 if (error)
503 goto out_kfree; 503 goto out_kfree;
504 504
@@ -515,7 +515,7 @@ xfs_attrlist_by_handle(
515 515
516STATIC int 516STATIC int
517xfs_attrmulti_attr_get( 517xfs_attrmulti_attr_get(
518 bhv_vnode_t *vp, 518 struct inode *inode,
519 char *name, 519 char *name,
520 char __user *ubuf, 520 char __user *ubuf,
521 __uint32_t *len, 521 __uint32_t *len,
@@ -530,7 +530,7 @@ xfs_attrmulti_attr_get(
530 if (!kbuf) 530 if (!kbuf)
531 return ENOMEM; 531 return ENOMEM;
532 532
533 error = bhv_vop_attr_get(vp, name, kbuf, len, flags, NULL); 533 error = xfs_attr_get(XFS_I(inode), name, kbuf, len, flags, NULL);
534 if (error) 534 if (error)
535 goto out_kfree; 535 goto out_kfree;
536 536
@@ -544,7 +544,7 @@ xfs_attrmulti_attr_get(
544 544
545STATIC int 545STATIC int
546xfs_attrmulti_attr_set( 546xfs_attrmulti_attr_set(
547 bhv_vnode_t *vp, 547 struct inode *inode,
548 char *name, 548 char *name,
549 const char __user *ubuf, 549 const char __user *ubuf,
550 __uint32_t len, 550 __uint32_t len,
@@ -553,9 +553,9 @@ xfs_attrmulti_attr_set(
553 char *kbuf; 553 char *kbuf;
554 int error = EFAULT; 554 int error = EFAULT;
555 555
556 if (IS_RDONLY(&vp->v_inode)) 556 if (IS_RDONLY(inode))
557 return -EROFS; 557 return -EROFS;
558 if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) 558 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
559 return EPERM; 559 return EPERM;
560 if (len > XATTR_SIZE_MAX) 560 if (len > XATTR_SIZE_MAX)
561 return EINVAL; 561 return EINVAL;
@@ -567,7 +567,7 @@ xfs_attrmulti_attr_set(
567 if (copy_from_user(kbuf, ubuf, len)) 567 if (copy_from_user(kbuf, ubuf, len))
568 goto out_kfree; 568 goto out_kfree;
569 569
570 error = bhv_vop_attr_set(vp, name, kbuf, len, flags, NULL); 570 error = xfs_attr_set(XFS_I(inode), name, kbuf, len, flags);
571 571
572 out_kfree: 572 out_kfree:
573 kfree(kbuf); 573 kfree(kbuf);
@@ -576,15 +576,15 @@ xfs_attrmulti_attr_set(
576 576
577STATIC int 577STATIC int
578xfs_attrmulti_attr_remove( 578xfs_attrmulti_attr_remove(
579 bhv_vnode_t *vp, 579 struct inode *inode,
580 char *name, 580 char *name,
581 __uint32_t flags) 581 __uint32_t flags)
582{ 582{
583 if (IS_RDONLY(&vp->v_inode)) 583 if (IS_RDONLY(inode))
584 return -EROFS; 584 return -EROFS;
585 if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) 585 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
586 return EPERM; 586 return EPERM;
587 return bhv_vop_attr_remove(vp, name, flags, NULL); 587 return xfs_attr_remove(XFS_I(inode), name, flags);
588} 588}
589 589
590STATIC int 590STATIC int
@@ -640,17 +640,17 @@ xfs_attrmulti_by_handle(
640 640
641 switch (ops[i].am_opcode) { 641 switch (ops[i].am_opcode) {
642 case ATTR_OP_GET: 642 case ATTR_OP_GET:
643 ops[i].am_error = xfs_attrmulti_attr_get(vp, 643 ops[i].am_error = xfs_attrmulti_attr_get(inode,
644 attr_name, ops[i].am_attrvalue, 644 attr_name, ops[i].am_attrvalue,
645 &ops[i].am_length, ops[i].am_flags); 645 &ops[i].am_length, ops[i].am_flags);
646 break; 646 break;
647 case ATTR_OP_SET: 647 case ATTR_OP_SET:
648 ops[i].am_error = xfs_attrmulti_attr_set(vp, 648 ops[i].am_error = xfs_attrmulti_attr_set(inode,
649 attr_name, ops[i].am_attrvalue, 649 attr_name, ops[i].am_attrvalue,
650 ops[i].am_length, ops[i].am_flags); 650 ops[i].am_length, ops[i].am_flags);
651 break; 651 break;
652 case ATTR_OP_REMOVE: 652 case ATTR_OP_REMOVE:
653 ops[i].am_error = xfs_attrmulti_attr_remove(vp, 653 ops[i].am_error = xfs_attrmulti_attr_remove(inode,
654 attr_name, ops[i].am_flags); 654 attr_name, ops[i].am_flags);
655 break; 655 break;
656 default: 656 default:
@@ -1182,7 +1182,7 @@ xfs_ioc_xattr(
1182 case XFS_IOC_FSGETXATTR: { 1182 case XFS_IOC_FSGETXATTR: {
1183 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ 1183 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
1184 XFS_AT_NEXTENTS | XFS_AT_PROJID; 1184 XFS_AT_NEXTENTS | XFS_AT_PROJID;
1185 error = bhv_vop_getattr(vp, vattr, 0, NULL); 1185 error = xfs_getattr(ip, vattr, 0);
1186 if (unlikely(error)) { 1186 if (unlikely(error)) {
1187 error = -error; 1187 error = -error;
1188 break; 1188 break;
@@ -1215,7 +1215,7 @@ xfs_ioc_xattr(
1215 vattr->va_extsize = fa.fsx_extsize; 1215 vattr->va_extsize = fa.fsx_extsize;
1216 vattr->va_projid = fa.fsx_projid; 1216 vattr->va_projid = fa.fsx_projid;
1217 1217
1218 error = bhv_vop_setattr(vp, vattr, attr_flags, NULL); 1218 error = xfs_setattr(ip, vattr, attr_flags, NULL);
1219 if (likely(!error)) 1219 if (likely(!error))
1220 __vn_revalidate(vp, vattr); /* update flags */ 1220 __vn_revalidate(vp, vattr); /* update flags */
1221 error = -error; 1221 error = -error;
@@ -1225,7 +1225,7 @@ xfs_ioc_xattr(
1225 case XFS_IOC_FSGETXATTRA: { 1225 case XFS_IOC_FSGETXATTRA: {
1226 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ 1226 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
1227 XFS_AT_ANEXTENTS | XFS_AT_PROJID; 1227 XFS_AT_ANEXTENTS | XFS_AT_PROJID;
1228 error = bhv_vop_getattr(vp, vattr, 0, NULL); 1228 error = xfs_getattr(ip, vattr, 0);
1229 if (unlikely(error)) { 1229 if (unlikely(error)) {
1230 error = -error; 1230 error = -error;
1231 break; 1231 break;
@@ -1271,7 +1271,7 @@ xfs_ioc_xattr(
1271 vattr->va_xflags = xfs_merge_ioc_xflags(flags, 1271 vattr->va_xflags = xfs_merge_ioc_xflags(flags,
1272 xfs_ip2xflags(ip)); 1272 xfs_ip2xflags(ip));
1273 1273
1274 error = bhv_vop_setattr(vp, vattr, attr_flags, NULL); 1274 error = xfs_setattr(ip, vattr, attr_flags, NULL);
1275 if (likely(!error)) 1275 if (likely(!error))
1276 __vn_revalidate(vp, vattr); /* update flags */ 1276 __vn_revalidate(vp, vattr); /* update flags */
1277 error = -error; 1277 error = -error;
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c
index 42319d75aaab..83f509960305 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl32.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl32.c
@@ -43,6 +43,7 @@
43#include "xfs_itable.h" 43#include "xfs_itable.h"
44#include "xfs_error.h" 44#include "xfs_error.h"
45#include "xfs_dfrag.h" 45#include "xfs_dfrag.h"
46#include "xfs_vnodeops.h"
46 47
47#define _NATIVE_IOC(cmd, type) \ 48#define _NATIVE_IOC(cmd, type) \
48 _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type)) 49 _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type))
@@ -443,7 +444,7 @@ xfs_compat_ioctl(
443 case XFS_IOC_FSBULKSTAT_SINGLE_32: 444 case XFS_IOC_FSBULKSTAT_SINGLE_32:
444 case XFS_IOC_FSINUMBERS_32: 445 case XFS_IOC_FSINUMBERS_32:
445 cmd = _NATIVE_IOC(cmd, struct xfs_fsop_bulkreq); 446 cmd = _NATIVE_IOC(cmd, struct xfs_fsop_bulkreq);
446 return xfs_ioc_bulkstat_compat(XFS_BHVTOI(VNHEAD(vp))->i_mount, 447 return xfs_ioc_bulkstat_compat(XFS_I(inode)->i_mount,
447 cmd, (void __user*)arg); 448 cmd, (void __user*)arg);
448 case XFS_IOC_FD_TO_HANDLE_32: 449 case XFS_IOC_FD_TO_HANDLE_32:
449 case XFS_IOC_PATH_TO_HANDLE_32: 450 case XFS_IOC_PATH_TO_HANDLE_32:
@@ -457,7 +458,7 @@ xfs_compat_ioctl(
457 return -ENOIOCTLCMD; 458 return -ENOIOCTLCMD;
458 } 459 }
459 460
460 error = bhv_vop_ioctl(vp, inode, file, mode, cmd, (void __user *)arg); 461 error = xfs_ioctl(XFS_I(inode), file, mode, cmd, (void __user *)arg);
461 VMODIFY(vp); 462 VMODIFY(vp);
462 463
463 return error; 464 return error;
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index ef941f99b2bc..4da034f4ae14 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -46,6 +46,7 @@
46#include "xfs_attr.h" 46#include "xfs_attr.h"
47#include "xfs_buf_item.h" 47#include "xfs_buf_item.h"
48#include "xfs_utils.h" 48#include "xfs_utils.h"
49#include "xfs_vnodeops.h"
49 50
50#include <linux/capability.h> 51#include <linux/capability.h>
51#include <linux/xattr.h> 52#include <linux/xattr.h>
@@ -53,22 +54,6 @@
53#include <linux/security.h> 54#include <linux/security.h>
54 55
55/* 56/*
56 * Get a XFS inode from a given vnode.
57 */
58xfs_inode_t *
59xfs_vtoi(
60 bhv_vnode_t *vp)
61{
62 bhv_desc_t *bdp;
63
64 bdp = bhv_lookup_range(VN_BHV_HEAD(vp),
65 VNODE_POSITION_XFS, VNODE_POSITION_XFS);
66 if (unlikely(bdp == NULL))
67 return NULL;
68 return XFS_BHVTOI(bdp);
69}
70
71/*
72 * Bring the atime in the XFS inode uptodate. 57 * Bring the atime in the XFS inode uptodate.
73 * Used before logging the inode to disk or when the Linux inode goes away. 58 * Used before logging the inode to disk or when the Linux inode goes away.
74 */ 59 */
@@ -199,7 +184,7 @@ xfs_validate_fields(
199 bhv_vattr_t *vattr) 184 bhv_vattr_t *vattr)
200{ 185{
201 vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS; 186 vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS;
202 if (!bhv_vop_getattr(vn_from_inode(ip), vattr, ATTR_LAZY, NULL)) { 187 if (!xfs_getattr(XFS_I(ip), vattr, ATTR_LAZY)) {
203 ip->i_nlink = vattr->va_nlink; 188 ip->i_nlink = vattr->va_nlink;
204 ip->i_blocks = vattr->va_nblocks; 189 ip->i_blocks = vattr->va_nblocks;
205 190
@@ -233,7 +218,8 @@ xfs_init_security(
233 return -error; 218 return -error;
234 } 219 }
235 220
236 error = bhv_vop_attr_set(vp, name, value, length, ATTR_SECURE, NULL); 221 error = xfs_attr_set(XFS_I(ip), name, value,
222 length, ATTR_SECURE);
237 if (!error) 223 if (!error)
238 VMODIFY(vp); 224 VMODIFY(vp);
239 225
@@ -256,7 +242,7 @@ xfs_has_fs_struct(struct task_struct *task)
256 242
257STATIC void 243STATIC void
258xfs_cleanup_inode( 244xfs_cleanup_inode(
259 bhv_vnode_t *dvp, 245 struct inode *dir,
260 bhv_vnode_t *vp, 246 bhv_vnode_t *vp,
261 struct dentry *dentry, 247 struct dentry *dentry,
262 int mode) 248 int mode)
@@ -272,9 +258,9 @@ xfs_cleanup_inode(
272 teardown.d_name = dentry->d_name; 258 teardown.d_name = dentry->d_name;
273 259
274 if (S_ISDIR(mode)) 260 if (S_ISDIR(mode))
275 bhv_vop_rmdir(dvp, &teardown, NULL); 261 xfs_rmdir(XFS_I(dir), &teardown);
276 else 262 else
277 bhv_vop_remove(dvp, &teardown, NULL); 263 xfs_remove(XFS_I(dir), &teardown);
278 VN_RELE(vp); 264 VN_RELE(vp);
279} 265}
280 266
@@ -321,10 +307,10 @@ xfs_vn_mknod(
321 vattr.va_mask |= XFS_AT_RDEV; 307 vattr.va_mask |= XFS_AT_RDEV;
322 /*FALLTHROUGH*/ 308 /*FALLTHROUGH*/
323 case S_IFREG: 309 case S_IFREG:
324 error = bhv_vop_create(dvp, dentry, &vattr, &vp, NULL); 310 error = xfs_create(XFS_I(dir), dentry, &vattr, &vp, NULL);
325 break; 311 break;
326 case S_IFDIR: 312 case S_IFDIR:
327 error = bhv_vop_mkdir(dvp, dentry, &vattr, &vp, NULL); 313 error = xfs_mkdir(XFS_I(dir), dentry, &vattr, &vp, NULL);
328 break; 314 break;
329 default: 315 default:
330 error = EINVAL; 316 error = EINVAL;
@@ -334,7 +320,7 @@ xfs_vn_mknod(
334 if (unlikely(!error)) { 320 if (unlikely(!error)) {
335 error = xfs_init_security(vp, dir); 321 error = xfs_init_security(vp, dir);
336 if (error) 322 if (error)
337 xfs_cleanup_inode(dvp, vp, dentry, mode); 323 xfs_cleanup_inode(dir, vp, dentry, mode);
338 } 324 }
339 325
340 if (unlikely(default_acl)) { 326 if (unlikely(default_acl)) {
@@ -343,7 +329,7 @@ xfs_vn_mknod(
343 if (!error) 329 if (!error)
344 VMODIFY(vp); 330 VMODIFY(vp);
345 else 331 else
346 xfs_cleanup_inode(dvp, vp, dentry, mode); 332 xfs_cleanup_inode(dir, vp, dentry, mode);
347 } 333 }
348 _ACL_FREE(default_acl); 334 _ACL_FREE(default_acl);
349 } 335 }
@@ -387,13 +373,13 @@ xfs_vn_lookup(
387 struct dentry *dentry, 373 struct dentry *dentry,
388 struct nameidata *nd) 374 struct nameidata *nd)
389{ 375{
390 bhv_vnode_t *vp = vn_from_inode(dir), *cvp; 376 bhv_vnode_t *cvp;
391 int error; 377 int error;
392 378
393 if (dentry->d_name.len >= MAXNAMELEN) 379 if (dentry->d_name.len >= MAXNAMELEN)
394 return ERR_PTR(-ENAMETOOLONG); 380 return ERR_PTR(-ENAMETOOLONG);
395 381
396 error = bhv_vop_lookup(vp, dentry, &cvp, 0, NULL, NULL); 382 error = xfs_lookup(XFS_I(dir), dentry, &cvp);
397 if (unlikely(error)) { 383 if (unlikely(error)) {
398 if (unlikely(error != ENOENT)) 384 if (unlikely(error != ENOENT))
399 return ERR_PTR(-error); 385 return ERR_PTR(-error);
@@ -411,21 +397,19 @@ xfs_vn_link(
411 struct dentry *dentry) 397 struct dentry *dentry)
412{ 398{
413 struct inode *ip; /* inode of guy being linked to */ 399 struct inode *ip; /* inode of guy being linked to */
414 bhv_vnode_t *tdvp; /* target directory for new name/link */
415 bhv_vnode_t *vp; /* vp of name being linked */ 400 bhv_vnode_t *vp; /* vp of name being linked */
416 bhv_vattr_t vattr; 401 bhv_vattr_t vattr;
417 int error; 402 int error;
418 403
419 ip = old_dentry->d_inode; /* inode being linked to */ 404 ip = old_dentry->d_inode; /* inode being linked to */
420 tdvp = vn_from_inode(dir);
421 vp = vn_from_inode(ip); 405 vp = vn_from_inode(ip);
422 406
423 VN_HOLD(vp); 407 VN_HOLD(vp);
424 error = bhv_vop_link(tdvp, vp, dentry, NULL); 408 error = xfs_link(XFS_I(dir), vp, dentry);
425 if (unlikely(error)) { 409 if (unlikely(error)) {
426 VN_RELE(vp); 410 VN_RELE(vp);
427 } else { 411 } else {
428 VMODIFY(tdvp); 412 VMODIFY(vn_from_inode(dir));
429 xfs_validate_fields(ip, &vattr); 413 xfs_validate_fields(ip, &vattr);
430 d_instantiate(dentry, ip); 414 d_instantiate(dentry, ip);
431 } 415 }
@@ -438,14 +422,12 @@ xfs_vn_unlink(
438 struct dentry *dentry) 422 struct dentry *dentry)
439{ 423{
440 struct inode *inode; 424 struct inode *inode;
441 bhv_vnode_t *dvp; /* directory containing name to remove */
442 bhv_vattr_t vattr; 425 bhv_vattr_t vattr;
443 int error; 426 int error;
444 427
445 inode = dentry->d_inode; 428 inode = dentry->d_inode;
446 dvp = vn_from_inode(dir);
447 429
448 error = bhv_vop_remove(dvp, dentry, NULL); 430 error = xfs_remove(XFS_I(dir), dentry);
449 if (likely(!error)) { 431 if (likely(!error)) {
450 xfs_validate_fields(dir, &vattr); /* size needs update */ 432 xfs_validate_fields(dir, &vattr); /* size needs update */
451 xfs_validate_fields(inode, &vattr); 433 xfs_validate_fields(inode, &vattr);
@@ -461,18 +443,17 @@ xfs_vn_symlink(
461{ 443{
462 struct inode *ip; 444 struct inode *ip;
463 bhv_vattr_t va = { 0 }; 445 bhv_vattr_t va = { 0 };
464 bhv_vnode_t *dvp; /* directory containing name of symlink */
465 bhv_vnode_t *cvp; /* used to lookup symlink to put in dentry */ 446 bhv_vnode_t *cvp; /* used to lookup symlink to put in dentry */
466 int error; 447 int error;
467 448
468 dvp = vn_from_inode(dir);
469 cvp = NULL; 449 cvp = NULL;
470 450
471 va.va_mode = S_IFLNK | 451 va.va_mode = S_IFLNK |
472 (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO); 452 (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO);
473 va.va_mask = XFS_AT_TYPE|XFS_AT_MODE; 453 va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
474 454
475 error = bhv_vop_symlink(dvp, dentry, &va, (char *)symname, &cvp, NULL); 455 error = xfs_symlink(XFS_I(dir), dentry, &va,
456 (char *)symname, &cvp, NULL);
476 if (likely(!error && cvp)) { 457 if (likely(!error && cvp)) {
477 error = xfs_init_security(cvp, dir); 458 error = xfs_init_security(cvp, dir);
478 if (likely(!error)) { 459 if (likely(!error)) {
@@ -481,7 +462,7 @@ xfs_vn_symlink(
481 xfs_validate_fields(dir, &va); 462 xfs_validate_fields(dir, &va);
482 xfs_validate_fields(ip, &va); 463 xfs_validate_fields(ip, &va);
483 } else { 464 } else {
484 xfs_cleanup_inode(dvp, cvp, dentry, 0); 465 xfs_cleanup_inode(dir, cvp, dentry, 0);
485 } 466 }
486 } 467 }
487 return -error; 468 return -error;
@@ -493,11 +474,10 @@ xfs_vn_rmdir(
493 struct dentry *dentry) 474 struct dentry *dentry)
494{ 475{
495 struct inode *inode = dentry->d_inode; 476 struct inode *inode = dentry->d_inode;
496 bhv_vnode_t *dvp = vn_from_inode(dir);
497 bhv_vattr_t vattr; 477 bhv_vattr_t vattr;
498 int error; 478 int error;
499 479
500 error = bhv_vop_rmdir(dvp, dentry, NULL); 480 error = xfs_rmdir(XFS_I(dir), dentry);
501 if (likely(!error)) { 481 if (likely(!error)) {
502 xfs_validate_fields(inode, &vattr); 482 xfs_validate_fields(inode, &vattr);
503 xfs_validate_fields(dir, &vattr); 483 xfs_validate_fields(dir, &vattr);
@@ -513,15 +493,13 @@ xfs_vn_rename(
513 struct dentry *ndentry) 493 struct dentry *ndentry)
514{ 494{
515 struct inode *new_inode = ndentry->d_inode; 495 struct inode *new_inode = ndentry->d_inode;
516 bhv_vnode_t *fvp; /* from directory */
517 bhv_vnode_t *tvp; /* target directory */ 496 bhv_vnode_t *tvp; /* target directory */
518 bhv_vattr_t vattr; 497 bhv_vattr_t vattr;
519 int error; 498 int error;
520 499
521 fvp = vn_from_inode(odir);
522 tvp = vn_from_inode(ndir); 500 tvp = vn_from_inode(ndir);
523 501
524 error = bhv_vop_rename(fvp, odentry, tvp, ndentry, NULL); 502 error = xfs_rename(XFS_I(odir), odentry, tvp, ndentry);
525 if (likely(!error)) { 503 if (likely(!error)) {
526 if (new_inode) 504 if (new_inode)
527 xfs_validate_fields(new_inode, &vattr); 505 xfs_validate_fields(new_inode, &vattr);
@@ -542,7 +520,6 @@ xfs_vn_follow_link(
542 struct dentry *dentry, 520 struct dentry *dentry,
543 struct nameidata *nd) 521 struct nameidata *nd)
544{ 522{
545 bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
546 char *link; 523 char *link;
547 int error = -ENOMEM; 524 int error = -ENOMEM;
548 525
@@ -550,7 +527,7 @@ xfs_vn_follow_link(
550 if (!link) 527 if (!link)
551 goto out_err; 528 goto out_err;
552 529
553 error = -bhv_vop_readlink(vp, link); 530 error = -xfs_readlink(XFS_I(dentry->d_inode), link);
554 if (unlikely(error)) 531 if (unlikely(error))
555 goto out_kfree; 532 goto out_kfree;
556 533
@@ -583,7 +560,7 @@ xfs_vn_permission(
583 int mode, 560 int mode,
584 struct nameidata *nd) 561 struct nameidata *nd)
585{ 562{
586 return -bhv_vop_access(vn_from_inode(inode), mode << 6, NULL); 563 return -xfs_access(XFS_I(inode), mode << 6, NULL);
587} 564}
588#else 565#else
589#define xfs_vn_permission NULL 566#define xfs_vn_permission NULL
@@ -596,11 +573,10 @@ xfs_vn_getattr(
596 struct kstat *stat) 573 struct kstat *stat)
597{ 574{
598 struct inode *inode = dentry->d_inode; 575 struct inode *inode = dentry->d_inode;
599 bhv_vnode_t *vp = vn_from_inode(inode);
600 bhv_vattr_t vattr = { .va_mask = XFS_AT_STAT }; 576 bhv_vattr_t vattr = { .va_mask = XFS_AT_STAT };
601 int error; 577 int error;
602 578
603 error = bhv_vop_getattr(vp, &vattr, ATTR_LAZY, NULL); 579 error = xfs_getattr(XFS_I(inode), &vattr, ATTR_LAZY);
604 if (likely(!error)) { 580 if (likely(!error)) {
605 stat->size = i_size_read(inode); 581 stat->size = i_size_read(inode);
606 stat->dev = inode->i_sb->s_dev; 582 stat->dev = inode->i_sb->s_dev;
@@ -628,7 +604,6 @@ xfs_vn_setattr(
628{ 604{
629 struct inode *inode = dentry->d_inode; 605 struct inode *inode = dentry->d_inode;
630 unsigned int ia_valid = attr->ia_valid; 606 unsigned int ia_valid = attr->ia_valid;
631 bhv_vnode_t *vp = vn_from_inode(inode);
632 bhv_vattr_t vattr = { 0 }; 607 bhv_vattr_t vattr = { 0 };
633 int flags = 0; 608 int flags = 0;
634 int error; 609 int error;
@@ -672,9 +647,9 @@ xfs_vn_setattr(
672 flags |= ATTR_NONBLOCK; 647 flags |= ATTR_NONBLOCK;
673#endif 648#endif
674 649
675 error = bhv_vop_setattr(vp, &vattr, flags, NULL); 650 error = xfs_setattr(XFS_I(inode), &vattr, flags, NULL);
676 if (likely(!error)) 651 if (likely(!error))
677 __vn_revalidate(vp, &vattr); 652 __vn_revalidate(vn_from_inode(inode), &vattr);
678 return -error; 653 return -error;
679} 654}
680 655
diff --git a/fs/xfs/linux-2.6/xfs_iops.h b/fs/xfs/linux-2.6/xfs_iops.h
index ce9852e9be00..14d0deb7afff 100644
--- a/fs/xfs/linux-2.6/xfs_iops.h
+++ b/fs/xfs/linux-2.6/xfs_iops.h
@@ -31,4 +31,10 @@ struct xfs_inode;
31extern void xfs_ichgtime(struct xfs_inode *, int); 31extern void xfs_ichgtime(struct xfs_inode *, int);
32extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); 32extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int);
33 33
34#define xfs_vtoi(vp) \
35 ((struct xfs_inode *)vn_to_inode(vp)->i_private)
36
37#define XFS_I(inode) \
38 ((struct xfs_inode *)(inode)->i_private)
39
34#endif /* __XFS_IOPS_H__ */ 40#endif /* __XFS_IOPS_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 2dc979e3e969..fb04b11bb815 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -257,8 +257,9 @@ xfs_read(
257 257
258 if (unlikely(ioflags & IO_ISDIRECT)) { 258 if (unlikely(ioflags & IO_ISDIRECT)) {
259 if (VN_CACHED(vp)) 259 if (VN_CACHED(vp))
260 ret = bhv_vop_flushinval_pages(vp, ctooff(offtoct(*offset)), 260 ret = xfs_flushinval_pages(ip,
261 -1, FI_REMAPF_LOCKED); 261 ctooff(offtoct(*offset)),
262 -1, FI_REMAPF_LOCKED);
262 mutex_unlock(&inode->i_mutex); 263 mutex_unlock(&inode->i_mutex);
263 if (ret) { 264 if (ret) {
264 xfs_iunlock(ip, XFS_IOLOCK_SHARED); 265 xfs_iunlock(ip, XFS_IOLOCK_SHARED);
@@ -752,7 +753,8 @@ retry:
752 WARN_ON(need_i_mutex == 0); 753 WARN_ON(need_i_mutex == 0);
753 xfs_inval_cached_trace(io, pos, -1, 754 xfs_inval_cached_trace(io, pos, -1,
754 ctooff(offtoct(pos)), -1); 755 ctooff(offtoct(pos)), -1);
755 error = bhv_vop_flushinval_pages(vp, ctooff(offtoct(pos)), 756 error = xfs_flushinval_pages(xip,
757 ctooff(offtoct(pos)),
756 -1, FI_REMAPF_LOCKED); 758 -1, FI_REMAPF_LOCKED);
757 if (error) 759 if (error)
758 goto out_unlock_internal; 760 goto out_unlock_internal;
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 2fbf24a6cf58..42d6ed1788ff 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -46,6 +46,7 @@
46#include "xfs_attr.h" 46#include "xfs_attr.h"
47#include "xfs_buf_item.h" 47#include "xfs_buf_item.h"
48#include "xfs_utils.h" 48#include "xfs_utils.h"
49#include "xfs_vnodeops.h"
49#include "xfs_version.h" 50#include "xfs_version.h"
50 51
51#include <linux/namei.h> 52#include <linux/namei.h>
@@ -203,16 +204,15 @@ void
203xfs_initialize_vnode( 204xfs_initialize_vnode(
204 bhv_desc_t *bdp, 205 bhv_desc_t *bdp,
205 bhv_vnode_t *vp, 206 bhv_vnode_t *vp,
206 bhv_desc_t *inode_bhv, 207 struct xfs_inode *ip,
207 int unlock) 208 int unlock)
208{ 209{
209 xfs_inode_t *ip = XFS_BHVTOI(inode_bhv);
210 struct inode *inode = vn_to_inode(vp); 210 struct inode *inode = vn_to_inode(vp);
211 211
212 if (!inode_bhv->bd_vobj) { 212 if (!ip->i_vnode) {
213 vp->v_vfsp = bhvtovfs(bdp); 213 vp->v_vfsp = bhvtovfs(bdp);
214 bhv_desc_init(inode_bhv, ip, vp, &xfs_vnodeops); 214 ip->i_vnode = vp;
215 bhv_insert(VN_BHV_HEAD(vp), inode_bhv); 215 inode->i_private = ip;
216 } 216 }
217 217
218 /* 218 /*
@@ -402,19 +402,23 @@ xfs_fs_write_inode(
402 struct inode *inode, 402 struct inode *inode,
403 int sync) 403 int sync)
404{ 404{
405 bhv_vnode_t *vp = vn_from_inode(inode);
406 int error = 0, flags = FLUSH_INODE; 405 int error = 0, flags = FLUSH_INODE;
407 406
408 if (vp) { 407 vn_trace_entry(vn_from_inode(inode), __FUNCTION__,
409 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 408 (inst_t *)__return_address);
410 if (sync) { 409 if (sync) {
411 filemap_fdatawait(inode->i_mapping); 410 filemap_fdatawait(inode->i_mapping);
412 flags |= FLUSH_SYNC; 411 flags |= FLUSH_SYNC;
413 }
414 error = bhv_vop_iflush(vp, flags);
415 if (error == EAGAIN)
416 error = sync? bhv_vop_iflush(vp, flags | FLUSH_LOG) : 0;
417 } 412 }
413 error = xfs_inode_flush(XFS_I(inode), flags);
414 if (error == EAGAIN) {
415 if (sync)
416 error = xfs_inode_flush(XFS_I(inode),
417 flags | FLUSH_LOG);
418 else
419 error = 0;
420 }
421
418 return -error; 422 return -error;
419} 423}
420 424
@@ -435,18 +439,18 @@ xfs_fs_clear_inode(
435 * This can happen because xfs_iget_core calls xfs_idestroy if we 439 * This can happen because xfs_iget_core calls xfs_idestroy if we
436 * find an inode with di_mode == 0 but without IGET_CREATE set. 440 * find an inode with di_mode == 0 but without IGET_CREATE set.
437 */ 441 */
438 if (VNHEAD(vp)) 442 if (XFS_I(inode))
439 bhv_vop_inactive(vp, NULL); 443 xfs_inactive(XFS_I(inode));
440 444
441 VN_LOCK(vp); 445 VN_LOCK(vp);
442 vp->v_flag &= ~VMODIFIED; 446 vp->v_flag &= ~VMODIFIED;
443 VN_UNLOCK(vp, 0); 447 VN_UNLOCK(vp, 0);
444 448
445 if (VNHEAD(vp)) 449 if (XFS_I(inode))
446 if (bhv_vop_reclaim(vp)) 450 if (xfs_reclaim(XFS_I(inode)))
447 panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp); 451 panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp);
448 452
449 ASSERT(VNHEAD(vp) == NULL); 453 ASSERT(XFS_I(inode) == NULL);
450 454
451#ifdef XFS_VNODE_TRACE 455#ifdef XFS_VNODE_TRACE
452 ktrace_free(vp->v_trace); 456 ktrace_free(vp->v_trace);
diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h
index 201cc3273c84..ea2ee5a92637 100644
--- a/fs/xfs/linux-2.6/xfs_super.h
+++ b/fs/xfs/linux-2.6/xfs_super.h
@@ -107,7 +107,7 @@ struct block_device;
107 107
108extern __uint64_t xfs_max_file_offset(unsigned int); 108extern __uint64_t xfs_max_file_offset(unsigned int);
109 109
110extern void xfs_initialize_vnode(bhv_desc_t *, bhv_vnode_t *, bhv_desc_t *, int); 110extern void xfs_initialize_vnode(bhv_desc_t *, bhv_vnode_t *, struct xfs_inode *, int);
111 111
112extern void xfs_flush_inode(struct xfs_inode *); 112extern void xfs_flush_inode(struct xfs_inode *);
113extern void xfs_flush_device(struct xfs_inode *); 113extern void xfs_flush_device(struct xfs_inode *);
diff --git a/fs/xfs/linux-2.6/xfs_vfs.c b/fs/xfs/linux-2.6/xfs_vfs.c
index 6145e8bd0be2..0dc87cd20229 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.c
+++ b/fs/xfs/linux-2.6/xfs_vfs.c
@@ -187,7 +187,7 @@ void
187vfs_init_vnode( 187vfs_init_vnode(
188 struct bhv_desc *bdp, 188 struct bhv_desc *bdp,
189 struct bhv_vnode *vp, 189 struct bhv_vnode *vp,
190 struct bhv_desc *bp, 190 struct xfs_inode *ip,
191 int unlock) 191 int unlock)
192{ 192{
193 struct bhv_desc *next = bdp; 193 struct bhv_desc *next = bdp;
@@ -195,7 +195,7 @@ vfs_init_vnode(
195 ASSERT(next); 195 ASSERT(next);
196 while (! (bhvtovfsops(next))->vfs_init_vnode) 196 while (! (bhvtovfsops(next))->vfs_init_vnode)
197 next = BHV_NEXT(next); 197 next = BHV_NEXT(next);
198 ((*bhvtovfsops(next)->vfs_init_vnode)(next, vp, bp, unlock)); 198 ((*bhvtovfsops(next)->vfs_init_vnode)(next, vp, ip, unlock));
199} 199}
200 200
201void 201void
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index dca3481aaafa..75994e1318bc 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -28,6 +28,7 @@ struct fid;
28struct cred; 28struct cred;
29struct seq_file; 29struct seq_file;
30struct super_block; 30struct super_block;
31struct xfs_inode;
31struct xfs_mount_args; 32struct xfs_mount_args;
32 33
33typedef struct kstatfs bhv_statvfs_t; 34typedef struct kstatfs bhv_statvfs_t;
@@ -131,7 +132,7 @@ typedef int (*vfs_vget_t)(bhv_desc_t *, struct bhv_vnode **, struct fid *);
131typedef int (*vfs_dmapiops_t)(bhv_desc_t *, caddr_t); 132typedef int (*vfs_dmapiops_t)(bhv_desc_t *, caddr_t);
132typedef int (*vfs_quotactl_t)(bhv_desc_t *, int, int, caddr_t); 133typedef int (*vfs_quotactl_t)(bhv_desc_t *, int, int, caddr_t);
133typedef void (*vfs_init_vnode_t)(bhv_desc_t *, 134typedef void (*vfs_init_vnode_t)(bhv_desc_t *,
134 struct bhv_vnode *, bhv_desc_t *, int); 135 struct bhv_vnode *, struct xfs_inode *, int);
135typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int); 136typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int);
136typedef void (*vfs_freeze_t)(bhv_desc_t *); 137typedef void (*vfs_freeze_t)(bhv_desc_t *);
137 138
@@ -201,7 +202,7 @@ extern int vfs_sync(bhv_desc_t *, int, struct cred *);
201extern int vfs_vget(bhv_desc_t *, struct bhv_vnode **, struct fid *); 202extern int vfs_vget(bhv_desc_t *, struct bhv_vnode **, struct fid *);
202extern int vfs_dmapiops(bhv_desc_t *, caddr_t); 203extern int vfs_dmapiops(bhv_desc_t *, caddr_t);
203extern int vfs_quotactl(bhv_desc_t *, int, int, caddr_t); 204extern int vfs_quotactl(bhv_desc_t *, int, int, caddr_t);
204extern void vfs_init_vnode(bhv_desc_t *, struct bhv_vnode *, bhv_desc_t *, int); 205extern void vfs_init_vnode(bhv_desc_t *, struct bhv_vnode *, struct xfs_inode *, int);
205extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); 206extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int);
206extern void vfs_freeze(bhv_desc_t *); 207extern void vfs_freeze(bhv_desc_t *);
207 208
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index ada24baf88de..ad0494c5c0d1 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -16,6 +16,9 @@
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_vnodeops.h"
20#include "xfs_bmap_btree.h"
21#include "xfs_inode.h"
19 22
20uint64_t vn_generation; /* vnode generation number */ 23uint64_t vn_generation; /* vnode generation number */
21DEFINE_SPINLOCK(vnumber_lock); 24DEFINE_SPINLOCK(vnumber_lock);
@@ -90,9 +93,6 @@ vn_initialize(
90 93
91 ASSERT(VN_CACHED(vp) == 0); 94 ASSERT(VN_CACHED(vp) == 0);
92 95
93 /* Initialize the first behavior and the behavior chain head. */
94 vn_bhv_head_init(VN_BHV_HEAD(vp), "vnode");
95
96 atomic_set(&vp->v_iocount, 0); 96 atomic_set(&vp->v_iocount, 0);
97 97
98#ifdef XFS_VNODE_TRACE 98#ifdef XFS_VNODE_TRACE
@@ -152,7 +152,7 @@ __vn_revalidate(
152 152
153 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 153 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
154 vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS; 154 vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS;
155 error = bhv_vop_getattr(vp, vattr, 0, NULL); 155 error = xfs_getattr(xfs_vtoi(vp), vattr, 0);
156 if (likely(!error)) { 156 if (likely(!error)) {
157 vn_revalidate_core(vp, vattr); 157 vn_revalidate_core(vp, vattr);
158 VUNMODIFY(vp); 158 VUNMODIFY(vp);
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index bddbdb904234..5abcbd198d73 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -41,7 +41,6 @@ typedef struct bhv_vnode {
41 bhv_vflags_t v_flag; /* vnode flags (see above) */ 41 bhv_vflags_t v_flag; /* vnode flags (see above) */
42 bhv_vfs_t *v_vfsp; /* ptr to containing VFS */ 42 bhv_vfs_t *v_vfsp; /* ptr to containing VFS */
43 bhv_vnumber_t v_number; /* in-core vnode number */ 43 bhv_vnumber_t v_number; /* in-core vnode number */
44 bhv_head_t v_bh; /* behavior head */
45 spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ 44 spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */
46 atomic_t v_iocount; /* outstanding I/O count */ 45 atomic_t v_iocount; /* outstanding I/O count */
47#ifdef XFS_VNODE_TRACE 46#ifdef XFS_VNODE_TRACE
@@ -57,34 +56,6 @@ typedef struct bhv_vnode {
57#define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode) 56#define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode)
58#define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode) 57#define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode)
59 58
60#define VNODE_POSITION_BASE BHV_POSITION_BASE /* chain bottom */
61#define VNODE_POSITION_TOP BHV_POSITION_TOP /* chain top */
62#define VNODE_POSITION_INVALID BHV_POSITION_INVALID /* invalid pos. num */
63
64typedef enum {
65 VN_BHV_UNKNOWN, /* not specified */
66 VN_BHV_XFS, /* xfs */
67 VN_BHV_DM, /* data migration */
68 VN_BHV_QM, /* quota manager */
69 VN_BHV_IO, /* IO path */
70 VN_BHV_END /* housekeeping end-of-range */
71} vn_bhv_t;
72
73#define VNODE_POSITION_XFS (VNODE_POSITION_BASE)
74#define VNODE_POSITION_DM (VNODE_POSITION_BASE+10)
75#define VNODE_POSITION_QM (VNODE_POSITION_BASE+20)
76#define VNODE_POSITION_IO (VNODE_POSITION_BASE+30)
77
78/*
79 * Macros for dealing with the behavior descriptor inside of the vnode.
80 */
81#define BHV_TO_VNODE(bdp) ((bhv_vnode_t *)BHV_VOBJ(bdp))
82#define BHV_TO_VNODE_NULL(bdp) ((bhv_vnode_t *)BHV_VOBJNULL(bdp))
83
84#define VN_BHV_HEAD(vp) ((bhv_head_t *)(&((vp)->v_bh)))
85#define vn_bhv_head_init(bhp,name) bhv_head_init(bhp,name)
86#define vn_bhv_remove(bhp,bdp) bhv_remove(bhp,bdp)
87
88/* 59/*
89 * Vnode to Linux inode mapping. 60 * Vnode to Linux inode mapping.
90 */ 61 */
@@ -110,7 +81,7 @@ typedef enum bhv_vrwlock {
110} bhv_vrwlock_t; 81} bhv_vrwlock_t;
111 82
112/* 83/*
113 * Return values for bhv_vop_inactive. A return value of 84 * Return values for xfs_inactive. A return value of
114 * VN_INACTIVE_NOCACHE implies that the file system behavior 85 * VN_INACTIVE_NOCACHE implies that the file system behavior
115 * has disassociated its state and bhv_desc_t from the vnode. 86 * has disassociated its state and bhv_desc_t from the vnode.
116 */ 87 */
@@ -118,192 +89,6 @@ typedef enum bhv_vrwlock {
118#define VN_INACTIVE_NOCACHE 1 89#define VN_INACTIVE_NOCACHE 1
119 90
120/* 91/*
121 * Values for the cmd code given to vop_vnode_change.
122 */
123typedef enum bhv_vchange {
124 VCHANGE_FLAGS_FRLOCKS = 0,
125 VCHANGE_FLAGS_ENF_LOCKING = 1,
126 VCHANGE_FLAGS_TRUNCATED = 2,
127 VCHANGE_FLAGS_PAGE_DIRTY = 3,
128 VCHANGE_FLAGS_IOEXCL_COUNT = 4
129} bhv_vchange_t;
130
131typedef int (*vop_open_t)(bhv_desc_t *, struct cred *);
132typedef ssize_t (*vop_read_t)(bhv_desc_t *, struct kiocb *,
133 const struct iovec *, unsigned int,
134 loff_t *, int, struct cred *);
135typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct kiocb *,
136 const struct iovec *, unsigned int,
137 loff_t *, int, struct cred *);
138typedef ssize_t (*vop_splice_read_t)(bhv_desc_t *, struct file *, loff_t *,
139 struct pipe_inode_info *, size_t, int, int,
140 struct cred *);
141typedef ssize_t (*vop_splice_write_t)(bhv_desc_t *, struct pipe_inode_info *,
142 struct file *, loff_t *, size_t, int, int,
143 struct cred *);
144typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *,
145 int, unsigned int, void __user *);
146typedef int (*vop_getattr_t)(bhv_desc_t *, struct bhv_vattr *, int,
147 struct cred *);
148typedef int (*vop_setattr_t)(bhv_desc_t *, struct bhv_vattr *, int,
149 struct cred *);
150typedef int (*vop_access_t)(bhv_desc_t *, int, struct cred *);
151typedef int (*vop_lookup_t)(bhv_desc_t *, bhv_vname_t *, bhv_vnode_t **,
152 int, bhv_vnode_t *, struct cred *);
153typedef int (*vop_create_t)(bhv_desc_t *, bhv_vname_t *, struct bhv_vattr *,
154 bhv_vnode_t **, struct cred *);
155typedef int (*vop_remove_t)(bhv_desc_t *, bhv_vname_t *, struct cred *);
156typedef int (*vop_link_t)(bhv_desc_t *, bhv_vnode_t *, bhv_vname_t *,
157 struct cred *);
158typedef int (*vop_rename_t)(bhv_desc_t *, bhv_vname_t *, bhv_vnode_t *,
159 bhv_vname_t *, struct cred *);
160typedef int (*vop_mkdir_t)(bhv_desc_t *, bhv_vname_t *, struct bhv_vattr *,
161 bhv_vnode_t **, struct cred *);
162typedef int (*vop_rmdir_t)(bhv_desc_t *, bhv_vname_t *, struct cred *);
163typedef int (*vop_readdir_t)(bhv_desc_t *, void *dirent, size_t bufsize,
164 xfs_off_t *offset, filldir_t filldir);
165typedef int (*vop_symlink_t)(bhv_desc_t *, bhv_vname_t *, struct bhv_vattr*,
166 char *, bhv_vnode_t **, struct cred *);
167typedef int (*vop_readlink_t)(bhv_desc_t *, char *);
168typedef int (*vop_fsync_t)(bhv_desc_t *, int, struct cred *,
169 xfs_off_t, xfs_off_t);
170typedef int (*vop_inactive_t)(bhv_desc_t *, struct cred *);
171typedef int (*vop_fid2_t)(bhv_desc_t *, struct fid *);
172typedef int (*vop_release_t)(bhv_desc_t *);
173typedef int (*vop_rwlock_t)(bhv_desc_t *, bhv_vrwlock_t);
174typedef void (*vop_rwunlock_t)(bhv_desc_t *, bhv_vrwlock_t);
175typedef int (*vop_bmap_t)(bhv_desc_t *, xfs_off_t, ssize_t, int,
176 struct xfs_iomap *, int *);
177typedef int (*vop_reclaim_t)(bhv_desc_t *);
178typedef int (*vop_attr_get_t)(bhv_desc_t *, const char *, char *, int *,
179 int, struct cred *);
180typedef int (*vop_attr_set_t)(bhv_desc_t *, const char *, char *, int,
181 int, struct cred *);
182typedef int (*vop_attr_remove_t)(bhv_desc_t *, const char *,
183 int, struct cred *);
184typedef int (*vop_attr_list_t)(bhv_desc_t *, char *, int, int,
185 struct attrlist_cursor_kern *, struct cred *);
186typedef void (*vop_link_removed_t)(bhv_desc_t *, bhv_vnode_t *, int);
187typedef void (*vop_vnode_change_t)(bhv_desc_t *, bhv_vchange_t, __psint_t);
188typedef void (*vop_ptossvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int);
189typedef int (*vop_pflushinvalvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int);
190typedef int (*vop_pflushvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t,
191 uint64_t, int);
192typedef int (*vop_iflush_t)(bhv_desc_t *, int);
193
194
195typedef struct bhv_vnodeops {
196 bhv_position_t vn_position; /* position within behavior chain */
197 vop_open_t vop_open;
198 vop_read_t vop_read;
199 vop_write_t vop_write;
200 vop_splice_read_t vop_splice_read;
201 vop_splice_write_t vop_splice_write;
202 vop_ioctl_t vop_ioctl;
203 vop_getattr_t vop_getattr;
204 vop_setattr_t vop_setattr;
205 vop_access_t vop_access;
206 vop_lookup_t vop_lookup;
207 vop_create_t vop_create;
208 vop_remove_t vop_remove;
209 vop_link_t vop_link;
210 vop_rename_t vop_rename;
211 vop_mkdir_t vop_mkdir;
212 vop_rmdir_t vop_rmdir;
213 vop_readdir_t vop_readdir;
214 vop_symlink_t vop_symlink;
215 vop_readlink_t vop_readlink;
216 vop_fsync_t vop_fsync;
217 vop_inactive_t vop_inactive;
218 vop_fid2_t vop_fid2;
219 vop_rwlock_t vop_rwlock;
220 vop_rwunlock_t vop_rwunlock;
221 vop_bmap_t vop_bmap;
222 vop_reclaim_t vop_reclaim;
223 vop_attr_get_t vop_attr_get;
224 vop_attr_set_t vop_attr_set;
225 vop_attr_remove_t vop_attr_remove;
226 vop_attr_list_t vop_attr_list;
227 vop_link_removed_t vop_link_removed;
228 vop_vnode_change_t vop_vnode_change;
229 vop_ptossvp_t vop_tosspages;
230 vop_pflushinvalvp_t vop_flushinval_pages;
231 vop_pflushvp_t vop_flush_pages;
232 vop_release_t vop_release;
233 vop_iflush_t vop_iflush;
234} bhv_vnodeops_t;
235
236/*
237 * Virtual node operations, operating from head bhv.
238 */
239#define VNHEAD(vp) ((vp)->v_bh.bh_first)
240#define VOP(op, vp) (*((bhv_vnodeops_t *)VNHEAD(vp)->bd_ops)->op)
241#define bhv_vop_open(vp, cr) VOP(vop_open, vp)(VNHEAD(vp),cr)
242#define bhv_vop_read(vp,file,iov,segs,offset,ioflags,cr) \
243 VOP(vop_read, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr)
244#define bhv_vop_write(vp,file,iov,segs,offset,ioflags,cr) \
245 VOP(vop_write, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr)
246#define bhv_vop_splice_read(vp,f,o,pipe,cnt,fl,iofl,cr) \
247 VOP(vop_splice_read, vp)(VNHEAD(vp),f,o,pipe,cnt,fl,iofl,cr)
248#define bhv_vop_splice_write(vp,f,o,pipe,cnt,fl,iofl,cr) \
249 VOP(vop_splice_write, vp)(VNHEAD(vp),f,o,pipe,cnt,fl,iofl,cr)
250#define bhv_vop_bmap(vp,of,sz,rw,b,n) \
251 VOP(vop_bmap, vp)(VNHEAD(vp),of,sz,rw,b,n)
252#define bhv_vop_getattr(vp, vap,f,cr) \
253 VOP(vop_getattr, vp)(VNHEAD(vp), vap,f,cr)
254#define bhv_vop_setattr(vp, vap,f,cr) \
255 VOP(vop_setattr, vp)(VNHEAD(vp), vap,f,cr)
256#define bhv_vop_access(vp, mode,cr) VOP(vop_access, vp)(VNHEAD(vp), mode,cr)
257#define bhv_vop_lookup(vp,d,vpp,f,rdir,cr) \
258 VOP(vop_lookup, vp)(VNHEAD(vp),d,vpp,f,rdir,cr)
259#define bhv_vop_create(dvp,d,vap,vpp,cr) \
260 VOP(vop_create, dvp)(VNHEAD(dvp),d,vap,vpp,cr)
261#define bhv_vop_remove(dvp,d,cr) VOP(vop_remove, dvp)(VNHEAD(dvp),d,cr)
262#define bhv_vop_link(dvp,fvp,d,cr) VOP(vop_link, dvp)(VNHEAD(dvp),fvp,d,cr)
263#define bhv_vop_rename(fvp,fnm,tdvp,tnm,cr) \
264 VOP(vop_rename, fvp)(VNHEAD(fvp),fnm,tdvp,tnm,cr)
265#define bhv_vop_mkdir(dp,d,vap,vpp,cr) \
266 VOP(vop_mkdir, dp)(VNHEAD(dp),d,vap,vpp,cr)
267#define bhv_vop_rmdir(dp,d,cr) VOP(vop_rmdir, dp)(VNHEAD(dp),d,cr)
268#define bhv_vop_readdir(vp,dirent,bufsize,offset,filldir) \
269 VOP(vop_readdir, vp)(VNHEAD(vp),dirent,bufsize,offset,filldir)
270#define bhv_vop_symlink(dvp,d,vap,tnm,vpp,cr) \
271 VOP(vop_symlink, dvp)(VNHEAD(dvp),d,vap,tnm,vpp,cr)
272#define bhv_vop_readlink(vp,link) \
273 VOP(vop_readlink, vp)(VNHEAD(vp), link)
274#define bhv_vop_fsync(vp,f,cr,b,e) VOP(vop_fsync, vp)(VNHEAD(vp),f,cr,b,e)
275#define bhv_vop_inactive(vp,cr) VOP(vop_inactive, vp)(VNHEAD(vp),cr)
276#define bhv_vop_release(vp) VOP(vop_release, vp)(VNHEAD(vp))
277#define bhv_vop_fid2(vp,fidp) VOP(vop_fid2, vp)(VNHEAD(vp),fidp)
278#define bhv_vop_rwlock(vp,i) VOP(vop_rwlock, vp)(VNHEAD(vp),i)
279#define bhv_vop_rwlock_try(vp,i) VOP(vop_rwlock, vp)(VNHEAD(vp),i)
280#define bhv_vop_rwunlock(vp,i) VOP(vop_rwunlock, vp)(VNHEAD(vp),i)
281#define bhv_vop_frlock(vp,c,fl,flags,offset,fr) \
282 VOP(vop_frlock, vp)(VNHEAD(vp),c,fl,flags,offset,fr)
283#define bhv_vop_reclaim(vp) VOP(vop_reclaim, vp)(VNHEAD(vp))
284#define bhv_vop_attr_get(vp, name, val, vallenp, fl, cred) \
285 VOP(vop_attr_get, vp)(VNHEAD(vp),name,val,vallenp,fl,cred)
286#define bhv_vop_attr_set(vp, name, val, vallen, fl, cred) \
287 VOP(vop_attr_set, vp)(VNHEAD(vp),name,val,vallen,fl,cred)
288#define bhv_vop_attr_remove(vp, name, flags, cred) \
289 VOP(vop_attr_remove, vp)(VNHEAD(vp),name,flags,cred)
290#define bhv_vop_attr_list(vp, buf, buflen, fl, cursor, cred) \
291 VOP(vop_attr_list, vp)(VNHEAD(vp),buf,buflen,fl,cursor,cred)
292#define bhv_vop_link_removed(vp, dvp, linkzero) \
293 VOP(vop_link_removed, vp)(VNHEAD(vp), dvp, linkzero)
294#define bhv_vop_vnode_change(vp, cmd, val) \
295 VOP(vop_vnode_change, vp)(VNHEAD(vp), cmd, val)
296#define bhv_vop_toss_pages(vp, first, last, fiopt) \
297 VOP(vop_tosspages, vp)(VNHEAD(vp), first, last, fiopt)
298#define bhv_vop_flushinval_pages(vp, first, last, fiopt) \
299 VOP(vop_flushinval_pages, vp)(VNHEAD(vp),first,last,fiopt)
300#define bhv_vop_flush_pages(vp, first, last, flags, fiopt) \
301 VOP(vop_flush_pages, vp)(VNHEAD(vp),first,last,flags,fiopt)
302#define bhv_vop_ioctl(vp, inode, filp, fl, cmd, arg) \
303 VOP(vop_ioctl, vp)(VNHEAD(vp),inode,filp,fl,cmd,arg)
304#define bhv_vop_iflush(vp, flags) VOP(vop_iflush, vp)(VNHEAD(vp), flags)
305
306/*
307 * Flags for read/write calls - same values as IRIX 92 * Flags for read/write calls - same values as IRIX
308 */ 93 */
309#define IO_ISAIO 0x00001 /* don't wait for completion */ 94#define IO_ISAIO 0x00001 /* don't wait for completion */