[PATCH 1/5] xfs_db: allow selecting logdev blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

Make it so that xfs_db can examine blocks on an external log device.

Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
---
 db/io.c |   18 ++++++++++++++++++
 db/io.h |    2 ++
 2 files changed, 20 insertions(+)


diff --git a/db/io.c b/db/io.c
index 00eb5e98dc2..8e3b32d9551 100644
--- a/db/io.c
+++ b/db/io.c
@@ -660,6 +660,24 @@ set_rt_cur(
 	return 0;
 }
 
+int
+set_log_cur(
+	const typ_t	*type,
+	xfs_daddr_t	blknum,
+	int		len,
+	int		ring_flag,
+	bbmap_t		*bbmap)
+{
+	if (!mp->m_logdev_targp->bt_bdev ||
+	    mp->m_logdev_targp->bt_bdev == mp->m_ddev_targp->bt_bdev) {
+		printf(_("external log device not loaded, use -l.\n"));
+		return ENODEV;
+	}
+
+	__set_cur(mp->m_logdev_targp, type, blknum, len, ring_flag, bbmap);
+	return 0;
+}
+
 void
 set_iocur_type(
 	const typ_t	*type)
diff --git a/db/io.h b/db/io.h
index 1a37ee78c72..b3d8123d548 100644
--- a/db/io.h
+++ b/db/io.h
@@ -49,6 +49,8 @@ extern void	push_cur_and_set_type(void);
 extern void	write_cur(void);
 extern void	set_cur(const struct typ *type, xfs_daddr_t blknum,
 			int len, int ring_add, bbmap_t *bbmap);
+extern int	set_log_cur(const struct typ *type, xfs_daddr_t blknum,
+			int len, int ring_add, bbmap_t *bbmap);
 extern int	set_rt_cur(const struct typ *type, xfs_daddr_t blknum,
 			int len, int ring_add, bbmap_t *bbmap);
 extern void     ring_add(void);




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux