aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/contrib/opensolaris/uts/common
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2019-02-19 23:53:33 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2019-02-19 23:53:33 +0000
commit91853b85467d52b7bcce20e6a1664163f4b747f6 (patch)
tree191a4b97562ce4f1eed17b208ce81fe7c6364c6a /sys/cddl/contrib/opensolaris/uts/common
parent01e21ead901bd8272b962c99385e2f0300635a31 (diff)
downloadsrc-91853b85467d52b7bcce20e6a1664163f4b747f6.tar.gz
src-91853b85467d52b7bcce20e6a1664163f4b747f6.zip
Simplify the code.
Notes
Notes: svn path=/head/; revision=344320
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
index 1af200d83b1d..847fe19fb0d1 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
@@ -360,16 +360,13 @@ trim_map_write_start(zio_t *zio)
return (B_FALSE);
}
- ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL);
- if (ts != NULL) {
- /*
- * Loop until all overlapping segments are removed.
- */
- do {
- trim_map_segment_remove(tm, ts, start, end);
- ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL);
- } while (ts != NULL);
+ /*
+ * Loop until all overlapping segments are removed.
+ */
+ while ((ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL)) != NULL) {
+ trim_map_segment_remove(tm, ts, start, end);
}
+
avl_add(&tm->tm_inflight_writes, zio);
mutex_exit(&tm->tm_lock);