svn commit: r241630 - stable/9/sys/boot/zfs

Andriy Gapon avg at FreeBSD.org
Wed Oct 17 11:24:07 UTC 2012


Author: avg
Date: Wed Oct 17 11:24:06 2012
New Revision: 241630
URL: http://svn.freebsd.org/changeset/base/241630

Log:
  MFC r241291: zfs boot spa_status: print bootfs for each reported pool

Modified:
  stable/9/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/zfs/zfsimpl.c
==============================================================================
--- stable/9/sys/boot/zfs/zfsimpl.c	Wed Oct 17 11:16:17 2012	(r241629)
+++ stable/9/sys/boot/zfs/zfsimpl.c	Wed Oct 17 11:24:06 2012	(r241630)
@@ -64,6 +64,8 @@ static char *zfs_temp_buf, *zfs_temp_end
 #define TEMP_SIZE	(1024 * 1024)
 
 static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf);
+static int zfs_get_root(const spa_t *spa, uint64_t *objid);
+static int zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result);
 
 static void
 zfs_init(void)
@@ -726,11 +728,20 @@ vdev_status(vdev_t *vdev, int indent)
 static void
 spa_status(spa_t *spa)
 {
+	static char bootfs[ZFS_MAXNAMELEN];
+	uint64_t rootid;
 	vdev_t *vdev;
 	int good_kids, bad_kids, degraded_kids;
 	vdev_state_t state;
 
 	pager_printf("  pool: %s\n", spa->spa_name);
+	if (zfs_get_root(spa, &rootid) == 0 &&
+	    zfs_rlookup(spa, rootid, bootfs) == 0) {
+		if (bootfs[0] == '\0')
+			pager_printf("bootfs: %s\n", spa->spa_name);
+		else
+			pager_printf("bootfs: %s/%s\n", spa->spa_name, bootfs);
+	}
 	pager_printf("config:\n\n");
 	pager_printf(STATUS_FORMAT, "NAME", "STATE");
 


More information about the svn-src-stable-9 mailing list