Commit 5301f870 authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner

xfs: clean up xfs_iunlink_update_inode()

We no longer need to have this function return the previous next
agino value from the on-disk inode as we have it in the in-core
inode now.
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent 2fd26cc0
...@@ -1935,13 +1935,12 @@ xfs_iunlink_update_dinode( ...@@ -1935,13 +1935,12 @@ xfs_iunlink_update_dinode(
} }
/* Set an in-core inode's unlinked pointer and return the old value. */ /* Set an in-core inode's unlinked pointer and return the old value. */
STATIC int static int
xfs_iunlink_update_inode( xfs_iunlink_update_inode(
struct xfs_trans *tp, struct xfs_trans *tp,
struct xfs_inode *ip, struct xfs_inode *ip,
struct xfs_perag *pag, struct xfs_perag *pag,
xfs_agino_t next_agino, xfs_agino_t next_agino)
xfs_agino_t *old_next_agino)
{ {
struct xfs_mount *mp = tp->t_mountp; struct xfs_mount *mp = tp->t_mountp;
struct xfs_dinode *dip; struct xfs_dinode *dip;
...@@ -1971,8 +1970,6 @@ xfs_iunlink_update_inode( ...@@ -1971,8 +1970,6 @@ xfs_iunlink_update_inode(
* current pointer is the same as the new value, unless we're * current pointer is the same as the new value, unless we're
* terminating the list. * terminating the list.
*/ */
if (old_next_agino)
*old_next_agino = old_value;
if (old_value == next_agino) { if (old_value == next_agino) {
if (next_agino != NULLAGINO) { if (next_agino != NULLAGINO) {
xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__,
...@@ -2026,17 +2023,13 @@ xfs_iunlink_insert_inode( ...@@ -2026,17 +2023,13 @@ xfs_iunlink_insert_inode(
return error; return error;
if (next_agino != NULLAGINO) { if (next_agino != NULLAGINO) {
xfs_agino_t old_agino;
/* /*
* There is already another inode in the bucket, so point this * There is already another inode in the bucket, so point this
* inode to the current head of the list. * inode to the current head of the list.
*/ */
error = xfs_iunlink_update_inode(tp, ip, pag, next_agino, error = xfs_iunlink_update_inode(tp, ip, pag, next_agino);
&old_agino);
if (error) if (error)
return error; return error;
ASSERT(old_agino == NULLAGINO);
ip->i_next_unlinked = next_agino; ip->i_next_unlinked = next_agino;
} }
...@@ -2088,7 +2081,6 @@ xfs_iunlink_remove_inode( ...@@ -2088,7 +2081,6 @@ xfs_iunlink_remove_inode(
struct xfs_mount *mp = tp->t_mountp; struct xfs_mount *mp = tp->t_mountp;
struct xfs_agi *agi = agibp->b_addr; struct xfs_agi *agi = agibp->b_addr;
xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino); xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
xfs_agino_t next_agino;
xfs_agino_t head_agino; xfs_agino_t head_agino;
short bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS; short bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS;
int error; int error;
...@@ -2111,7 +2103,7 @@ xfs_iunlink_remove_inode( ...@@ -2111,7 +2103,7 @@ xfs_iunlink_remove_inode(
* the old pointer value so that we can update whatever was previous * the old pointer value so that we can update whatever was previous
* to us in the list to point to whatever was next in the list. * to us in the list to point to whatever was next in the list.
*/ */
error = xfs_iunlink_update_inode(tp, ip, pag, NULLAGINO, &next_agino); error = xfs_iunlink_update_inode(tp, ip, pag, NULLAGINO);
if (error) if (error)
return error; return error;
...@@ -2132,7 +2124,7 @@ xfs_iunlink_remove_inode( ...@@ -2132,7 +2124,7 @@ xfs_iunlink_remove_inode(
return -EFSCORRUPTED; return -EFSCORRUPTED;
error = xfs_iunlink_update_inode(tp, prev_ip, pag, error = xfs_iunlink_update_inode(tp, prev_ip, pag,
ip->i_next_unlinked, NULL); ip->i_next_unlinked);
prev_ip->i_next_unlinked = ip->i_next_unlinked; prev_ip->i_next_unlinked = ip->i_next_unlinked;
} else { } else {
/* Point the head of the list to the next unlinked inode. */ /* Point the head of the list to the next unlinked inode. */
......
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