aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-04-22 03:33:25 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-29 01:53:05 -0400
commit42173f6860af7e016a950a9a19a66679cfc46d98 (patch)
treeb0e6c8efae40909b235412ff1e23d0063ec9a6f6 /fs/xfs/xfs_vnodeops.c
parenta01e035ebb552223c03f2d9138ffc73f2d4d3965 (diff)
[XFS] Remove VN_IS* macros and related cruft.
We can just check i_mode / di_mode directly. SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30896a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 6650601c64f7..3fef54b11582 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -211,7 +211,6 @@ xfs_setattr(
211 int flags, 211 int flags,
212 cred_t *credp) 212 cred_t *credp)
213{ 213{
214 bhv_vnode_t *vp = XFS_ITOV(ip);
215 xfs_mount_t *mp = ip->i_mount; 214 xfs_mount_t *mp = ip->i_mount;
216 xfs_trans_t *tp; 215 xfs_trans_t *tp;
217 int mask; 216 int mask;
@@ -222,7 +221,6 @@ xfs_setattr(
222 gid_t gid=0, igid=0; 221 gid_t gid=0, igid=0;
223 int timeflags = 0; 222 int timeflags = 0;
224 xfs_prid_t projid=0, iprojid=0; 223 xfs_prid_t projid=0, iprojid=0;
225 int mandlock_before, mandlock_after;
226 struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2; 224 struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2;
227 int file_owner; 225 int file_owner;
228 int need_iolock = 1; 226 int need_iolock = 1;
@@ -383,7 +381,7 @@ xfs_setattr(
383 m |= S_ISGID; 381 m |= S_ISGID;
384#if 0 382#if 0
385 /* Linux allows this, Irix doesn't. */ 383 /* Linux allows this, Irix doesn't. */
386 if ((vap->va_mode & S_ISVTX) && !VN_ISDIR(vp)) 384 if ((vap->va_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode))
387 m |= S_ISVTX; 385 m |= S_ISVTX;
388#endif 386#endif
389 if (m && !capable(CAP_FSETID)) 387 if (m && !capable(CAP_FSETID))
@@ -461,10 +459,10 @@ xfs_setattr(
461 goto error_return; 459 goto error_return;
462 } 460 }
463 461
464 if (VN_ISDIR(vp)) { 462 if (S_ISDIR(ip->i_d.di_mode)) {
465 code = XFS_ERROR(EISDIR); 463 code = XFS_ERROR(EISDIR);
466 goto error_return; 464 goto error_return;
467 } else if (!VN_ISREG(vp)) { 465 } else if (!S_ISREG(ip->i_d.di_mode)) {
468 code = XFS_ERROR(EINVAL); 466 code = XFS_ERROR(EINVAL);
469 goto error_return; 467 goto error_return;
470 } 468 }
@@ -626,9 +624,6 @@ xfs_setattr(
626 xfs_trans_ihold(tp, ip); 624 xfs_trans_ihold(tp, ip);
627 } 625 }
628 626
629 /* determine whether mandatory locking mode changes */
630 mandlock_before = MANDLOCK(vp, ip->i_d.di_mode);
631
632 /* 627 /*
633 * Truncate file. Must have write permission and not be a directory. 628 * Truncate file. Must have write permission and not be a directory.
634 */ 629 */
@@ -858,13 +853,6 @@ xfs_setattr(
858 code = xfs_trans_commit(tp, commit_flags); 853 code = xfs_trans_commit(tp, commit_flags);
859 } 854 }
860 855
861 /*
862 * If the (regular) file's mandatory locking mode changed, then
863 * notify the vnode. We do this under the inode lock to prevent
864 * racing calls to vop_vnode_change.
865 */
866 mandlock_after = MANDLOCK(vp, ip->i_d.di_mode);
867
868 xfs_iunlock(ip, lock_flags); 856 xfs_iunlock(ip, lock_flags);
869 857
870 /* 858 /*
@@ -1491,7 +1479,7 @@ xfs_release(
1491 xfs_mount_t *mp = ip->i_mount; 1479 xfs_mount_t *mp = ip->i_mount;
1492 int error; 1480 int error;
1493 1481
1494 if (!VN_ISREG(vp) || (ip->i_d.di_mode == 0)) 1482 if (!S_ISREG(ip->i_d.di_mode) || (ip->i_d.di_mode == 0))
1495 return 0; 1483 return 0;
1496 1484
1497 /* If this is a read-only mount, don't do this (would generate I/O) */ 1485 /* If this is a read-only mount, don't do this (would generate I/O) */