]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - include/xfs_da_btree.h
xfs: add CRC checking to dir2 leaf blocks
[thirdparty/xfsprogs-dev.git] / include / xfs_da_btree.h
index ee5170c46ae1abb5d348b493f24843389b4ecbe1..0854b95b1dc1c967ff201caead9d233581b68b8c 100644 (file)
@@ -46,6 +46,29 @@ typedef struct xfs_da_blkinfo {
        __be16          pad;                    /* unused */
 } xfs_da_blkinfo_t;
 
+/*
+ * CRC enabled directory structure types
+ *
+ * The headers change size for the additional verification information, but
+ * otherwise the tree layouts and contents are unchanged.
+ */
+#define        XFS_DIR3_LEAF1_MAGIC    0x3df1  /* magic number: v2 dirlf single blks */
+#define        XFS_DIR3_LEAFN_MAGIC    0x3dff  /* magic number: v2 dirlf multi blks */
+
+struct xfs_da3_blkinfo {
+       /*
+        * the node link manipulation code relies on the fact that the first
+        * element of this structure is the struct xfs_da_blkinfo so it can
+        * ignore the differences in the rest of the structures.
+        */
+       struct xfs_da_blkinfo   hdr;
+       __be32                  crc;    /* CRC of block */
+       __be64                  blkno;  /* first block of the buffer */
+       __be64                  lsn;    /* sequence number of last write */
+       uuid_t                  uuid;   /* filesystem we belong to */
+       __be64                  owner;  /* inode that owns the block */
+};
+
 /*
  * This is the structure of the root and intermediate nodes in the Btree.
  * The leaf nodes are defined above.