aboutsummaryrefslogtreecommitdiff
path: root/include/sys
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/dmu_recv.h1
-rw-r--r--include/sys/dmu_send.h1
-rw-r--r--include/sys/spa.h6
-rw-r--r--include/sys/vdev.h9
4 files changed, 15 insertions, 2 deletions
diff --git a/include/sys/dmu_recv.h b/include/sys/dmu_recv.h
index dacc6b7829da..7188b2a02248 100644
--- a/include/sys/dmu_recv.h
+++ b/include/sys/dmu_recv.h
@@ -34,7 +34,6 @@
#include <sys/dsl_dataset.h>
#include <sys/spa.h>
#include <sys/objlist.h>
-#include <sys/dsl_bookmark.h>
extern const char *recv_clone_name;
diff --git a/include/sys/dmu_send.h b/include/sys/dmu_send.h
index d6d050e01f97..d150f816c945 100644
--- a/include/sys/dmu_send.h
+++ b/include/sys/dmu_send.h
@@ -34,7 +34,6 @@
#include <sys/dsl_bookmark.h>
#include <sys/spa.h>
#include <sys/objlist.h>
-#include <sys/dsl_bookmark.h>
#include <sys/dmu_redact.h>
#define BEGINNV_REDACT_SNAPS "redact_snaps"
diff --git a/include/sys/spa.h b/include/sys/spa.h
index 8391be8328b6..c960478efe50 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -405,6 +405,12 @@ typedef struct blkptr {
/*
* Macros to get and set fields in a bp or DVA.
*/
+
+/*
+ * Note, for gang blocks, DVA_GET_ASIZE() is the total space allocated for
+ * this gang DVA including its children BP's. The space allocated at this
+ * DVA's vdev/offset is vdev_gang_header_asize(vdev).
+ */
#define DVA_GET_ASIZE(dva) \
BF64_GET_SB((dva)->dva_word[0], 0, SPA_ASIZEBITS, SPA_MINBLOCKSHIFT, 0)
#define DVA_SET_ASIZE(dva, x) \
diff --git a/include/sys/vdev.h b/include/sys/vdev.h
index d1ef6b5b59b4..f235bfc8cc19 100644
--- a/include/sys/vdev.h
+++ b/include/sys/vdev.h
@@ -133,6 +133,15 @@ extern int64_t vdev_deflated_space(vdev_t *vd, int64_t space);
extern uint64_t vdev_psize_to_asize(vdev_t *vd, uint64_t psize);
+/*
+ * Return the amount of space allocated for a gang block header.
+ */
+static inline uint64_t
+vdev_gang_header_asize(vdev_t *vd)
+{
+ return (vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE));
+}
+
extern int vdev_fault(spa_t *spa, uint64_t guid, vdev_aux_t aux);
extern int vdev_degrade(spa_t *spa, uint64_t guid, vdev_aux_t aux);
extern int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags,