Commit 43355099 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Lachlan McIlroy

[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: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent df26cfe8
...@@ -1810,7 +1810,7 @@ xfs_qm_dqusage_adjust( ...@@ -1810,7 +1810,7 @@ xfs_qm_dqusage_adjust(
* Now release the inode. This will send it to 'inactive', and * Now release the inode. This will send it to 'inactive', and
* possibly even free blocks. * possibly even free blocks.
*/ */
VN_RELE(XFS_ITOV(ip)); IRELE(ip);
/* /*
* Goto next inode. * Goto next inode.
...@@ -1968,7 +1968,7 @@ xfs_qm_init_quotainos( ...@@ -1968,7 +1968,7 @@ xfs_qm_init_quotainos(
if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino,
0, 0, &gip, 0))) { 0, 0, &gip, 0))) {
if (uip) if (uip)
VN_RELE(XFS_ITOV(uip)); IRELE(uip);
return XFS_ERROR(error); return XFS_ERROR(error);
} }
} }
...@@ -1999,7 +1999,7 @@ xfs_qm_init_quotainos( ...@@ -1999,7 +1999,7 @@ xfs_qm_init_quotainos(
sbflags | XFS_SB_GQUOTINO, flags); sbflags | XFS_SB_GQUOTINO, flags);
if (error) { if (error) {
if (uip) if (uip)
VN_RELE(XFS_ITOV(uip)); IRELE(uip);
return XFS_ERROR(error); return XFS_ERROR(error);
} }
......
...@@ -386,7 +386,7 @@ xfs_qm_scall_trunc_qfiles( ...@@ -386,7 +386,7 @@ xfs_qm_scall_trunc_qfiles(
error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, 0, 0, &qip, 0); error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, 0, 0, &qip, 0);
if (! error) { if (! error) {
(void) xfs_truncate_file(mp, qip); (void) xfs_truncate_file(mp, qip);
VN_RELE(XFS_ITOV(qip)); IRELE(qip);
} }
} }
...@@ -395,7 +395,7 @@ xfs_qm_scall_trunc_qfiles( ...@@ -395,7 +395,7 @@ xfs_qm_scall_trunc_qfiles(
error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 0, 0, &qip, 0); error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 0, 0, &qip, 0);
if (! error) { if (! error) {
(void) xfs_truncate_file(mp, qip); (void) xfs_truncate_file(mp, qip);
VN_RELE(XFS_ITOV(qip)); IRELE(qip);
} }
} }
...@@ -552,13 +552,13 @@ xfs_qm_scall_getqstat( ...@@ -552,13 +552,13 @@ xfs_qm_scall_getqstat(
out->qs_uquota.qfs_nblks = uip->i_d.di_nblocks; out->qs_uquota.qfs_nblks = uip->i_d.di_nblocks;
out->qs_uquota.qfs_nextents = uip->i_d.di_nextents; out->qs_uquota.qfs_nextents = uip->i_d.di_nextents;
if (tempuqip) if (tempuqip)
VN_RELE(XFS_ITOV(uip)); IRELE(uip);
} }
if (gip) { if (gip) {
out->qs_gquota.qfs_nblks = gip->i_d.di_nblocks; out->qs_gquota.qfs_nblks = gip->i_d.di_nblocks;
out->qs_gquota.qfs_nextents = gip->i_d.di_nextents; out->qs_gquota.qfs_nextents = gip->i_d.di_nextents;
if (tempgqip) if (tempgqip)
VN_RELE(XFS_ITOV(gip)); IRELE(gip);
} }
if (mp->m_quotainfo) { if (mp->m_quotainfo) {
out->qs_incoredqs = XFS_QI_MPLNDQUOTS(mp); out->qs_incoredqs = XFS_QI_MPLNDQUOTS(mp);
...@@ -1095,7 +1095,7 @@ xfs_qm_dqrele_all_inodes( ...@@ -1095,7 +1095,7 @@ xfs_qm_dqrele_all_inodes(
* inactive code in hell. * inactive code in hell.
*/ */
if (vnode_refd) if (vnode_refd)
VN_RELE(vp); IRELE(ip);
XFS_MOUNT_ILOCK(mp); XFS_MOUNT_ILOCK(mp);
/* /*
* If an inode was inserted or removed, we gotta * If an inode was inserted or removed, we gotta
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "xfs_trans_priv.h" #include "xfs_trans_priv.h"
#include "xfs_quota.h" #include "xfs_quota.h"
#include "xfs_rw.h" #include "xfs_rw.h"
#include "xfs_utils.h"
STATIC int xlog_find_zeroed(xlog_t *, xfs_daddr_t *); STATIC int xlog_find_zeroed(xlog_t *, xfs_daddr_t *);
STATIC int xlog_clear_stale_blocks(xlog_t *, xfs_lsn_t); STATIC int xlog_clear_stale_blocks(xlog_t *, xfs_lsn_t);
...@@ -3248,7 +3249,7 @@ xlog_recover_process_iunlinks( ...@@ -3248,7 +3249,7 @@ xlog_recover_process_iunlinks(
if (ip->i_d.di_mode == 0) if (ip->i_d.di_mode == 0)
xfs_iput_new(ip, 0); xfs_iput_new(ip, 0);
else else
VN_RELE(XFS_ITOV(ip)); IRELE(ip);
} else { } else {
/* /*
* We can't read in the inode * We can't read in the inode
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "xfs_rw.h" #include "xfs_rw.h"
#include "xfs_quota.h" #include "xfs_quota.h"
#include "xfs_fsops.h" #include "xfs_fsops.h"
#include "xfs_utils.h"
STATIC void xfs_mount_log_sb(xfs_mount_t *, __int64_t); STATIC void xfs_mount_log_sb(xfs_mount_t *, __int64_t);
STATIC int xfs_uuid_mount(xfs_mount_t *); STATIC int xfs_uuid_mount(xfs_mount_t *);
...@@ -956,7 +957,6 @@ xfs_mountfs( ...@@ -956,7 +957,6 @@ xfs_mountfs(
{ {
xfs_sb_t *sbp = &(mp->m_sb); xfs_sb_t *sbp = &(mp->m_sb);
xfs_inode_t *rip; xfs_inode_t *rip;
bhv_vnode_t *rvp = NULL;
__uint64_t resblks; __uint64_t resblks;
__int64_t update_flags = 0LL; __int64_t update_flags = 0LL;
uint quotamount, quotaflags; uint quotamount, quotaflags;
...@@ -1158,7 +1158,6 @@ xfs_mountfs( ...@@ -1158,7 +1158,6 @@ xfs_mountfs(
} }
ASSERT(rip != NULL); ASSERT(rip != NULL);
rvp = XFS_ITOV(rip);
if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) {
cmn_err(CE_WARN, "XFS: corrupted root inode"); cmn_err(CE_WARN, "XFS: corrupted root inode");
...@@ -1241,7 +1240,7 @@ xfs_mountfs( ...@@ -1241,7 +1240,7 @@ xfs_mountfs(
/* /*
* Free up the root inode. * Free up the root inode.
*/ */
VN_RELE(rvp); IRELE(rip);
error3: error3:
xfs_log_unmount_dealloc(mp); xfs_log_unmount_dealloc(mp);
error2: error2:
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "xfs_rw.h" #include "xfs_rw.h"
#include "xfs_inode_item.h" #include "xfs_inode_item.h"
#include "xfs_trans_space.h" #include "xfs_trans_space.h"
#include "xfs_utils.h"
/* /*
...@@ -2278,7 +2279,7 @@ xfs_rtmount_inodes( ...@@ -2278,7 +2279,7 @@ xfs_rtmount_inodes(
ASSERT(sbp->sb_rsumino != NULLFSINO); ASSERT(sbp->sb_rsumino != NULLFSINO);
error = xfs_iget(mp, NULL, sbp->sb_rsumino, 0, 0, &mp->m_rsumip, 0); error = xfs_iget(mp, NULL, sbp->sb_rsumino, 0, 0, &mp->m_rsumip, 0);
if (error) { if (error) {
VN_RELE(XFS_ITOV(mp->m_rbmip)); IRELE(mp->m_rbmip);
return error; return error;
} }
ASSERT(mp->m_rsumip != NULL); ASSERT(mp->m_rsumip != NULL);
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include "xfs_fsops.h" #include "xfs_fsops.h"
#include "xfs_vnodeops.h" #include "xfs_vnodeops.h"
#include "xfs_vfsops.h" #include "xfs_vfsops.h"
#include "xfs_utils.h"
int __init int __init
...@@ -595,7 +596,7 @@ xfs_unmount( ...@@ -595,7 +596,7 @@ xfs_unmount(
/* /*
* Drop the reference count * Drop the reference count
*/ */
VN_RELE(rvp); IRELE(rip);
/* /*
* If we're forcing a shutdown, typically because of a media error, * If we're forcing a shutdown, typically because of a media error,
...@@ -777,8 +778,8 @@ xfs_unmount_flush( ...@@ -777,8 +778,8 @@ xfs_unmount_flush(
goto fscorrupt_out2; goto fscorrupt_out2;
if (rbmip) { if (rbmip) {
VN_RELE(XFS_ITOV(rbmip)); IRELE(rbmip);
VN_RELE(XFS_ITOV(rsumip)); IRELE(rsumip);
} }
xfs_iunlock(rip, XFS_ILOCK_EXCL); xfs_iunlock(rip, XFS_ILOCK_EXCL);
...@@ -1156,10 +1157,10 @@ xfs_sync_inodes( ...@@ -1156,10 +1157,10 @@ xfs_sync_inodes(
* above, then wait until after we've unlocked * above, then wait until after we've unlocked
* the inode to release the reference. This is * the inode to release the reference. This is
* because we can be already holding the inode * because we can be already holding the inode
* lock when VN_RELE() calls xfs_inactive(). * lock when IRELE() calls xfs_inactive().
* *
* Make sure to drop the mount lock before calling * Make sure to drop the mount lock before calling
* VN_RELE() so that we don't trip over ourselves if * IRELE() so that we don't trip over ourselves if
* we have to go for the mount lock again in the * we have to go for the mount lock again in the
* inactive code. * inactive code.
*/ */
...@@ -1167,7 +1168,7 @@ xfs_sync_inodes( ...@@ -1167,7 +1168,7 @@ xfs_sync_inodes(
IPOINTER_INSERT(ip, mp); IPOINTER_INSERT(ip, mp);
} }
VN_RELE(vp); IRELE(ip);
vnode_refed = B_FALSE; vnode_refed = B_FALSE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment