]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: report the realtime device when associated with each io cursor
authorDarrick J. Wong <djwong@kernel.org>
Tue, 29 Oct 2024 00:03:31 +0000 (17:03 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 31 Oct 2024 22:45:04 +0000 (15:45 -0700)
When db is reporting on an io cursor and the cursor points to the
realtime device, print that fact.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
db/block.c
db/io.c
db/io.h

index 22930e5a287e8f9148d15c7efe8420470456c18d..bd25cdbe193f4f1fd8211d56785612ea2ed4c773 100644 (file)
@@ -133,6 +133,8 @@ daddr_f(
                        dbprintf(_("datadev daddr is %lld\n"), daddr);
                else if (iocur_is_extlogdev(iocur_top))
                        dbprintf(_("logdev daddr is %lld\n"), daddr);
+               else if (iocur_is_rtdev(iocur_top))
+                       dbprintf(_("rtdev daddr is %lld\n"), daddr);
                else
                        dbprintf(_("current daddr is %lld\n"), daddr);
 
diff --git a/db/io.c b/db/io.c
index 26b8e78c2ebda8df8254a7530ce260fe152c8bf7..3841c0dcb86eada13e33c8f937784f045cacef69 100644 (file)
--- a/db/io.c
+++ b/db/io.c
@@ -159,6 +159,15 @@ iocur_is_extlogdev(const struct iocur *ioc)
        return bp->b_target == bp->b_mount->m_logdev_targp;
 }
 
+bool
+iocur_is_rtdev(const struct iocur *ioc)
+{
+       if (!ioc->bp)
+               return false;
+
+       return ioc->bp->b_target == ioc->bp->b_mount->m_rtdev_targp;
+}
+
 void
 print_iocur(
        char    *tag,
@@ -171,6 +180,8 @@ print_iocur(
                block_unit = "fsbno";
        else if (iocur_is_extlogdev(ioc))
                block_unit = "logbno";
+       else if (iocur_is_rtdev(ioc))
+               block_unit = "rtbno";
 
        dbprintf("%s\n", tag);
        dbprintf(_("\tbyte offset %lld, length %d\n"), ioc->off, ioc->len);
diff --git a/db/io.h b/db/io.h
index cece66a1cf825ab093061d500155f12b00a2e8af..653724e90bd2708e8f77cf87d20c7e5a00ebd3b2 100644 (file)
--- a/db/io.h
+++ b/db/io.h
@@ -60,6 +60,7 @@ extern void   xfs_verify_recalc_crc(struct xfs_buf *bp);
 
 bool iocur_is_ddev(const struct iocur *ioc);
 bool iocur_is_extlogdev(const struct iocur *ioc);
+bool iocur_is_rtdev(const struct iocur *ioc);
 
 /*
  * returns -1 for unchecked, 0 for bad and 1 for good