From: Andrey Albershteyn <aalbersh@kernel.org>
To: linux-xfs@vger.kernel.org, aalbersh@kernel.org
Cc: bestswngs@gmail.com, brauner@kernel.org, cem@kernel.org,
chuck.lever@oracle.com, cmaiolino@redhat.com,
dawei.feng@seu.edu.cn, djwong@kernel.org,
gaoyingjie@uniontech.com, hch@lst.de, jiapenglin@tencent.com,
roland.mainz@nrubsig.org, xmei5@asu.edu
Subject: [PATCH v2 07/23] xfs: add a xfs_rmap_inode_bmbt_owner
Date: Thu, 3 Sep 2026 13:39:49 +0200 [thread overview]
Message-ID: <20260903114022.570210-8-aalbersh@kernel.org> (raw)
In-Reply-To: <20260903114022.570210-1-aalbersh@kernel.org>
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: ee237a900ceef00c8d1ca17a5cfadbd50fba67e9
Add a small wrapper for initializing the bmbt 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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
libxfs/xfs_bmap.c | 4 ++--
libxfs/xfs_bmap_btree.c | 4 ++--
libxfs/xfs_btree.c | 4 ++--
libxfs/xfs_rmap.h | 2 ++
repair/bmap_repair.c | 2 +-
repair/rtrefcount_repair.c | 2 +-
repair/rtrmap_repair.c | 2 +-
7 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index d211d31697a2..1bd65a0cba26 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -596,7 +596,7 @@ xfs_bmap_btree_to_extents(
if ((error = xfs_btree_check_block(cur, cblock, 0, cbp)))
return error;
- xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, ip, whichfork);
error = xfs_free_extent_later(cur->bc_tp, cbno, 1, &oinfo,
XFS_AG_RESV_NONE, 0);
if (error)
@@ -670,7 +670,7 @@ xfs_bmap_extents_to_btree(
memset(&args, 0, sizeof(args));
args.tp = tp;
args.mp = mp;
- xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork);
+ xfs_rmap_inode_bmbt_owner(&args.oinfo, ip, whichfork);
args.minlen = args.maxlen = args.prod = 1;
args.wasdel = wasdel;
diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c
index 6038c4567455..077b862ca6d2 100644
--- a/libxfs/xfs_bmap_btree.c
+++ b/libxfs/xfs_bmap_btree.c
@@ -216,7 +216,7 @@ xfs_bmbt_alloc_block(
memset(&args, 0, sizeof(args));
args.tp = cur->bc_tp;
args.mp = cur->bc_mp;
- xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_ino.ip->i_ino,
+ xfs_rmap_inode_bmbt_owner(&args.oinfo, cur->bc_ino.ip,
cur->bc_ino.whichfork);
args.minlen = args.maxlen = args.prod = 1;
args.wasdel = cur->bc_flags & XFS_BTREE_BMBT_WASDEL;
@@ -279,7 +279,7 @@ xfs_bmbt_free_block(
struct xfs_owner_info oinfo;
int error;
- xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, ip, cur->bc_ino.whichfork);
error = xfs_free_extent_later(cur->bc_tp, fsbno, 1, &oinfo,
XFS_AG_RESV_NONE, 0);
if (error)
diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index 0069fba162a8..c7db42a47860 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c
@@ -5604,7 +5604,7 @@ xfs_btree_alloc_metafile_block(
ASSERT(xfs_is_metadir_inode(ip));
- xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, cur->bc_ino.whichfork);
+ xfs_rmap_inode_bmbt_owner(&args.oinfo, ip, cur->bc_ino.whichfork);
error = xfs_alloc_vextent_start_ag(&args, XFS_INODE_TO_FSB(ip));
if (error)
return error;
@@ -5636,7 +5636,7 @@ xfs_btree_free_metafile_block(
ASSERT(xfs_is_metadir_inode(ip));
- xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, ip, cur->bc_ino.whichfork);
error = xfs_free_extent_later(tp, fsbno, 1, &oinfo, XFS_AG_RESV_METAFILE,
0);
if (error)
diff --git a/libxfs/xfs_rmap.h b/libxfs/xfs_rmap.h
index 5f39f6e53cd1..7188459f61cf 100644
--- a/libxfs/xfs_rmap.h
+++ b/libxfs/xfs_rmap.h
@@ -21,6 +21,8 @@ xfs_rmap_ino_bmbt_owner(
if (whichfork == XFS_ATTR_FORK)
oi->oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
}
+#define xfs_rmap_inode_bmbt_owner(oi, ip, whichfork) \
+ xfs_rmap_ino_bmbt_owner(oi, (ip)->i_ino, whichfork)
static inline void
xfs_rmap_ino_owner(
diff --git a/repair/bmap_repair.c b/repair/bmap_repair.c
index 192f189de052..335a35af5379 100644
--- a/repair/bmap_repair.c
+++ b/repair/bmap_repair.c
@@ -576,7 +576,7 @@ xrep_bmap_build_new_fork(
* Prepare to construct the new fork by initializing the new btree
* structure and creating a fake ifork in the ifakeroot structure.
*/
- libxfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, rb->whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, rb->whichfork);
bulkload_init_inode(&rb->new_fork_info, sc, rb->whichfork, &oinfo);
bmap_cur = libxfs_bmbt_init_cursor(sc->mp, NULL, sc->ip,
XFS_STAGING_FORK);
diff --git a/repair/rtrefcount_repair.c b/repair/rtrefcount_repair.c
index 228d080e5a5d..7906af17e893 100644
--- a/repair/rtrefcount_repair.c
+++ b/repair/rtrefcount_repair.c
@@ -173,7 +173,7 @@ xrep_rtrefc_build_new_tree(
* Prepare to construct the new fork by initializing the new btree
* structure and creating a fake ifork in the ifakeroot structure.
*/
- libxfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, XFS_DATA_FORK);
+ xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, XFS_DATA_FORK);
bulkload_init_inode(&rr->new_fork_info, sc, XFS_DATA_FORK, &oinfo);
cur = libxfs_rtrefcountbt_init_cursor(NULL, rr->rtg);
libxfs_btree_stage_ifakeroot(cur, ifake);
diff --git a/repair/rtrmap_repair.c b/repair/rtrmap_repair.c
index 955db1738fe2..136fafc01024 100644
--- a/repair/rtrmap_repair.c
+++ b/repair/rtrmap_repair.c
@@ -211,7 +211,7 @@ xrep_rtrmap_build_new_tree(
* Prepare to construct the new fork by initializing the new btree
* structure and creating a fake ifork in the ifakeroot structure.
*/
- libxfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, XFS_DATA_FORK);
+ xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, XFS_DATA_FORK);
bulkload_init_inode(&rr->new_fork_info, sc, XFS_DATA_FORK, &oinfo);
cur = libxfs_rtrmapbt_init_cursor(NULL, rr->rtg);
libxfs_btree_stage_ifakeroot(cur, ifake);
--
2.55.0
next prev parent reply other threads:[~2026-09-03 11:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 11:39 [PATCH v2 00/23] xfsprogs: libxfs sync for v7.2 Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 01/23] libxfs: convert diff_items helpers to cmp_int Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 02/23] xfs: Report case sensitivity in fileattr_get Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 03/23] xfs: fix exchmaps reservation limit check Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 04/23] xfs: add a XFS_INODE_TO_AGNO helper Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 05/23] xfs: add a XFS_INODE_TO_AGINO helper Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 06/23] xfs: add a XFS_INO_TO_FSB helper Andrey Albershteyn
2026-09-03 11:39 ` Andrey Albershteyn [this message]
2026-09-03 11:39 ` [PATCH v2 08/23] xfs: add a xfs_rmap_inode_owner helper Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 09/23] xfs: remove the i_ino field in struct xfs_inode Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 10/23] xfs: cleanup xfs_imap Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 11/23] xfs: remove im_len field in struct xfs_imap Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 12/23] xfs: massage xfs_imap_to_bp into xfs_read_icluster Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 13/23] xfs: store an agbno in struct xfs_imap Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 14/23] xfs: mark struct xfs_imap as __packed Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 15/23] xfs: fix pointer arithmetic error on 32-bit systems Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 16/23] xfs: pass back updated nb from xfs_growfs_compute_deltas Andrey Albershteyn
2026-09-03 11:39 ` [PATCH v2 17/23] xfs: cleanup xfs_growfs_compute_deltas Andrey Albershteyn
2026-09-03 11:40 ` [PATCH v2 18/23] xfs: move XFS_LSN_CMP to xfs_log_format.h Andrey Albershteyn
2026-09-03 11:40 ` [PATCH v2 19/23] xfs: fix memory leak in xfs_dqinode_metadir_create() Andrey Albershteyn
2026-09-03 11:40 ` [PATCH v2 20/23] xfs: fix null pointer dereference in tracepoint Andrey Albershteyn
2026-09-03 11:40 ` [PATCH v2 21/23] xfs: fix off-by-one in rtrefcount btree root level validation Andrey Albershteyn
2026-09-03 11:40 ` [PATCH v2 22/23] xfs: fix exchange-range reflink flag clearing issue with INO1_WRITTEN Andrey Albershteyn
2026-09-03 11:40 ` [PATCH v2 23/23] xfs: check v5 superblock features early Andrey Albershteyn
2026-09-07 5:52 ` [PATCH v2 00/23] xfsprogs: libxfs sync for v7.2 Christoph Hellwig
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=20260903114022.570210-8-aalbersh@kernel.org \
--to=aalbersh@kernel.org \
--cc=bestswngs@gmail.com \
--cc=brauner@kernel.org \
--cc=cem@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=cmaiolino@redhat.com \
--cc=dawei.feng@seu.edu.cn \
--cc=djwong@kernel.org \
--cc=gaoyingjie@uniontech.com \
--cc=hch@lst.de \
--cc=jiapenglin@tencent.com \
--cc=linux-xfs@vger.kernel.org \
--cc=roland.mainz@nrubsig.org \
--cc=xmei5@asu.edu \
/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