aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-09 03:00:52 -0400
committerNathan Scott <nathans@sgi.com>2006-06-09 03:00:52 -0400
commit67fcaa73adafb19139a7cd8ab133592b6a0a0901 (patch)
tree6e7b83e7c8b0a1d8b4776af1537d6f07ebe9435d /fs/xfs/xfs_vnodeops.c
parentb83bd1388133e914c38bd31d69bc90143e6ab10c (diff)
[XFS] Resolve a namespace collision on vnode/vnodeops for FreeBSD porters.
SGI-PV: 953338 SGI-Modid: xfs-linux-melb:xfs-kern:26107a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c77
1 files changed, 38 insertions, 39 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 35906bae92e1..f3c2deeed0a3 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -62,7 +62,7 @@ xfs_open(
62 cred_t *credp) 62 cred_t *credp)
63{ 63{
64 int mode; 64 int mode;
65 vnode_t *vp = BHV_TO_VNODE(bdp); 65 bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
66 xfs_inode_t *ip = XFS_BHVTOI(bdp); 66 xfs_inode_t *ip = XFS_BHVTOI(bdp);
67 67
68 if (XFS_FORCED_SHUTDOWN(ip->i_mount)) 68 if (XFS_FORCED_SHUTDOWN(ip->i_mount))
@@ -88,9 +88,8 @@ xfs_close(
88 lastclose_t lastclose, 88 lastclose_t lastclose,
89 cred_t *credp) 89 cred_t *credp)
90{ 90{
91 vnode_t *vp = BHV_TO_VNODE(bdp); 91 bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
92 xfs_inode_t *ip = XFS_BHVTOI(bdp); 92 xfs_inode_t *ip = XFS_BHVTOI(bdp);
93 int error = 0;
94 93
95 if (XFS_FORCED_SHUTDOWN(ip->i_mount)) 94 if (XFS_FORCED_SHUTDOWN(ip->i_mount))
96 return XFS_ERROR(EIO); 95 return XFS_ERROR(EIO);
@@ -108,8 +107,8 @@ xfs_close(
108 * window where we'd otherwise be exposed to that problem. 107 * window where we'd otherwise be exposed to that problem.
109 */ 108 */
110 if (VUNTRUNCATE(vp) && VN_DIRTY(vp) && ip->i_delayed_blks > 0) 109 if (VUNTRUNCATE(vp) && VN_DIRTY(vp) && ip->i_delayed_blks > 0)
111 VOP_FLUSH_PAGES(vp, 0, -1, XFS_B_ASYNC, FI_NONE, error); 110 return bhv_vop_flush_pages(vp, 0, -1, XFS_B_ASYNC, FI_NONE);
112 return error; 111 return 0;
113} 112}
114 113
115/* 114/*
@@ -124,7 +123,7 @@ xfs_getattr(
124{ 123{
125 xfs_inode_t *ip; 124 xfs_inode_t *ip;
126 xfs_mount_t *mp; 125 xfs_mount_t *mp;
127 vnode_t *vp; 126 bhv_vnode_t *vp;
128 127
129 vp = BHV_TO_VNODE(bdp); 128 vp = BHV_TO_VNODE(bdp);
130 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 129 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
@@ -265,7 +264,7 @@ xfs_setattr(
265 uid_t uid=0, iuid=0; 264 uid_t uid=0, iuid=0;
266 gid_t gid=0, igid=0; 265 gid_t gid=0, igid=0;
267 int timeflags = 0; 266 int timeflags = 0;
268 vnode_t *vp; 267 bhv_vnode_t *vp;
269 xfs_prid_t projid=0, iprojid=0; 268 xfs_prid_t projid=0, iprojid=0;
270 int mandlock_before, mandlock_after; 269 int mandlock_before, mandlock_after;
271 struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2; 270 struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2;
@@ -888,7 +887,7 @@ xfs_setattr(
888 */ 887 */
889 mandlock_after = MANDLOCK(vp, ip->i_d.di_mode); 888 mandlock_after = MANDLOCK(vp, ip->i_d.di_mode);
890 if (mandlock_before != mandlock_after) { 889 if (mandlock_before != mandlock_after) {
891 VOP_VNODE_CHANGE(vp, VCHANGE_FLAGS_ENF_LOCKING, 890 bhv_vop_vnode_change(vp, VCHANGE_FLAGS_ENF_LOCKING,
892 mandlock_after); 891 mandlock_after);
893 } 892 }
894 893
@@ -976,7 +975,7 @@ xfs_readlink(
976 int count; 975 int count;
977 xfs_off_t offset; 976 xfs_off_t offset;
978 int pathlen; 977 int pathlen;
979 vnode_t *vp; 978 bhv_vnode_t *vp;
980 int error = 0; 979 int error = 0;
981 xfs_mount_t *mp; 980 xfs_mount_t *mp;
982 int nmaps; 981 int nmaps;
@@ -1547,7 +1546,7 @@ xfs_release(
1547 bhv_desc_t *bdp) 1546 bhv_desc_t *bdp)
1548{ 1547{
1549 xfs_inode_t *ip; 1548 xfs_inode_t *ip;
1550 vnode_t *vp; 1549 bhv_vnode_t *vp;
1551 xfs_mount_t *mp; 1550 xfs_mount_t *mp;
1552 int error; 1551 int error;
1553 1552
@@ -1600,8 +1599,8 @@ xfs_inactive(
1600 cred_t *credp) 1599 cred_t *credp)
1601{ 1600{
1602 xfs_inode_t *ip; 1601 xfs_inode_t *ip;
1603 vnode_t *vp; 1602 bhv_vnode_t *vp;
1604 xfs_bmap_free_t free_list; 1603 xfs_bmap_free_t free_list;
1605 xfs_fsblock_t first_block; 1604 xfs_fsblock_t first_block;
1606 int committed; 1605 int committed;
1607 xfs_trans_t *tp; 1606 xfs_trans_t *tp;
@@ -1817,16 +1816,16 @@ STATIC int
1817xfs_lookup( 1816xfs_lookup(
1818 bhv_desc_t *dir_bdp, 1817 bhv_desc_t *dir_bdp,
1819 vname_t *dentry, 1818 vname_t *dentry,
1820 vnode_t **vpp, 1819 bhv_vnode_t **vpp,
1821 int flags, 1820 int flags,
1822 vnode_t *rdir, 1821 bhv_vnode_t *rdir,
1823 cred_t *credp) 1822 cred_t *credp)
1824{ 1823{
1825 xfs_inode_t *dp, *ip; 1824 xfs_inode_t *dp, *ip;
1826 xfs_ino_t e_inum; 1825 xfs_ino_t e_inum;
1827 int error; 1826 int error;
1828 uint lock_mode; 1827 uint lock_mode;
1829 vnode_t *dir_vp; 1828 bhv_vnode_t *dir_vp;
1830 1829
1831 dir_vp = BHV_TO_VNODE(dir_bdp); 1830 dir_vp = BHV_TO_VNODE(dir_bdp);
1832 vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); 1831 vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address);
@@ -1855,13 +1854,13 @@ xfs_create(
1855 bhv_desc_t *dir_bdp, 1854 bhv_desc_t *dir_bdp,
1856 vname_t *dentry, 1855 vname_t *dentry,
1857 vattr_t *vap, 1856 vattr_t *vap,
1858 vnode_t **vpp, 1857 bhv_vnode_t **vpp,
1859 cred_t *credp) 1858 cred_t *credp)
1860{ 1859{
1861 char *name = VNAME(dentry); 1860 char *name = VNAME(dentry);
1862 vnode_t *dir_vp; 1861 bhv_vnode_t *dir_vp;
1863 xfs_inode_t *dp, *ip; 1862 xfs_inode_t *dp, *ip;
1864 vnode_t *vp=NULL; 1863 bhv_vnode_t *vp = NULL;
1865 xfs_trans_t *tp; 1864 xfs_trans_t *tp;
1866 xfs_mount_t *mp; 1865 xfs_mount_t *mp;
1867 xfs_dev_t rdev; 1866 xfs_dev_t rdev;
@@ -2047,7 +2046,7 @@ xfs_create(
2047 * Propagate the fact that the vnode changed after the 2046 * Propagate the fact that the vnode changed after the
2048 * xfs_inode locks have been released. 2047 * xfs_inode locks have been released.
2049 */ 2048 */
2050 VOP_VNODE_CHANGE(vp, VCHANGE_FLAGS_TRUNCATED, 3); 2049 bhv_vop_vnode_change(vp, VCHANGE_FLAGS_TRUNCATED, 3);
2051 2050
2052 *vpp = vp; 2051 *vpp = vp;
2053 2052
@@ -2345,7 +2344,7 @@ xfs_remove(
2345 vname_t *dentry, 2344 vname_t *dentry,
2346 cred_t *credp) 2345 cred_t *credp)
2347{ 2346{
2348 vnode_t *dir_vp; 2347 bhv_vnode_t *dir_vp;
2349 char *name = VNAME(dentry); 2348 char *name = VNAME(dentry);
2350 xfs_inode_t *dp, *ip; 2349 xfs_inode_t *dp, *ip;
2351 xfs_trans_t *tp = NULL; 2350 xfs_trans_t *tp = NULL;
@@ -2532,7 +2531,7 @@ xfs_remove(
2532 /* 2531 /*
2533 * Let interposed file systems know about removed links. 2532 * Let interposed file systems know about removed links.
2534 */ 2533 */
2535 VOP_LINK_REMOVED(XFS_ITOV(ip), dir_vp, link_zero); 2534 bhv_vop_link_removed(XFS_ITOV(ip), dir_vp, link_zero);
2536 2535
2537 IRELE(ip); 2536 IRELE(ip);
2538 2537
@@ -2585,7 +2584,7 @@ xfs_remove(
2585STATIC int 2584STATIC int
2586xfs_link( 2585xfs_link(
2587 bhv_desc_t *target_dir_bdp, 2586 bhv_desc_t *target_dir_bdp,
2588 vnode_t *src_vp, 2587 bhv_vnode_t *src_vp,
2589 vname_t *dentry, 2588 vname_t *dentry,
2590 cred_t *credp) 2589 cred_t *credp)
2591{ 2590{
@@ -2598,7 +2597,7 @@ xfs_link(
2598 xfs_fsblock_t first_block; 2597 xfs_fsblock_t first_block;
2599 int cancel_flags; 2598 int cancel_flags;
2600 int committed; 2599 int committed;
2601 vnode_t *target_dir_vp; 2600 bhv_vnode_t *target_dir_vp;
2602 int resblks; 2601 int resblks;
2603 char *target_name = VNAME(dentry); 2602 char *target_name = VNAME(dentry);
2604 int target_namelen; 2603 int target_namelen;
@@ -2757,13 +2756,13 @@ xfs_mkdir(
2757 bhv_desc_t *dir_bdp, 2756 bhv_desc_t *dir_bdp,
2758 vname_t *dentry, 2757 vname_t *dentry,
2759 vattr_t *vap, 2758 vattr_t *vap,
2760 vnode_t **vpp, 2759 bhv_vnode_t **vpp,
2761 cred_t *credp) 2760 cred_t *credp)
2762{ 2761{
2763 char *dir_name = VNAME(dentry); 2762 char *dir_name = VNAME(dentry);
2764 xfs_inode_t *dp; 2763 xfs_inode_t *dp;
2765 xfs_inode_t *cdp; /* inode of created dir */ 2764 xfs_inode_t *cdp; /* inode of created dir */
2766 vnode_t *cvp; /* vnode of created dir */ 2765 bhv_vnode_t *cvp; /* vnode of created dir */
2767 xfs_trans_t *tp; 2766 xfs_trans_t *tp;
2768 xfs_mount_t *mp; 2767 xfs_mount_t *mp;
2769 int cancel_flags; 2768 int cancel_flags;
@@ -2771,7 +2770,7 @@ xfs_mkdir(
2771 int committed; 2770 int committed;
2772 xfs_bmap_free_t free_list; 2771 xfs_bmap_free_t free_list;
2773 xfs_fsblock_t first_block; 2772 xfs_fsblock_t first_block;
2774 vnode_t *dir_vp; 2773 bhv_vnode_t *dir_vp;
2775 boolean_t dp_joined_to_trans; 2774 boolean_t dp_joined_to_trans;
2776 boolean_t created = B_FALSE; 2775 boolean_t created = B_FALSE;
2777 int dm_event_sent = 0; 2776 int dm_event_sent = 0;
@@ -3003,7 +3002,7 @@ xfs_rmdir(
3003 xfs_fsblock_t first_block; 3002 xfs_fsblock_t first_block;
3004 int cancel_flags; 3003 int cancel_flags;
3005 int committed; 3004 int committed;
3006 vnode_t *dir_vp; 3005 bhv_vnode_t *dir_vp;
3007 int dm_di_mode = 0; 3006 int dm_di_mode = 0;
3008 int last_cdp_link; 3007 int last_cdp_link;
3009 int namelen; 3008 int namelen;
@@ -3202,7 +3201,7 @@ xfs_rmdir(
3202 /* 3201 /*
3203 * Let interposed file systems know about removed links. 3202 * Let interposed file systems know about removed links.
3204 */ 3203 */
3205 VOP_LINK_REMOVED(XFS_ITOV(cdp), dir_vp, last_cdp_link); 3204 bhv_vop_link_removed(XFS_ITOV(cdp), dir_vp, last_cdp_link);
3206 3205
3207 IRELE(cdp); 3206 IRELE(cdp);
3208 3207
@@ -3272,7 +3271,7 @@ xfs_symlink(
3272 vname_t *dentry, 3271 vname_t *dentry,
3273 vattr_t *vap, 3272 vattr_t *vap,
3274 char *target_path, 3273 char *target_path,
3275 vnode_t **vpp, 3274 bhv_vnode_t **vpp,
3276 cred_t *credp) 3275 cred_t *credp)
3277{ 3276{
3278 xfs_trans_t *tp; 3277 xfs_trans_t *tp;
@@ -3284,7 +3283,7 @@ xfs_symlink(
3284 xfs_bmap_free_t free_list; 3283 xfs_bmap_free_t free_list;
3285 xfs_fsblock_t first_block; 3284 xfs_fsblock_t first_block;
3286 boolean_t dp_joined_to_trans; 3285 boolean_t dp_joined_to_trans;
3287 vnode_t *dir_vp; 3286 bhv_vnode_t *dir_vp;
3288 uint cancel_flags; 3287 uint cancel_flags;
3289 int committed; 3288 int committed;
3290 xfs_fileoff_t first_fsb; 3289 xfs_fileoff_t first_fsb;
@@ -3562,7 +3561,7 @@ std_return:
3562 } 3561 }
3563 3562
3564 if (!error) { 3563 if (!error) {
3565 vnode_t *vp; 3564 bhv_vnode_t *vp;
3566 3565
3567 ASSERT(ip); 3566 ASSERT(ip);
3568 vp = XFS_ITOV(ip); 3567 vp = XFS_ITOV(ip);
@@ -3630,7 +3629,7 @@ xfs_rwlock(
3630 vrwlock_t locktype) 3629 vrwlock_t locktype)
3631{ 3630{
3632 xfs_inode_t *ip; 3631 xfs_inode_t *ip;
3633 vnode_t *vp; 3632 bhv_vnode_t *vp;
3634 3633
3635 vp = BHV_TO_VNODE(bdp); 3634 vp = BHV_TO_VNODE(bdp);
3636 if (VN_ISDIR(vp)) 3635 if (VN_ISDIR(vp))
@@ -3661,7 +3660,7 @@ xfs_rwunlock(
3661 vrwlock_t locktype) 3660 vrwlock_t locktype)
3662{ 3661{
3663 xfs_inode_t *ip; 3662 xfs_inode_t *ip;
3664 vnode_t *vp; 3663 bhv_vnode_t *vp;
3665 3664
3666 vp = BHV_TO_VNODE(bdp); 3665 vp = BHV_TO_VNODE(bdp);
3667 if (VN_ISDIR(vp)) 3666 if (VN_ISDIR(vp))
@@ -3810,7 +3809,7 @@ xfs_reclaim(
3810 bhv_desc_t *bdp) 3809 bhv_desc_t *bdp)
3811{ 3810{
3812 xfs_inode_t *ip; 3811 xfs_inode_t *ip;
3813 vnode_t *vp; 3812 bhv_vnode_t *vp;
3814 3813
3815 vp = BHV_TO_VNODE(bdp); 3814 vp = BHV_TO_VNODE(bdp);
3816 ip = XFS_BHVTOI(bdp); 3815 ip = XFS_BHVTOI(bdp);
@@ -3865,7 +3864,7 @@ xfs_finish_reclaim(
3865 int sync_mode) 3864 int sync_mode)
3866{ 3865{
3867 xfs_ihash_t *ih = ip->i_hash; 3866 xfs_ihash_t *ih = ip->i_hash;
3868 vnode_t *vp = XFS_ITOV_NULL(ip); 3867 bhv_vnode_t *vp = XFS_ITOV_NULL(ip);
3869 int error; 3868 int error;
3870 3869
3871 if (vp && VN_BAD(vp)) 3870 if (vp && VN_BAD(vp))
@@ -4275,7 +4274,7 @@ xfs_free_file_space(
4275 xfs_off_t len, 4274 xfs_off_t len,
4276 int attr_flags) 4275 int attr_flags)
4277{ 4276{
4278 vnode_t *vp; 4277 bhv_vnode_t *vp;
4279 int committed; 4278 int committed;
4280 int done; 4279 int done;
4281 xfs_off_t end_dmi_offset; 4280 xfs_off_t end_dmi_offset;
@@ -4341,7 +4340,7 @@ xfs_free_file_space(
4341 if (VN_CACHED(vp) != 0) { 4340 if (VN_CACHED(vp) != 0) {
4342 xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1, 4341 xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1,
4343 ctooff(offtoct(ioffset)), -1); 4342 ctooff(offtoct(ioffset)), -1);
4344 VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(ioffset)), 4343 bhv_vop_flushinval_pages(vp, ctooff(offtoct(ioffset)),
4345 -1, FI_REMAPF_LOCKED); 4344 -1, FI_REMAPF_LOCKED);
4346 } 4345 }
4347 4346
@@ -4504,7 +4503,7 @@ xfs_change_file_space(
4504 xfs_off_t llen; 4503 xfs_off_t llen;
4505 xfs_trans_t *tp; 4504 xfs_trans_t *tp;
4506 vattr_t va; 4505 vattr_t va;
4507 vnode_t *vp; 4506 bhv_vnode_t *vp;
4508 4507
4509 vp = BHV_TO_VNODE(bdp); 4508 vp = BHV_TO_VNODE(bdp);
4510 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 4509 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
@@ -4657,7 +4656,7 @@ xfs_change_file_space(
4657 return error; 4656 return error;
4658} 4657}
4659 4658
4660vnodeops_t xfs_vnodeops = { 4659bhv_vnodeops_t xfs_vnodeops = {
4661 BHV_IDENTITY_INIT(VN_BHV_XFS,VNODE_POSITION_XFS), 4660 BHV_IDENTITY_INIT(VN_BHV_XFS,VNODE_POSITION_XFS),
4662 .vop_open = xfs_open, 4661 .vop_open = xfs_open,
4663 .vop_close = xfs_close, 4662 .vop_close = xfs_close,