From: Christoph Hellwig <hch@lst.de>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: "Darrick J . Wong" <djwong@kernel.org>, linux-xfs@vger.kernel.org
Subject: [PATCH 03/10] libxfs: remove buftarg member aliases
Date: Fri, 25 Sep 2026 07:12:49 +0200 [thread overview]
Message-ID: <20260925051336.2997014-4-hch@lst.de> (raw)
In-Reply-To: <20260925051336.2997014-1-hch@lst.de>
Remove the #defines giving historic IRIX names to the ddev/logdev/rtdev
buftargs in struct xfs_mount and use the current kernel names everywhere.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
---
libxfs/init.c | 12 ++++++------
libxfs/stubs/xfs_mount.h | 3 ---
libxfs/trans.c | 4 ++--
libxfs/util.c | 2 +-
mkfs/xfs_mkfs.c | 4 ++--
repair/attr_repair.c | 11 ++++++-----
repair/da_util.c | 2 +-
repair/dino_chunks.c | 8 ++++----
repair/dinode.c | 8 ++++----
repair/phase3.c | 2 +-
repair/phase5.c | 6 +++---
repair/prefetch.c | 4 ++--
repair/quotacheck.c | 2 +-
repair/rt.c | 2 +-
repair/scan.c | 16 +++++++++-------
15 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/libxfs/init.c b/libxfs/init.c
index 1b5e1e1e8ba8..1613ce2d14a3 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -330,7 +330,7 @@ rtmount_init(
(unsigned long long) mp->m_sb.sb_rblocks);
return -1;
}
- error = libxfs_buf_read(mp->m_rtdev, d - XFS_FSB_TO_BB(mp, 1),
+ error = libxfs_buf_read(mp->m_rtdev_targp, d - XFS_FSB_TO_BB(mp, 1),
XFS_FSB_TO_BB(mp, 1), 0, &bp, NULL);
if (error) {
fprintf(stderr, _("%s: realtime size check failed\n"),
@@ -687,7 +687,7 @@ check_many_rtgroups(
xfs_daddr_t d;
int error;
- if (!mp->m_rtdev->bt_bdev) {
+ if (!mp->m_rtdev_targp->bt_bdev) {
fprintf(stderr, _("%s: no rt device, ignoring rgcount %u\n"),
progname, sbp->sb_rgcount);
if (!xfs_is_debugger(mp))
@@ -698,8 +698,8 @@ check_many_rtgroups(
}
d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks);
- error = libxfs_buf_read(mp->m_rtdev, d - XFS_FSB_TO_BB(mp, 1), 1, 0,
- &bp, NULL);
+ error = libxfs_buf_read(mp->m_rtdev_targp, d - XFS_FSB_TO_BB(mp, 1), 1,
+ 0, &bp, NULL);
if (!error) {
libxfs_buf_relse(bp);
return true;
@@ -815,7 +815,7 @@ libxfs_mount(
return mp;
/* device size checks must pass unless we're a debugger. */
- error = libxfs_buf_read(mp->m_dev, d - XFS_FSS_TO_BB(mp, 1),
+ error = libxfs_buf_read(mp->m_ddev_targp, d - XFS_FSS_TO_BB(mp, 1),
XFS_FSS_TO_BB(mp, 1), 0, &bp, NULL);
if (error) {
fprintf(stderr, _("%s: data size check failed\n"), progname);
@@ -857,7 +857,7 @@ libxfs_mount(
* read the first one and let the user know to check the geometry.
*/
if (sbp->sb_agcount > 1000000) {
- error = libxfs_buf_read(mp->m_dev,
+ error = libxfs_buf_read(mp->m_ddev_targp,
XFS_AG_DADDR(mp, sbp->sb_agcount - 1, 0), 1,
0, &bp, NULL);
if (error) {
diff --git a/libxfs/stubs/xfs_mount.h b/libxfs/stubs/xfs_mount.h
index 5a714333c16e..0dea578ee3a5 100644
--- a/libxfs/stubs/xfs_mount.h
+++ b/libxfs/stubs/xfs_mount.h
@@ -102,9 +102,6 @@ typedef struct xfs_mount {
struct xfs_buftarg *m_ddev_targp;
struct xfs_buftarg *m_logdev_targp;
struct xfs_buftarg *m_rtdev_targp;
-#define m_dev m_ddev_targp
-#define m_logdev m_logdev_targp
-#define m_rtdev m_rtdev_targp
uint8_t m_dircook_elog; /* log d-cookie entry bits */
uint8_t m_blkbit_log; /* blocklog + NBBY */
uint8_t m_blkbb_log; /* blocklog - BBSHIFT */
diff --git a/libxfs/trans.c b/libxfs/trans.c
index c89b035ffeaf..88022c2fc9c2 100644
--- a/libxfs/trans.c
+++ b/libxfs/trans.c
@@ -500,7 +500,7 @@ libxfs_trans_getsb(
if (tp == NULL)
return libxfs_getsb(mp);
- bp = xfs_trans_buf_item_match(tp, mp->m_dev, &map, 1);
+ bp = xfs_trans_buf_item_match(tp, mp->m_ddev_targp, &map, 1);
if (bp != NULL) {
ASSERT(bp->b_transp == tp);
bip = bp->b_log_item;
@@ -529,7 +529,7 @@ libxfs_trans_getrtsb(
int len = XFS_FSS_TO_BB(mp, 1);
DEFINE_SINGLE_BUF_MAP(map, XFS_SB_DADDR, len);
- bp = xfs_trans_buf_item_match(tp, mp->m_rtdev, &map, 1);
+ bp = xfs_trans_buf_item_match(tp, mp->m_rtdev_targp, &map, 1);
if (bp != NULL) {
ASSERT(bp->b_transp == tp);
bip = bp->b_log_item;
diff --git a/libxfs/util.c b/libxfs/util.c
index 6cbbe9056eba..fae8fce484b7 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -527,7 +527,7 @@ libxfs_file_write(
map.br_state == XFS_EXT_UNWRITTEN)
return -EINVAL;
- error = libxfs_buf_get(mp->m_dev,
+ error = libxfs_buf_get(mp->m_ddev_targp,
XFS_FSB_TO_DADDR(mp, map.br_startblock),
XFS_FSB_TO_BB(mp, map.br_blockcount),
&bp);
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 334367b81555..3ce49a36eaa8 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -5723,7 +5723,7 @@ rewrite_secondary_superblocks(
int error;
/* rewrite the last superblock */
- error = -libxfs_buf_read(mp->m_dev,
+ error = -libxfs_buf_read(mp->m_ddev_targp,
XFS_AGB_TO_DADDR(mp, mp->m_sb.sb_agcount - 1,
XFS_SB_DADDR),
XFS_FSS_TO_BB(mp, 1), 0, &buf, &xfs_sb_buf_ops);
@@ -5743,7 +5743,7 @@ rewrite_secondary_superblocks(
if (mp->m_sb.sb_agcount <= 2)
return;
- error = -libxfs_buf_read(mp->m_dev,
+ error = -libxfs_buf_read(mp->m_ddev_targp,
XFS_AGB_TO_DADDR(mp, (mp->m_sb.sb_agcount - 1) / 2,
XFS_SB_DADDR),
XFS_FSS_TO_BB(mp, 1), 0, &buf, &xfs_sb_buf_ops);
diff --git a/repair/attr_repair.c b/repair/attr_repair.c
index fe4089026cae..982dc838ee55 100644
--- a/repair/attr_repair.c
+++ b/repair/attr_repair.c
@@ -443,9 +443,10 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap,
clearit = 1;
break;
}
- error = -libxfs_buf_read(mp->m_dev, XFS_FSB_TO_DADDR(mp, bno),
- XFS_FSB_TO_BB(mp, 1), LIBXFS_READBUF_SALVAGE,
- &bp, &xfs_attr3_rmt_buf_ops);
+ error = -libxfs_buf_read(mp->m_ddev_targp,
+ XFS_FSB_TO_DADDR(mp, bno), XFS_FSB_TO_BB(mp, 1),
+ LIBXFS_READBUF_SALVAGE, &bp,
+ &xfs_attr3_rmt_buf_ops);
if (error) {
do_warn(
_("can't read remote block for attributes of inode %" PRIu64 "\n"), ino);
@@ -879,7 +880,7 @@ process_leaf_attr_level(xfs_mount_t *mp,
goto error_out;
}
- error = -libxfs_buf_read(mp->m_dev,
+ error = -libxfs_buf_read(mp->m_ddev_targp,
XFS_FSB_TO_DADDR(mp, dev_bno),
XFS_FSB_TO_BB(mp, 1), LIBXFS_READBUF_SALVAGE,
&bp, &xfs_attr3_leaf_buf_ops);
@@ -1217,7 +1218,7 @@ process_longform_attr(
return 1;
}
- error = -libxfs_buf_read(mp->m_dev, XFS_FSB_TO_DADDR(mp, bno),
+ error = -libxfs_buf_read(mp->m_ddev_targp, XFS_FSB_TO_DADDR(mp, bno),
XFS_FSB_TO_BB(mp, 1), LIBXFS_READBUF_SALVAGE, &bp,
&xfs_da3_node_buf_ops);
if (error) {
diff --git a/repair/da_util.c b/repair/da_util.c
index 7f94f4012062..c0625b312fc6 100644
--- a/repair/da_util.c
+++ b/repair/da_util.c
@@ -64,7 +64,7 @@ da_read_buf(
map[i].bm_bn = XFS_FSB_TO_DADDR(mp, bmp[i].startblock);
map[i].bm_len = XFS_FSB_TO_BB(mp, bmp[i].blockcount);
}
- libxfs_buf_read_map(mp->m_dev, map, nex, LIBXFS_READBUF_SALVAGE,
+ libxfs_buf_read_map(mp->m_ddev_targp, map, nex, LIBXFS_READBUF_SALVAGE,
&bp, ops);
if (map != map_array)
free(map);
diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c
index 932eaf63f474..6b261a1e99bf 100644
--- a/repair/dino_chunks.c
+++ b/repair/dino_chunks.c
@@ -43,9 +43,9 @@ check_aginode_block(
* tree and we wouldn't be here and we stale the buffers out
* so no one else will overlap them.
*/
- error = -libxfs_buf_read(mp->m_dev, XFS_AGB_TO_DADDR(mp, agno, agbno),
- XFS_FSB_TO_BB(mp, 1), LIBXFS_READBUF_SALVAGE, &bp,
- NULL);
+ error = -libxfs_buf_read(mp->m_ddev_targp,
+ XFS_AGB_TO_DADDR(mp, agno, agbno), XFS_FSB_TO_BB(mp, 1),
+ LIBXFS_READBUF_SALVAGE, &bp, NULL);
if (error) {
do_warn(_("cannot read agbno (%u/%u), disk block %" PRId64 "\n"),
agno, agbno, XFS_AGB_TO_DADDR(mp, agno, agbno));
@@ -699,7 +699,7 @@ process_inode_chunk(
pftrace("about to read off %llu in AG %d",
XFS_AGB_TO_DADDR(mp, agno, agbno), agno);
- error = -libxfs_buf_read(mp->m_dev,
+ error = -libxfs_buf_read(mp->m_ddev_targp,
XFS_AGB_TO_DADDR(mp, agno, agbno),
XFS_FSB_TO_BB(mp,
M_IGEO(mp)->blocks_per_cluster),
diff --git a/repair/dinode.c b/repair/dinode.c
index 48939f8bd159..243fcf7a19f4 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -956,8 +956,8 @@ get_agino_buf(
cluster_agino, cluster_daddr, cluster_blks);
#endif
- error = -libxfs_buf_read(mp->m_dev, cluster_daddr, cluster_blks, 0,
- &bp, &xfs_inode_buf_ops);
+ error = -libxfs_buf_read(mp->m_ddev_targp, cluster_daddr, cluster_blks,
+ 0, &bp, &xfs_inode_buf_ops);
if (error) {
do_warn(_("cannot read inode (%u/%u), disk block %" PRIu64 "\n"),
agno, cluster_agino, cluster_daddr);
@@ -1733,7 +1733,7 @@ process_quota_inode(
fsbno = blkmap_get(blkmap, qbno);
dqid = (xfs_dqid_t)qbno * dqperchunk;
- error = -libxfs_buf_read(mp->m_dev,
+ error = -libxfs_buf_read(mp->m_ddev_targp,
XFS_FSB_TO_DADDR(mp, fsbno), dqchunklen,
LIBXFS_READBUF_SALVAGE, &bp,
&xfs_dquot_buf_ops);
@@ -1845,7 +1845,7 @@ _("cannot read inode %" PRIu64 ", file block %d, NULL disk block\n"),
byte_cnt = XFS_FSB_TO_B(mp, blk_cnt);
- error = -libxfs_buf_read(mp->m_dev,
+ error = -libxfs_buf_read(mp->m_ddev_targp,
XFS_FSB_TO_DADDR(mp, fsbno), BTOBB(byte_cnt),
LIBXFS_READBUF_SALVAGE, &bp,
&xfs_symlink_buf_ops);
diff --git a/repair/phase3.c b/repair/phase3.c
index 6ec616d9b31d..64a2c961b080 100644
--- a/repair/phase3.c
+++ b/repair/phase3.c
@@ -30,7 +30,7 @@ process_agi_unlinked(
int agi_dirty = 0;
int error;
- error = -libxfs_buf_read(mp->m_dev,
+ error = -libxfs_buf_read(mp->m_ddev_targp,
XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)),
mp->m_sb.sb_sectsize / BBSIZE, LIBXFS_READBUF_SALVAGE,
&bp, &xfs_agi_buf_ops);
diff --git a/repair/phase5.c b/repair/phase5.c
index e44c26885717..019772346eb1 100644
--- a/repair/phase5.c
+++ b/repair/phase5.c
@@ -135,7 +135,7 @@ build_agi(
int i;
int error;
- error = -libxfs_buf_get(mp->m_dev,
+ error = -libxfs_buf_get(mp->m_ddev_targp,
XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)),
mp->m_sb.sb_sectsize / BBSIZE, &agi_buf);
if (error)
@@ -228,7 +228,7 @@ build_agf_agfl(
__be32 *freelist;
int error;
- error = -libxfs_buf_get(mp->m_dev,
+ error = -libxfs_buf_get(mp->m_ddev_targp,
XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)),
mp->m_sb.sb_sectsize / BBSIZE, &agf_buf);
if (error)
@@ -314,7 +314,7 @@ build_agf_agfl(
platform_uuid_copy(&agf->agf_uuid, &mp->m_sb.sb_meta_uuid);
/* initialise the AGFL, then fill it if there are blocks left over. */
- error = -libxfs_buf_get(mp->m_dev,
+ error = -libxfs_buf_get(mp->m_ddev_targp,
XFS_AG_DADDR(mp, agno, XFS_AGFL_DADDR(mp)),
mp->m_sb.sb_sectsize / BBSIZE, &agfl_buf);
if (error)
diff --git a/repair/prefetch.c b/repair/prefetch.c
index 8cd3416fa568..3d26636e5e56 100644
--- a/repair/prefetch.c
+++ b/repair/prefetch.c
@@ -121,7 +121,7 @@ pf_queue_io(
* the lock holder is either reading it from disk himself or
* completely overwriting it this behaviour is perfectly fine.
*/
- error = -libxfs_buf_get_map(mp->m_dev, map, nmaps,
+ error = -libxfs_buf_get_map(mp->m_ddev_targp, map, nmaps,
LIBXFS_GETBUF_TRYLOCK, &bp);
if (error)
return;
@@ -275,7 +275,7 @@ pf_scan_lbtree(
int rc;
int error;
- error = -libxfs_buf_read(mp->m_dev, XFS_FSB_TO_DADDR(mp, dbno),
+ error = -libxfs_buf_read(mp->m_ddev_targp, XFS_FSB_TO_DADDR(mp, dbno),
XFS_FSB_TO_BB(mp, 1), LIBXFS_READBUF_SALVAGE, &bp,
&xfs_bmbt_buf_ops);
if (error)
diff --git a/repair/quotacheck.c b/repair/quotacheck.c
index fc7e3864654c..e13092dfcae8 100644
--- a/repair/quotacheck.c
+++ b/repair/quotacheck.c
@@ -369,7 +369,7 @@ qc_walk_dquot_extent(
unsigned int dqnr;
uint64_t dqid;
- error = -libxfs_buf_read(mp->m_dev,
+ error = -libxfs_buf_read(mp->m_ddev_targp,
XFS_FSB_TO_DADDR(mp, map->br_startblock + bno),
dqchunklen, 0, &bp, &xfs_dquot_buf_ops);
if (error) {
diff --git a/repair/rt.c b/repair/rt.c
index 3e51c9b5eb4b..b5b9d4fdc536 100644
--- a/repair/rt.c
+++ b/repair/rt.c
@@ -255,7 +255,7 @@ check_rtfile_contents(
break;
}
- error = -libxfs_buf_read_uncached(mp->m_dev,
+ error = -libxfs_buf_read_uncached(mp->m_ddev_targp,
XFS_FSB_TO_DADDR(mp, map.br_startblock),
XFS_FSB_TO_BB(mp, 1), 0, &bp,
xfs_rtblock_ops(mp, type));
diff --git a/repair/scan.c b/repair/scan.c
index 7d22ff378484..865983d6c9e0 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -102,8 +102,9 @@ scan_sbtree(
struct xfs_buf *bp;
int error;
- error = salvage_buffer(mp->m_dev, XFS_AGB_TO_DADDR(mp, agno, root),
- XFS_FSB_TO_BB(mp, 1), &bp, ops);
+ error = salvage_buffer(mp->m_ddev_targp,
+ XFS_AGB_TO_DADDR(mp, agno, root),XFS_FSB_TO_BB(mp, 1),
+ &bp, ops);
if (error) {
do_error(_("can't read btree block %d/%d\n"), agno, root);
return;
@@ -161,7 +162,7 @@ scan_lbtree(
int dirty = 0;
bool badcrc = false;
- err = salvage_buffer(mp->m_dev, XFS_FSB_TO_DADDR(mp, root),
+ err = salvage_buffer(mp->m_ddev_targp, XFS_FSB_TO_DADDR(mp, root),
XFS_FSB_TO_BB(mp, 1), &bp, ops);
if (err) {
do_error(_("can't read btree block %d/%d\n"),
@@ -3030,7 +3031,7 @@ scan_freelist(
if (be32_to_cpu(agf->agf_flcount) == 0)
return;
- error = salvage_buffer(mp->m_dev,
+ error = salvage_buffer(mp->m_ddev_targp,
XFS_AG_DADDR(mp, agno, XFS_AGFL_DADDR(mp)),
XFS_FSS_TO_BB(mp, 1), &agflbuf, &xfs_agfl_buf_ops);
if (error) {
@@ -3312,7 +3313,8 @@ scan_ag(
return;
}
- error = salvage_buffer(mp->m_dev, XFS_AG_DADDR(mp, agno, XFS_SB_DADDR),
+ error = salvage_buffer(mp->m_ddev_targp,
+ XFS_AG_DADDR(mp, agno, XFS_SB_DADDR),
XFS_FSS_TO_BB(mp, 1), &sbbuf, &xfs_sb_buf_ops);
if (error) {
objname = _("root superblock");
@@ -3322,7 +3324,7 @@ scan_ag(
do_warn(_("superblock has bad CRC for ag %d\n"), agno);
libxfs_sb_from_disk(sb, sbbuf->b_addr);
- error = salvage_buffer(mp->m_dev,
+ error = salvage_buffer(mp->m_ddev_targp,
XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)),
XFS_FSS_TO_BB(mp, 1), &agfbuf, &xfs_agf_buf_ops);
if (error) {
@@ -3333,7 +3335,7 @@ scan_ag(
do_warn(_("agf has bad CRC for ag %d\n"), agno);
agf = agfbuf->b_addr;
- error = salvage_buffer(mp->m_dev,
+ error = salvage_buffer(mp->m_ddev_targp,
XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)),
XFS_FSS_TO_BB(mp, 1), &agibuf, &xfs_agi_buf_ops);
if (error) {
--
2.53.0
next prev parent reply other threads:[~2026-09-25 5:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 5:12 fix missing RT detection in libxfs v2 Christoph Hellwig
2026-09-25 5:12 ` [PATCH 01/10] libxfs: refactor the reinit case in libxfs_buftarg_init Christoph Hellwig
2026-09-25 22:32 ` Darrick J. Wong
2026-09-25 5:12 ` [PATCH 02/10] libxfs: split error injection option parsing out of libxfs_buftarg_init Christoph Hellwig
2026-09-25 22:33 ` Darrick J. Wong
2026-09-25 5:12 ` Christoph Hellwig [this message]
2026-09-25 5:12 ` [PATCH 04/10] libxfs: unify buftarg handling with the kernel Christoph Hellwig
2026-09-25 22:37 ` Darrick J. Wong
2026-09-26 5:59 ` Christoph Hellwig
2026-09-27 15:18 ` Darrick J. Wong
2026-09-25 5:12 ` [PATCH 05/10] libxfs: make the size check in rtmount_init internal RT device aware Christoph Hellwig
2026-09-25 22:38 ` Darrick J. Wong
2026-09-25 5:12 ` [PATCH 06/10] libxfs: don't clear ->dev in libxfs_device_close Christoph Hellwig
2026-09-25 22:39 ` Darrick J. Wong
2026-09-25 5:12 ` [PATCH 07/10] libxfs: fix buftarg initialization for the RT device Christoph Hellwig
2026-09-25 22:42 ` Darrick J. Wong
2026-09-25 5:12 ` [PATCH 08/10] libxfs: rename bt_bdev* Christoph Hellwig
2026-09-25 22:43 ` Darrick J. Wong
2026-09-25 5:12 ` [PATCH 09/10] libfrog: improve ramdisk handling in platform_flush_device Christoph Hellwig
2026-09-25 22:47 ` Darrick J. Wong
2026-09-26 6:02 ` Christoph Hellwig
2026-09-27 15:22 ` Darrick J. Wong
2026-09-25 5:12 ` [PATCH 10/10] xfs_db: remove a double-whitespace in rdump_regfile_data Christoph Hellwig
2026-09-25 22:47 ` 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=20260925051336.2997014-4-hch@lst.de \
--to=hch@lst.de \
--cc=aalbersh@kernel.org \
--cc=djwong@kernel.org \
--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