summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sys/dnode.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/sys/dnode.h b/include/sys/dnode.h
index 5e9d070e2..708e5fc44 100644
--- a/include/sys/dnode.h
+++ b/include/sys/dnode.h
@@ -373,6 +373,13 @@ struct dnode {
};
/*
+ * Since AVL already has embedded element counter, use dn_dbufs_count
+ * only for dbufs not counted there (bonus buffers) and just add them.
+ */
+#define DN_DBUFS_COUNT(dn) ((dn)->dn_dbufs_count + \
+ avl_numnodes(&(dn)->dn_dbufs))
+
+/*
* We use this (otherwise unused) bit to indicate if the value of
* dn_next_maxblkid[txgoff] is valid to use in dnode_sync().
*/