summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-03-29 21:11:37 +0300
committerDarrick J. Wong <djwong@kernel.org>2021-04-08 00:37:02 +0300
commitaf9dcddef662e1437a63c2decb6e1e2efb7d81ea (patch)
treecfcf657f88f6bdbe4926b8801aeca8cbd058d24a /fs/xfs/xfs_inode.c
parente773f88029b179ea03855c22d5052e2e90362a81 (diff)
downloadlinux-af9dcddef662e1437a63c2decb6e1e2efb7d81ea.tar.xz
xfs: split xfs_imap_to_bp
Split looking up the dinode from xfs_imap_to_bp, which can be significantly simplified as a result. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index c09bb39baeea..8983ef05dc66 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2075,9 +2075,10 @@ xfs_iunlink_update_inode(
ASSERT(xfs_verify_agino_or_null(mp, agno, next_agino));
- error = xfs_imap_to_bp(mp, tp, &ip->i_imap, &dip, &ibp, 0);
+ error = xfs_imap_to_bp(mp, tp, &ip->i_imap, &ibp);
if (error)
return error;
+ dip = xfs_buf_offset(ibp, ip->i_imap.im_boffset);
/* Make sure the old pointer isn't garbage. */
old_value = be32_to_cpu(dip->di_next_unlinked);
@@ -2202,13 +2203,14 @@ xfs_iunlink_map_ino(
return error;
}
- error = xfs_imap_to_bp(mp, tp, imap, dipp, bpp, 0);
+ error = xfs_imap_to_bp(mp, tp, imap, bpp);
if (error) {
xfs_warn(mp, "%s: xfs_imap_to_bp returned error %d.",
__func__, error);
return error;
}
+ *dipp = xfs_buf_offset(*bpp, imap->im_boffset);
return 0;
}