aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2021-04-14 06:03:07 +0000
committerMartin Matuska <mm@FreeBSD.org>2021-04-14 06:03:07 +0000
commitd76d37d9c3f33de9155c16f3b1eceb288c0702a0 (patch)
tree5162b40e96b21f938b4b7df159ac96dc782f2958 /include
parent48a1c304e82e33d5a3dd722a6ef4519dd998614b (diff)
Diffstat (limited to 'include')
-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,