Print this page
1693 persistent 'comment' field for a zpool

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/spa_config.c
          +++ new/usr/src/uts/common/fs/zfs/spa_config.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
       25 + * Copyright (c) 2011 by Delphix. All rights reserved.
  24   26   */
  25   27  
  26   28  #include <sys/spa.h>
  27   29  #include <sys/spa_impl.h>
  28   30  #include <sys/nvpair.h>
  29   31  #include <sys/uio.h>
  30   32  #include <sys/fs/zfs.h>
  31   33  #include <sys/vdev_impl.h>
  32   34  #include <sys/zfs_ioctl.h>
  33   35  #include <sys/utsname.h>
↓ open down ↓ 304 lines elided ↑ open up ↑
 338  340          VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_VERSION,
 339  341              spa_version(spa)) == 0);
 340  342          VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME,
 341  343              spa_name(spa)) == 0);
 342  344          VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE,
 343  345              spa_state(spa)) == 0);
 344  346          VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG,
 345  347              txg) == 0);
 346  348          VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID,
 347  349              spa_guid(spa)) == 0);
      350 +        VERIFY(spa->spa_comment == NULL || nvlist_add_string(config,
      351 +            ZPOOL_CONFIG_COMMENT, spa->spa_comment) == 0);
      352 +
      353 +
 348  354  #ifdef  _KERNEL
 349  355          hostid = zone_get_hostid(NULL);
 350  356  #else   /* _KERNEL */
 351  357          /*
 352  358           * We're emulating the system's hostid in userland, so we can't use
 353  359           * zone_get_hostid().
 354  360           */
 355  361          (void) ddi_strtoul(hw_serial, NULL, 10, &hostid);
 356  362  #endif  /* _KERNEL */
 357  363          if (hostid != 0) {
↓ open down ↓ 130 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX