Skip to content

Commit

Permalink
Take zfs_notrim into account when trimming whole vdevs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dechamps committed Sep 21, 2012
1 parent 8cbb5cd commit a3adbc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/vdev_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason)
* Don't TRIM if removing so that we don't interfere with zpool
* disaster recovery.
*/
if (reason == VDEV_LABEL_CREATE || reason == VDEV_LABEL_SPARE
|| reason == VDEV_LABEL_L2CACHE)
if (!zfs_notrim && (reason == VDEV_LABEL_CREATE ||
reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE))
zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize));

/*
Expand Down

0 comments on commit a3adbc8

Please sign in to comment.