Print this page
3742 zfs comments need cleaner, more consistent style
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>
Reviewed by:    George Wilson <george.wilson@delphix.com>
Reviewed by:    Eric Schrock <eric.schrock@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/spa.c
          +++ new/usr/src/uts/common/fs/zfs/spa.c
↓ open down ↓ 4508 lines elided ↑ open up ↑
4509 4509          spa_strfree(newvdpath);
4510 4510  
4511 4511          if (spa->spa_bootfs)
4512 4512                  spa_event_notify(spa, newvd, ESC_ZFS_BOOTFS_VDEV_ATTACH);
4513 4513  
4514 4514          return (0);
4515 4515  }
4516 4516  
4517 4517  /*
4518 4518   * Detach a device from a mirror or replacing vdev.
     4519 + *
4519 4520   * If 'replace_done' is specified, only detach if the parent
4520 4521   * is a replacing vdev.
4521 4522   */
4522 4523  int
4523 4524  spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
4524 4525  {
4525 4526          uint64_t txg;
4526 4527          int error;
4527 4528          vdev_t *rvd = spa->spa_root_vdev;
4528 4529          vdev_t *vd, *pvd, *cvd, *tvd;
↓ open down ↓ 634 lines elided ↑ open up ↑
5163 5164  }
5164 5165  
5165 5166  /*
5166 5167   * Remove a device from the pool -
5167 5168   *
5168 5169   * Removing a device from the vdev namespace requires several steps
5169 5170   * and can take a significant amount of time.  As a result we use
5170 5171   * the spa_vdev_config_[enter/exit] functions which allow us to
5171 5172   * grab and release the spa_config_lock while still holding the namespace
5172 5173   * lock.  During each step the configuration is synced out.
5173      - */
5174      -
5175      -/*
5176      - * Remove a device from the pool.  Currently, this supports removing only hot
5177      - * spares, slogs, and level 2 ARC devices.
     5174 + *
     5175 + * Currently, this supports removing only hot spares, slogs, and level 2 ARC
     5176 + * devices.
5178 5177   */
5179 5178  int
5180 5179  spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare)
5181 5180  {
5182 5181          vdev_t *vd;
5183 5182          metaslab_group_t *mg;
5184 5183          nvlist_t **spares, **l2cache, *nv;
5185 5184          uint64_t txg = 0;
5186 5185          uint_t nspares, nl2cache;
5187 5186          int error = 0;
↓ open down ↓ 89 lines elided ↑ open up ↑
5277 5276          }
5278 5277  
5279 5278          if (!locked)
5280 5279                  return (spa_vdev_exit(spa, NULL, txg, error));
5281 5280  
5282 5281          return (error);
5283 5282  }
5284 5283  
5285 5284  /*
5286 5285   * Find any device that's done replacing, or a vdev marked 'unspare' that's
5287      - * current spared, so we can detach it.
     5286 + * currently spared, so we can detach it.
5288 5287   */
5289 5288  static vdev_t *
5290 5289  spa_vdev_resilver_done_hunt(vdev_t *vd)
5291 5290  {
5292 5291          vdev_t *newvd, *oldvd;
5293 5292  
5294 5293          for (int c = 0; c < vd->vdev_children; c++) {
5295 5294                  oldvd = spa_vdev_resilver_done_hunt(vd->vdev_child[c]);
5296 5295                  if (oldvd != NULL)
5297 5296                          return (oldvd);
↓ open down ↓ 1174 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX