aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-03-27 03:01:08 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-17 21:49:08 -0400
commit433550990e6c2e94995239bac6a52b4df454cae0 (patch)
tree4536c63306b8e6656b969dc71b099e1b2c149454 /fs
parentdf26cfe849d8fd767b26fcd4bfebfff67bda9f3a (diff)
[XFS] remove most calls to VN_RELE
Most VN_RELE calls either directly contain a XFS_ITOV or have the corresponding xfs_inode already in scope. Use the IRELE helper instead of VN_RELE to clarify the code. With a little more work we can kill VN_RELE altogether and define IRELE in terms of iput directly. SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30710a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/quota/xfs_qm.c6
-rw-r--r--fs/xfs/quota/xfs_qm_syscalls.c10
-rw-r--r--fs/xfs/xfs_log_recover.c3
-rw-r--r--fs/xfs/xfs_mount.c5
-rw-r--r--fs/xfs/xfs_rtalloc.c3
-rw-r--r--fs/xfs/xfs_vfsops.c13
6 files changed, 21 insertions, 19 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 8e9c5ae6504d..adbc7bb9fbaa 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -1810,7 +1810,7 @@ xfs_qm_dqusage_adjust(
1810 * Now release the inode. This will send it to 'inactive', and 1810 * Now release the inode. This will send it to 'inactive', and
1811 * possibly even free blocks. 1811 * possibly even free blocks.
1812 */ 1812 */
1813 VN_RELE(XFS_ITOV(ip)); 1813 IRELE(ip);
1814 1814
1815 /* 1815 /*
1816 * Goto next inode. 1816 * Goto next inode.
@@ -1968,7 +1968,7 @@ xfs_qm_init_quotainos(
1968 if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 1968 if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino,
1969 0, 0, &gip, 0))) { 1969 0, 0, &gip, 0))) {
1970 if (uip) 1970 if (uip)
1971 VN_RELE(XFS_ITOV(uip)); 1971 IRELE(uip);
1972 return XFS_ERROR(error); 1972 return XFS_ERROR(error);
1973 } 1973 }
1974 } 1974 }
@@ -1999,7 +1999,7 @@ xfs_qm_init_quotainos(
1999 sbflags | XFS_SB_GQUOTINO, flags); 1999 sbflags | XFS_SB_GQUOTINO, flags);
2000 if (error) { 2000 if (error) {
2001 if (uip) 2001 if (uip)
2002 VN_RELE(XFS_ITOV(uip)); 2002 IRELE(uip);
2003 2003
2004 return XFS_ERROR(error); 2004 return XFS_ERROR(error);
2005 } 2005 }
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
index d2b8be7e75f9..3dc161f39d13 100644
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -386,7 +386,7 @@ xfs_qm_scall_trunc_qfiles(
386 error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, 0, 0, &qip, 0); 386 error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, 0, 0, &qip, 0);
387 if (! error) { 387 if (! error) {
388 (void) xfs_truncate_file(mp, qip); 388 (void) xfs_truncate_file(mp, qip);
389 VN_RELE(XFS_ITOV(qip)); 389 IRELE(qip);
390 } 390 }
391 } 391 }
392 392
@@ -395,7 +395,7 @@ xfs_qm_scall_trunc_qfiles(
395 error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 0, 0, &qip, 0); 395 error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 0, 0, &qip, 0);
396 if (! error) { 396 if (! error) {
397 (void) xfs_truncate_file(mp, qip); 397 (void) xfs_truncate_file(mp, qip);
398 VN_RELE(XFS_ITOV(qip)); 398 IRELE(qip);
399 } 399 }
400 } 400 }
401 401
@@ -552,13 +552,13 @@ xfs_qm_scall_getqstat(
552 out->qs_uquota.qfs_nblks = uip->i_d.di_nblocks; 552 out->qs_uquota.qfs_nblks = uip->i_d.di_nblocks;
553 out->qs_uquota.qfs_nextents = uip->i_d.di_nextents; 553 out->qs_uquota.qfs_nextents = uip->i_d.di_nextents;
554 if (tempuqip) 554 if (tempuqip)
555 VN_RELE(XFS_ITOV(uip)); 555 IRELE(uip);
556 } 556 }
557 if (gip) { 557 if (gip) {
558 out->qs_gquota.qfs_nblks = gip->i_d.di_nblocks; 558 out->qs_gquota.qfs_nblks = gip->i_d.di_nblocks;
559 out->qs_gquota.qfs_nextents = gip->i_d.di_nextents; 559 out->qs_gquota.qfs_nextents = gip->i_d.di_nextents;
560 if (tempgqip) 560 if (tempgqip)
561 VN_RELE(XFS_ITOV(gip)); 561 IRELE(gip);
562 } 562 }
563 if (mp->m_quotainfo) { 563 if (mp->m_quotainfo) {
564 out->qs_incoredqs = XFS_QI_MPLNDQUOTS(mp); 564 out->qs_incoredqs = XFS_QI_MPLNDQUOTS(mp);
@@ -1095,7 +1095,7 @@ again:
1095 * inactive code in hell. 1095 * inactive code in hell.
1096 */ 1096 */
1097 if (vnode_refd) 1097 if (vnode_refd)
1098 VN_RELE(vp); 1098 IRELE(ip);
1099 XFS_MOUNT_ILOCK(mp); 1099 XFS_MOUNT_ILOCK(mp);
1100 /* 1100 /*
1101 * If an inode was inserted or removed, we gotta 1101 * If an inode was inserted or removed, we gotta
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index cd24711ae276..962d74a9ea7e 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -46,6 +46,7 @@
46#include "xfs_trans_priv.h" 46#include "xfs_trans_priv.h"
47#include "xfs_quota.h" 47#include "xfs_quota.h"
48#include "xfs_rw.h" 48#include "xfs_rw.h"
49#include "xfs_utils.h"
49 50
50STATIC int xlog_find_zeroed(xlog_t *, xfs_daddr_t *); 51STATIC int xlog_find_zeroed(xlog_t *, xfs_daddr_t *);
51STATIC int xlog_clear_stale_blocks(xlog_t *, xfs_lsn_t); 52STATIC int xlog_clear_stale_blocks(xlog_t *, xfs_lsn_t);
@@ -3248,7 +3249,7 @@ xlog_recover_process_iunlinks(
3248 if (ip->i_d.di_mode == 0) 3249 if (ip->i_d.di_mode == 0)
3249 xfs_iput_new(ip, 0); 3250 xfs_iput_new(ip, 0);
3250 else 3251 else
3251 VN_RELE(XFS_ITOV(ip)); 3252 IRELE(ip);
3252 } else { 3253 } else {
3253 /* 3254 /*
3254 * We can't read in the inode 3255 * We can't read in the inode
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 41b690e6896c..c2aafeb8c6cb 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -43,6 +43,7 @@
43#include "xfs_rw.h" 43#include "xfs_rw.h"
44#include "xfs_quota.h" 44#include "xfs_quota.h"
45#include "xfs_fsops.h" 45#include "xfs_fsops.h"
46#include "xfs_utils.h"
46 47
47STATIC void xfs_mount_log_sb(xfs_mount_t *, __int64_t); 48STATIC void xfs_mount_log_sb(xfs_mount_t *, __int64_t);
48STATIC int xfs_uuid_mount(xfs_mount_t *); 49STATIC int xfs_uuid_mount(xfs_mount_t *);
@@ -956,7 +957,6 @@ xfs_mountfs(
956{ 957{
957 xfs_sb_t *sbp = &(mp->m_sb); 958 xfs_sb_t *sbp = &(mp->m_sb);
958 xfs_inode_t *rip; 959 xfs_inode_t *rip;
959 bhv_vnode_t *rvp = NULL;
960 __uint64_t resblks; 960 __uint64_t resblks;
961 __int64_t update_flags = 0LL; 961 __int64_t update_flags = 0LL;
962 uint quotamount, quotaflags; 962 uint quotamount, quotaflags;
@@ -1158,7 +1158,6 @@ xfs_mountfs(
1158 } 1158 }
1159 1159
1160 ASSERT(rip != NULL); 1160 ASSERT(rip != NULL);
1161 rvp = XFS_ITOV(rip);
1162 1161
1163 if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { 1162 if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) {
1164 cmn_err(CE_WARN, "XFS: corrupted root inode"); 1163 cmn_err(CE_WARN, "XFS: corrupted root inode");
@@ -1241,7 +1240,7 @@ xfs_mountfs(
1241 /* 1240 /*
1242 * Free up the root inode. 1241 * Free up the root inode.
1243 */ 1242 */
1244 VN_RELE(rvp); 1243 IRELE(rip);
1245 error3: 1244 error3:
1246 xfs_log_unmount_dealloc(mp); 1245 xfs_log_unmount_dealloc(mp);
1247 error2: 1246 error2:
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 47082c01872d..9cd6471cd60f 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -44,6 +44,7 @@
44#include "xfs_rw.h" 44#include "xfs_rw.h"
45#include "xfs_inode_item.h" 45#include "xfs_inode_item.h"
46#include "xfs_trans_space.h" 46#include "xfs_trans_space.h"
47#include "xfs_utils.h"
47 48
48 49
49/* 50/*
@@ -2278,7 +2279,7 @@ xfs_rtmount_inodes(
2278 ASSERT(sbp->sb_rsumino != NULLFSINO); 2279 ASSERT(sbp->sb_rsumino != NULLFSINO);
2279 error = xfs_iget(mp, NULL, sbp->sb_rsumino, 0, 0, &mp->m_rsumip, 0); 2280 error = xfs_iget(mp, NULL, sbp->sb_rsumino, 0, 0, &mp->m_rsumip, 0);
2280 if (error) { 2281 if (error) {
2281 VN_RELE(XFS_ITOV(mp->m_rbmip)); 2282 IRELE(mp->m_rbmip);
2282 return error; 2283 return error;
2283 } 2284 }
2284 ASSERT(mp->m_rsumip != NULL); 2285 ASSERT(mp->m_rsumip != NULL);
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 4c132a87d437..c21e4d168297 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -55,6 +55,7 @@
55#include "xfs_fsops.h" 55#include "xfs_fsops.h"
56#include "xfs_vnodeops.h" 56#include "xfs_vnodeops.h"
57#include "xfs_vfsops.h" 57#include "xfs_vfsops.h"
58#include "xfs_utils.h"
58 59
59 60
60int __init 61int __init
@@ -595,7 +596,7 @@ xfs_unmount(
595 /* 596 /*
596 * Drop the reference count 597 * Drop the reference count
597 */ 598 */
598 VN_RELE(rvp); 599 IRELE(rip);
599 600
600 /* 601 /*
601 * If we're forcing a shutdown, typically because of a media error, 602 * If we're forcing a shutdown, typically because of a media error,
@@ -777,8 +778,8 @@ xfs_unmount_flush(
777 goto fscorrupt_out2; 778 goto fscorrupt_out2;
778 779
779 if (rbmip) { 780 if (rbmip) {
780 VN_RELE(XFS_ITOV(rbmip)); 781 IRELE(rbmip);
781 VN_RELE(XFS_ITOV(rsumip)); 782 IRELE(rsumip);
782 } 783 }
783 784
784 xfs_iunlock(rip, XFS_ILOCK_EXCL); 785 xfs_iunlock(rip, XFS_ILOCK_EXCL);
@@ -1156,10 +1157,10 @@ xfs_sync_inodes(
1156 * above, then wait until after we've unlocked 1157 * above, then wait until after we've unlocked
1157 * the inode to release the reference. This is 1158 * the inode to release the reference. This is
1158 * because we can be already holding the inode 1159 * because we can be already holding the inode
1159 * lock when VN_RELE() calls xfs_inactive(). 1160 * lock when IRELE() calls xfs_inactive().
1160 * 1161 *
1161 * Make sure to drop the mount lock before calling 1162 * Make sure to drop the mount lock before calling
1162 * VN_RELE() so that we don't trip over ourselves if 1163 * IRELE() so that we don't trip over ourselves if
1163 * we have to go for the mount lock again in the 1164 * we have to go for the mount lock again in the
1164 * inactive code. 1165 * inactive code.
1165 */ 1166 */
@@ -1167,7 +1168,7 @@ xfs_sync_inodes(
1167 IPOINTER_INSERT(ip, mp); 1168 IPOINTER_INSERT(ip, mp);
1168 } 1169 }
1169 1170
1170 VN_RELE(vp); 1171 IRELE(ip);
1171 1172
1172 vnode_refed = B_FALSE; 1173 vnode_refed = B_FALSE;
1173 } 1174 }