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/vdev.c
          +++ new/usr/src/uts/common/fs/zfs/vdev.c
↓ open down ↓ 948 lines elided ↑ open up ↑
 949  949  
 950  950                  while ((pio = zio_walk_parents(zio)) != NULL)
 951  951                          if (!vdev_accessible(vd, pio))
 952  952                                  pio->io_error = SET_ERROR(ENXIO);
 953  953  
 954  954                  kmem_free(vps, sizeof (*vps));
 955  955          }
 956  956  }
 957  957  
 958  958  /*
 959      - * Determine whether this device is accessible by reading and writing
 960      - * to several known locations: the pad regions of each vdev label
 961      - * but the first (which we leave alone in case it contains a VTOC).
      959 + * Determine whether this device is accessible.
      960 + *
      961 + * Read and write to several known locations: the pad regions of each
      962 + * vdev label but the first, which we leave alone in case it contains
      963 + * a VTOC.
 962  964   */
 963  965  zio_t *
 964  966  vdev_probe(vdev_t *vd, zio_t *zio)
 965  967  {
 966  968          spa_t *spa = vd->vdev_spa;
 967  969          vdev_probe_stats_t *vps = NULL;
 968  970          zio_t *pio;
 969  971  
 970  972          ASSERT(vd->vdev_ops->vdev_op_leaf);
 971  973  
↓ open down ↓ 1200 lines elided ↑ open up ↑
2172 2174  
2173 2175          vd->vdev_degraded = 1ULL;
2174 2176          if (!vdev_is_dead(vd))
2175 2177                  vdev_set_state(vd, B_FALSE, VDEV_STATE_DEGRADED,
2176 2178                      aux);
2177 2179  
2178 2180          return (spa_vdev_state_exit(spa, vd, 0));
2179 2181  }
2180 2182  
2181 2183  /*
2182      - * Online the given vdev.  If 'unspare' is set, it implies two things.  First,
2183      - * any attached spare device should be detached when the device finishes
2184      - * resilvering.  Second, the online should be treated like a 'test' online case,
2185      - * so no FMA events are generated if the device fails to open.
     2184 + * Online the given vdev.
     2185 + *
     2186 + * If 'ZFS_ONLINE_UNSPARE' is set, it implies two things.  First, any attached
     2187 + * spare device should be detached when the device finishes resilvering.
     2188 + * Second, the online should be treated like a 'test' online case, so no FMA
     2189 + * events are generated if the device fails to open.
2186 2190   */
2187 2191  int
2188 2192  vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate)
2189 2193  {
2190 2194          vdev_t *vd, *tvd, *pvd, *rvd = spa->spa_root_vdev;
2191 2195  
2192 2196          spa_vdev_state_enter(spa, SCL_NONE);
2193 2197  
2194 2198          if ((vd = spa_lookup_by_guid(spa, guid, B_TRUE)) == NULL)
2195 2199                  return (spa_vdev_state_exit(spa, NULL, ENODEV));
↓ open down ↓ 1000 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX