Date: Wed, 17 Oct 2012 11:24:19 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241631 - stable/8/sys/boot/zfs Message-ID: <201210171124.q9HBOJXx059096@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Wed Oct 17 11:24:19 2012 New Revision: 241631 URL: http://svn.freebsd.org/changeset/base/241631 Log: MFC r241291: zfs boot spa_status: print bootfs for each reported pool Modified: stable/8/sys/boot/zfs/zfsimpl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Wed Oct 17 11:24:06 2012 (r241630) +++ stable/8/sys/boot/zfs/zfsimpl.c Wed Oct 17 11:24:19 2012 (r241631) @@ -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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210171124.q9HBOJXx059096>