svn commit: r348905 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Alexander Motin mav at FreeBSD.org
Tue Jun 11 13:46:07 UTC 2019


Author: mav
Date: Tue Jun 11 13:46:05 2019
New Revision: 348905
URL: https://svnweb.freebsd.org/changeset/base/348905

Log:
  MFC r344320 (by pjd): Simplify the code.

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	Tue Jun 11 13:44:19 2019	(r348904)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	Tue Jun 11 13:46:05 2019	(r348905)
@@ -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);


More information about the svn-src-stable mailing list