summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-05-15 16:50:26 +0300
committerCarlos Maiolino <cem@kernel.org>2026-06-09 10:14:41 +0300
commitf882fc7dd9f04f73d94379deb9e68d8db613c976 (patch)
tree70900676863486332e5b4a9ff71d784e3a1d9316
parentee237a900ceef00c8d1ca17a5cfadbd50fba67e9 (diff)
downloadlinux-f882fc7dd9f04f73d94379deb9e68d8db613c976.tar.xz
xfs: add a xfs_rmap_inode_owner helper
Add a small wrapper for initializing the rmap owner to i_ino. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c2
-rw-r--r--fs/xfs/libxfs/xfs_rmap.h2
-rw-r--r--fs/xfs/scrub/bmap.c6
-rw-r--r--fs/xfs/scrub/reap.c3
4 files changed, 7 insertions, 6 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 066d13e97ec9..9920e2df62b0 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -819,7 +819,7 @@ xfs_bmap_local_to_extents(
args.mp = ip->i_mount;
args.total = total;
args.minlen = args.maxlen = args.prod = 1;
- xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0);
+ xfs_rmap_inode_owner(&args.oinfo, ip, whichfork, 0);
/*
* Allocate a block. We know we need only one, since the
diff --git a/fs/xfs/libxfs/xfs_rmap.h b/fs/xfs/libxfs/xfs_rmap.h
index 7188459f61cf..6016fd5fcad9 100644
--- a/fs/xfs/libxfs/xfs_rmap.h
+++ b/fs/xfs/libxfs/xfs_rmap.h
@@ -37,6 +37,8 @@ xfs_rmap_ino_owner(
if (whichfork == XFS_ATTR_FORK)
oi->oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
}
+#define xfs_rmap_inode_owner(oi, ip, whichfork, offset) \
+ xfs_rmap_ino_owner(oi, (ip)->i_ino, whichfork, offset)
static inline bool
xfs_rmap_should_skip_owner_update(
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index 2ad223f0bc8a..67861102cdb9 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -352,7 +352,7 @@ xchk_bmap_rt_iextent_xref(
case XFS_DATA_FORK:
xchk_bmap_xref_rmap(info, irec, rgbno);
if (!xfs_is_reflink_inode(info->sc->ip)) {
- xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
+ xfs_rmap_inode_owner(&oinfo, info->sc->ip,
info->whichfork, irec->br_startoff);
xchk_xref_is_only_rt_owned_by(info->sc, rgbno,
irec->br_blockcount, &oinfo);
@@ -407,7 +407,7 @@ xchk_bmap_iextent_xref(
case XFS_DATA_FORK:
xchk_bmap_xref_rmap(info, irec, agbno);
if (!xfs_is_reflink_inode(info->sc->ip)) {
- xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
+ xfs_rmap_inode_owner(&oinfo, info->sc->ip,
info->whichfork, irec->br_startoff);
xchk_xref_is_only_owned_by(info->sc, agbno,
irec->br_blockcount, &oinfo);
@@ -419,7 +419,7 @@ xchk_bmap_iextent_xref(
break;
case XFS_ATTR_FORK:
xchk_bmap_xref_rmap(info, irec, agbno);
- xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
+ xfs_rmap_inode_owner(&oinfo, info->sc->ip,
info->whichfork, irec->br_startoff);
xchk_xref_is_only_owned_by(info->sc, agbno, irec->br_blockcount,
&oinfo);
diff --git a/fs/xfs/scrub/reap.c b/fs/xfs/scrub/reap.c
index cd90ecae3ffb..fcd14c1703ea 100644
--- a/fs/xfs/scrub/reap.c
+++ b/fs/xfs/scrub/reap.c
@@ -1249,8 +1249,7 @@ xreap_bmapi_select(
cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, sc->sa.agf_bp,
sc->sa.pag);
- xfs_rmap_ino_owner(&oinfo, rs->ip->i_ino, rs->whichfork,
- imap->br_startoff);
+ xfs_rmap_inode_owner(&oinfo, rs->ip, rs->whichfork, imap->br_startoff);
error = xfs_rmap_has_other_keys(cur, agbno, 1, &oinfo, crosslinked);
if (error)
goto out_cur;