From: Dave Chinner <david@fromorbit.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 6/9] xfs: clean up xfs_iunlink_update_inode()
Date: Fri, 8 Jul 2022 09:43:42 +1000 [thread overview]
Message-ID: <20220707234345.1097095-7-david@fromorbit.com> (raw)
In-Reply-To: <20220707234345.1097095-1-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
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: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
---
fs/xfs/xfs_inode.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 55fe1321160a..208f71240173 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1935,13 +1935,12 @@ xfs_iunlink_update_dinode(
}
/* Set an in-core inode's unlinked pointer and return the old value. */
-STATIC int
+static int
xfs_iunlink_update_inode(
struct xfs_trans *tp,
struct xfs_inode *ip,
struct xfs_perag *pag,
- xfs_agino_t next_agino,
- xfs_agino_t *old_next_agino)
+ xfs_agino_t next_agino)
{
struct xfs_mount *mp = tp->t_mountp;
struct xfs_dinode *dip;
@@ -1971,8 +1970,6 @@ xfs_iunlink_update_inode(
* current pointer is the same as the new value, unless we're
* terminating the list.
*/
- if (old_next_agino)
- *old_next_agino = old_value;
if (old_value == next_agino) {
if (next_agino != NULLAGINO) {
xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__,
@@ -2026,17 +2023,13 @@ xfs_iunlink_insert_inode(
return error;
if (next_agino != NULLAGINO) {
- xfs_agino_t old_agino;
-
/*
* There is already another inode in the bucket, so point this
* inode to the current head of the list.
*/
- error = xfs_iunlink_update_inode(tp, ip, pag, next_agino,
- &old_agino);
+ error = xfs_iunlink_update_inode(tp, ip, pag, next_agino);
if (error)
return error;
- ASSERT(old_agino == NULLAGINO);
ip->i_next_unlinked = next_agino;
}
@@ -2088,7 +2081,6 @@ xfs_iunlink_remove_inode(
struct xfs_mount *mp = tp->t_mountp;
struct xfs_agi *agi = agibp->b_addr;
xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
- xfs_agino_t next_agino;
xfs_agino_t head_agino;
short bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS;
int error;
@@ -2111,7 +2103,7 @@ xfs_iunlink_remove_inode(
* 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.
*/
- error = xfs_iunlink_update_inode(tp, ip, pag, NULLAGINO, &next_agino);
+ error = xfs_iunlink_update_inode(tp, ip, pag, NULLAGINO);
if (error)
return error;
@@ -2132,7 +2124,7 @@ xfs_iunlink_remove_inode(
return -EFSCORRUPTED;
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;
} else {
/* Point the head of the list to the next unlinked inode. */
--
2.36.1
next prev parent reply other threads:[~2022-07-07 23:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 23:43 [PATCH 0/9 v4] xfs: introduce in-memory inode unlink log items Dave Chinner
2022-07-07 23:43 ` [PATCH 1/9] xfs: factor the xfs_iunlink functions Dave Chinner
2022-07-07 23:43 ` [PATCH 2/9] xfs: track the iunlink list pointer in the xfs_inode Dave Chinner
2022-07-11 5:17 ` Christoph Hellwig
2022-07-07 23:43 ` [PATCH 3/9] xfs: refactor xlog_recover_process_iunlinks() Dave Chinner
2022-07-12 1:54 ` Darrick J. Wong
2022-07-07 23:43 ` [PATCH 4/9] xfs: introduce xfs_iunlink_lookup Dave Chinner
2022-07-11 5:18 ` Christoph Hellwig
2022-07-12 2:14 ` Darrick J. Wong
2022-07-07 23:43 ` [PATCH 5/9] xfs: double link the unlinked inode list Dave Chinner
2022-07-11 5:21 ` Christoph Hellwig
2022-07-07 23:43 ` Dave Chinner [this message]
2022-07-07 23:43 ` [PATCH 7/9] xfs: combine iunlink inode update functions Dave Chinner
2022-07-07 23:43 ` [PATCH 8/9] xfs: add log item precommit operation Dave Chinner
2022-07-11 5:22 ` Christoph Hellwig
2022-07-07 23:43 ` [PATCH 9/9] xfs: add in-memory iunlink log item Dave Chinner
2022-07-11 5:24 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2022-06-27 0:43 [PATCH 0/9 v3] xfs: in-memory iunlink items Dave Chinner
2022-06-27 0:43 ` [PATCH 6/9] xfs: clean up xfs_iunlink_update_inode() Dave Chinner
2022-06-29 7:21 ` Christoph Hellwig
2022-06-29 21:07 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220707234345.1097095-7-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox