mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
use xfs_trans_ijoin in xfs_trans_iget
Use xfs_trans_ijoin in xfs_trans_iget in case we need to join an inode into a transaction instead of opencoding it. Based on a discussion with and an incomplete patch from Niv Sardi. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Niv Sardi <xaiki@sgi.com>
This commit is contained in:
parent
b56757becf
commit
070c4616ec
1 changed files with 1 additions and 29 deletions
|
@ -85,7 +85,6 @@ xfs_trans_iget(
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
xfs_inode_t *ip;
|
xfs_inode_t *ip;
|
||||||
xfs_inode_log_item_t *iip;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the transaction pointer is NULL, just call the normal
|
* If the transaction pointer is NULL, just call the normal
|
||||||
|
@ -138,34 +137,7 @@ xfs_trans_iget(
|
||||||
}
|
}
|
||||||
ASSERT(ip != NULL);
|
ASSERT(ip != NULL);
|
||||||
|
|
||||||
/*
|
xfs_trans_ijoin(tp, ip, lock_flags);
|
||||||
* Get a log_item_desc to point at the new item.
|
|
||||||
*/
|
|
||||||
if (ip->i_itemp == NULL)
|
|
||||||
xfs_inode_item_init(ip, mp);
|
|
||||||
iip = ip->i_itemp;
|
|
||||||
(void) xfs_trans_add_item(tp, (xfs_log_item_t *)(iip));
|
|
||||||
|
|
||||||
xfs_trans_inode_broot_debug(ip);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the IO lock has been acquired, mark that in
|
|
||||||
* the inode log item so we'll know to unlock it
|
|
||||||
* when the transaction commits.
|
|
||||||
*/
|
|
||||||
ASSERT(iip->ili_flags == 0);
|
|
||||||
if (lock_flags & XFS_IOLOCK_EXCL) {
|
|
||||||
iip->ili_flags |= XFS_ILI_IOLOCKED_EXCL;
|
|
||||||
} else if (lock_flags & XFS_IOLOCK_SHARED) {
|
|
||||||
iip->ili_flags |= XFS_ILI_IOLOCKED_SHARED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Initialize i_transp so we can find it with xfs_inode_incore()
|
|
||||||
* above.
|
|
||||||
*/
|
|
||||||
ip->i_transp = tp;
|
|
||||||
|
|
||||||
*ipp = ip;
|
*ipp = ip;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue