blob: d06f35d0407e59a7e92710de73f459c69fb468d5 [file] [log] [blame] [raw]
Add support of ZFS objset v3 in bootloaders.
Backported from FreeBSD base r348867 (MFC r342747).
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/cddl/boot/zfs/zfsimpl.h freebsd-11.1/sys/cddl/boot/zfs/zfsimpl.h
--- /usr/src/sys/cddl/boot/zfs/zfsimpl.h 2017-07-21 07:42:01.000000000 +0800
+++ freebsd-11.1/sys/cddl/boot/zfs/zfsimpl.h 2019-12-26 10:06:10.600447894 +0800
@@ -1020,6 +1020,8 @@
#define SA_GID_OFFSET 32
#define SA_PARENT_OFFSET 40
+#define ZIO_OBJSET_MAC_LEN 32
+
/*
* Intent log header - this on disk structure holds fields to manage
* the log. All fields are 64 bit to easily handle cross architectures.
@@ -1032,17 +1034,24 @@
uint64_t zh_pad[5];
} zil_header_t;
-#define OBJSET_PHYS_SIZE 2048
+#define OBJSET_PHYS_SIZE_V2 2048
+#define OBJSET_PHYS_SIZE_V3 4096
typedef struct objset_phys {
dnode_phys_t os_meta_dnode;
zil_header_t os_zil_header;
uint64_t os_type;
uint64_t os_flags;
- char os_pad[OBJSET_PHYS_SIZE - sizeof (dnode_phys_t)*3 -
- sizeof (zil_header_t) - sizeof (uint64_t)*2];
+ uint8_t os_portable_mac[ZIO_OBJSET_MAC_LEN];
+ uint8_t os_local_mac[ZIO_OBJSET_MAC_LEN];
+ char os_pad0[OBJSET_PHYS_SIZE_V2 - sizeof (dnode_phys_t)*3 -
+ sizeof (zil_header_t) - sizeof (uint64_t)*2 -
+ 2*ZIO_OBJSET_MAC_LEN];
dnode_phys_t os_userused_dnode;
dnode_phys_t os_groupused_dnode;
+ dnode_phys_t os_projectused_dnode;
+ char os_pad1[OBJSET_PHYS_SIZE_V3 - OBJSET_PHYS_SIZE_V2 -
+ sizeof (dnode_phys_t)];
} objset_phys_t;
typedef struct dsl_dir_phys {