]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: add a xfs_rmap_inode_owner helper
authorChristoph Hellwig <hch@lst.de>
Fri, 15 May 2026 13:50:26 +0000 (15:50 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 9 Jun 2026 07:14:41 +0000 (09:14 +0200)
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>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_rmap.h
fs/xfs/scrub/bmap.c
fs/xfs/scrub/reap.c

index 066d13e97ec94e4039d6ffa6655dbf37c1ee003e..9920e2df62b0ad9fde5367a4917ea5efb729ee05 100644 (file)
@@ -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
index 7188459f61cf3e9665318e50fa250a06981372b4..6016fd5fcad98fc8aafe3b5af6e8fc236041b702 100644 (file)
@@ -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(
index 2ad223f0bc8ac21670d49a02f7d8921b2de3be0b..67861102cdb96622d41e84d866b2721bc49706fa 100644 (file)
@@ -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);
index cd90ecae3ffb9dff8bcfe8474ac7920c4fcfea06..fcd14c1703ea040c00be2d89ddee13074e3ba7cc 100644 (file)
@@ -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;