summaryrefslogtreecommitdiffstats
path: root/module/zfs/txg.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs/txg.c')
-rw-r--r--module/zfs/txg.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/module/zfs/txg.c b/module/zfs/txg.c
index a39732bb9..a10261846 100644
--- a/module/zfs/txg.c
+++ b/module/zfs/txg.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright 2011 Martin Matuska
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -787,6 +787,26 @@ txg_list_empty(txg_list_t *tl, uint64_t txg)
}
/*
+ * Returns true if all txg lists are empty.
+ *
+ * Warning: this is inherently racy (an item could be added immediately
+ * after this function returns). We don't bother with the lock because
+ * it wouldn't change the semantics.
+ */
+boolean_t
+txg_all_lists_empty(txg_list_t *tl)
+{
+ int i;
+
+ for (i = 0; i < TXG_SIZE; i++) {
+ if (!txg_list_empty(tl, i)) {
+ return (B_FALSE);
+ }
+ }
+ return (B_TRUE);
+}
+
+/*
* Add an entry to the list (unless it's already on the list).
* Returns B_TRUE if it was actually added.
*/