xfs: remove xfs_iput
xfs_iput is just a small wrapper for xfs_iunlock + IRELE. Having this out of line wrapper means the trace events in those two can't track their caller properly. So just remove the wrapper and opencode the unlock + rele in the few callers. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
parent
ef35e9255d
commit
f2d6761433
|
@ -1662,7 +1662,8 @@ xfs_qm_dqusage_adjust(
|
||||||
* making us disable quotas for the file system.
|
* making us disable quotas for the file system.
|
||||||
*/
|
*/
|
||||||
if ((error = xfs_qm_dqget_noattach(ip, &udqp, &gdqp))) {
|
if ((error = xfs_qm_dqget_noattach(ip, &udqp, &gdqp))) {
|
||||||
xfs_iput(ip, XFS_ILOCK_EXCL);
|
xfs_iunlock(ip, XFS_ILOCK_EXCL);
|
||||||
|
IRELE(ip);
|
||||||
*res = BULKSTAT_RV_GIVEUP;
|
*res = BULKSTAT_RV_GIVEUP;
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
@ -1675,7 +1676,8 @@ xfs_qm_dqusage_adjust(
|
||||||
* Walk thru the extent list and count the realtime blocks.
|
* Walk thru the extent list and count the realtime blocks.
|
||||||
*/
|
*/
|
||||||
if ((error = xfs_qm_get_rtblks(ip, &rtblks))) {
|
if ((error = xfs_qm_get_rtblks(ip, &rtblks))) {
|
||||||
xfs_iput(ip, XFS_ILOCK_EXCL);
|
xfs_iunlock(ip, XFS_ILOCK_EXCL);
|
||||||
|
IRELE(ip);
|
||||||
if (udqp)
|
if (udqp)
|
||||||
xfs_qm_dqput(udqp);
|
xfs_qm_dqput(udqp);
|
||||||
if (gdqp)
|
if (gdqp)
|
||||||
|
|
|
@ -865,8 +865,9 @@ xfs_dqrele_inode(
|
||||||
xfs_qm_dqrele(ip->i_gdquot);
|
xfs_qm_dqrele(ip->i_gdquot);
|
||||||
ip->i_gdquot = NULL;
|
ip->i_gdquot = NULL;
|
||||||
}
|
}
|
||||||
xfs_iput(ip, XFS_ILOCK_EXCL);
|
xfs_iunlock(ip, XFS_ILOCK_EXCL);
|
||||||
|
|
||||||
|
IRELE(ip);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1133,7 +1134,8 @@ xfs_qm_internalqcheck_adjust(
|
||||||
* of those now.
|
* of those now.
|
||||||
*/
|
*/
|
||||||
if (! ipreleased) {
|
if (! ipreleased) {
|
||||||
xfs_iput(ip, lock_flags);
|
xfs_iunlock(ip, lock_flags);
|
||||||
|
IRELE(ip);
|
||||||
ipreleased = B_TRUE;
|
ipreleased = B_TRUE;
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
|
@ -1150,7 +1152,8 @@ xfs_qm_internalqcheck_adjust(
|
||||||
ASSERT(gd);
|
ASSERT(gd);
|
||||||
xfs_qm_internalqcheck_dqadjust(ip, gd);
|
xfs_qm_internalqcheck_dqadjust(ip, gd);
|
||||||
}
|
}
|
||||||
xfs_iput(ip, lock_flags);
|
xfs_iunlock(ip, lock_flags);
|
||||||
|
IRELE(ip);
|
||||||
*res = BULKSTAT_RV_DIDONE;
|
*res = BULKSTAT_RV_DIDONE;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -417,23 +417,6 @@ out_error_or_again:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Decrement reference count of an inode structure and unlock it.
|
|
||||||
*
|
|
||||||
* ip -- the inode being released
|
|
||||||
* lock_flags -- this parameter indicates the inode's locks to be
|
|
||||||
* to be released. See the comment on xfs_iunlock() for a list
|
|
||||||
* of valid values.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
xfs_iput(xfs_inode_t *ip,
|
|
||||||
uint lock_flags)
|
|
||||||
{
|
|
||||||
xfs_itrace_entry(ip);
|
|
||||||
xfs_iunlock(ip, lock_flags);
|
|
||||||
IRELE(ip);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is called free all the memory associated with an inode.
|
* This is called free all the memory associated with an inode.
|
||||||
* It must free the inode itself and any buffers allocated for
|
* It must free the inode itself and any buffers allocated for
|
||||||
|
|
|
@ -443,7 +443,6 @@ static inline void xfs_ifunlock(xfs_inode_t *ip)
|
||||||
*/
|
*/
|
||||||
int xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
|
int xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
|
||||||
uint, uint, xfs_inode_t **);
|
uint, uint, xfs_inode_t **);
|
||||||
void xfs_iput(xfs_inode_t *, uint);
|
|
||||||
void xfs_ilock(xfs_inode_t *, uint);
|
void xfs_ilock(xfs_inode_t *, uint);
|
||||||
int xfs_ilock_nowait(xfs_inode_t *, uint);
|
int xfs_ilock_nowait(xfs_inode_t *, uint);
|
||||||
void xfs_iunlock(xfs_inode_t *, uint);
|
void xfs_iunlock(xfs_inode_t *, uint);
|
||||||
|
|
|
@ -660,8 +660,10 @@ xfs_inode_item_unlock(
|
||||||
|
|
||||||
lock_flags = iip->ili_lock_flags;
|
lock_flags = iip->ili_lock_flags;
|
||||||
iip->ili_lock_flags = 0;
|
iip->ili_lock_flags = 0;
|
||||||
if (lock_flags)
|
if (lock_flags) {
|
||||||
xfs_iput(iip->ili_inode, lock_flags);
|
xfs_iunlock(iip->ili_inode, lock_flags);
|
||||||
|
IRELE(iip->ili_inode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "xfs_itable.h"
|
#include "xfs_itable.h"
|
||||||
#include "xfs_error.h"
|
#include "xfs_error.h"
|
||||||
#include "xfs_btree.h"
|
#include "xfs_btree.h"
|
||||||
|
#include "xfs_trace.h"
|
||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_internal_inum(
|
xfs_internal_inum(
|
||||||
|
@ -139,7 +140,8 @@ xfs_bulkstat_one_int(
|
||||||
buf->bs_blocks = dic->di_nblocks + ip->i_delayed_blks;
|
buf->bs_blocks = dic->di_nblocks + ip->i_delayed_blks;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
xfs_iput(ip, XFS_ILOCK_SHARED);
|
xfs_iunlock(ip, XFS_ILOCK_SHARED);
|
||||||
|
IRELE(ip);
|
||||||
|
|
||||||
error = formatter(buffer, ubsize, ubused, buf);
|
error = formatter(buffer, ubsize, ubused, buf);
|
||||||
|
|
||||||
|
|
Reference in New Issue