]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: move incore structures out of xfs_da_format.h
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Jan 2020 16:29:41 +0000 (11:29 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:41 +0000 (11:29 -0500)
Source kernel commit: a39f089a25e75c3d17b955d8eb8bc781f23364f3

Move the abstract in-memory version of various btree block headers
out of xfs_da_format.h as they aren't on-disk formats.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/libxfs.h
libxfs/xfs_attr_leaf.h
libxfs/xfs_da_btree.h
libxfs/xfs_da_format.c
libxfs/xfs_da_format.h
libxfs/xfs_dir2.h
libxfs/xfs_dir2_priv.h

index 7ffef9e1e3081386f5c4dee9b40ad6847d9ae49f..6462c7a74a01be39efaf5f23a506d26fff7d2c13 100644 (file)
@@ -52,6 +52,7 @@ struct iomap;
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
 #include "xfs_dir2.h"
+#include "xfs_dir2_priv.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
index bb0880057ee30d902cf9c2eaf2eaaebcf2fef7e4..16208a7743dfac4856199df44498118727efc0ab 100644 (file)
@@ -16,6 +16,29 @@ struct xfs_da_state_blk;
 struct xfs_inode;
 struct xfs_trans;
 
+/*
+ * Incore version of the attribute leaf header.
+ */
+struct xfs_attr3_icleaf_hdr {
+       uint32_t        forw;
+       uint32_t        back;
+       uint16_t        magic;
+       uint16_t        count;
+       uint16_t        usedbytes;
+       /*
+        * Firstused is 32-bit here instead of 16-bit like the on-disk variant
+        * to support maximum fsb size of 64k without overflow issues throughout
+        * the attr code. Instead, the overflow condition is handled on
+        * conversion to/from disk.
+        */
+       uint32_t        firstused;
+       __u8            holes;
+       struct {
+               uint16_t        base;
+               uint16_t        size;
+       } freemap[XFS_ATTR_LEAF_MAPSIZE];
+};
+
 /*
  * Used to keep a list of "remote value" extents when unlinking an inode.
  */
index ae0bbd20d9caf141a7ae7c57803c57006f9e3d58..02f7a21ab3a5996992f0d10fe785d797d4958300 100644 (file)
@@ -124,6 +124,19 @@ typedef struct xfs_da_state {
                                                /* for dirv2 extrablk is data */
 } xfs_da_state_t;
 
+/*
+ * In-core version of the node header to abstract the differences in the v2 and
+ * v3 disk format of the headers. Callers need to convert to/from disk format as
+ * appropriate.
+ */
+struct xfs_da3_icnode_hdr {
+       uint32_t                forw;
+       uint32_t                back;
+       uint16_t                magic;
+       uint16_t                count;
+       uint16_t                level;
+};
+
 /*
  * Utility macros to aid in logging changed structure fields.
  */
index 443e310755765934d95d7d302b09c7b45ff07b67..57f4e185524ba6a222b7d2bb852e8b301faf6a03 100644 (file)
@@ -13,6 +13,7 @@
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_dir2.h"
+#include "xfs_dir2_priv.h"
 
 /*
  * Shortform directory ops
index 6702a0849f75d09803d611fe6c138b8ebd5a9dcc..3dee33043e09b330f420bd94e66c8c41be5a7565 100644 (file)
@@ -93,19 +93,6 @@ struct xfs_da3_intnode {
        struct xfs_da_node_entry __btree[];
 };
 
-/*
- * In-core version of the node header to abstract the differences in the v2 and
- * v3 disk format of the headers. Callers need to convert to/from disk format as
- * appropriate.
- */
-struct xfs_da3_icnode_hdr {
-       uint32_t        forw;
-       uint32_t        back;
-       uint16_t        magic;
-       uint16_t        count;
-       uint16_t        level;
-};
-
 /*
  * Directory version 2.
  *
@@ -434,14 +421,6 @@ struct xfs_dir3_leaf_hdr {
        __be32                  pad;            /* 64 bit alignment */
 };
 
-struct xfs_dir3_icleaf_hdr {
-       uint32_t                forw;
-       uint32_t                back;
-       uint16_t                magic;
-       uint16_t                count;
-       uint16_t                stale;
-};
-
 /*
  * Leaf block entry.
  */
@@ -520,19 +499,6 @@ struct xfs_dir3_free {
 
 #define XFS_DIR3_FREE_CRC_OFF  offsetof(struct xfs_dir3_free, hdr.hdr.crc)
 
-/*
- * In core version of the free block header, abstracted away from on-disk format
- * differences. Use this in the code, and convert to/from the disk version using
- * xfs_dir3_free_hdr_from_disk/xfs_dir3_free_hdr_to_disk.
- */
-struct xfs_dir3_icfree_hdr {
-       uint32_t        magic;
-       uint32_t        firstdb;
-       uint32_t        nvalid;
-       uint32_t        nused;
-
-};
-
 /*
  * Single block format.
  *
@@ -709,29 +675,6 @@ struct xfs_attr3_leafblock {
         */
 };
 
-/*
- * incore, neutral version of the attribute leaf header
- */
-struct xfs_attr3_icleaf_hdr {
-       uint32_t        forw;
-       uint32_t        back;
-       uint16_t        magic;
-       uint16_t        count;
-       uint16_t        usedbytes;
-       /*
-        * firstused is 32-bit here instead of 16-bit like the on-disk variant
-        * to support maximum fsb size of 64k without overflow issues throughout
-        * the attr code. Instead, the overflow condition is handled on
-        * conversion to/from disk.
-        */
-       uint32_t        firstused;
-       __u8            holes;
-       struct {
-               uint16_t        base;
-               uint16_t        size;
-       } freemap[XFS_ATTR_LEAF_MAPSIZE];
-};
-
 /*
  * Special value to represent fs block size in the leaf header firstused field.
  * Only used when block size overflows the 2-bytes available on disk.
index f542447794928e47c9eba683690866e105506aaa..e170792c0acce39cd49dff1b6d53d6ce5bd35ff6 100644 (file)
@@ -18,6 +18,8 @@ struct xfs_dir2_sf_entry;
 struct xfs_dir2_data_hdr;
 struct xfs_dir2_data_entry;
 struct xfs_dir2_data_unused;
+struct xfs_dir3_icfree_hdr;
+struct xfs_dir3_icleaf_hdr;
 
 extern struct xfs_name xfs_name_dotdot;
 
index 59f9fb2241a5f0db3e05f339139ecb10d508e577..d2eaea663e7f205b69e785c262c8bf7a2ea992c0 100644 (file)
@@ -8,6 +8,25 @@
 
 struct dir_context;
 
+/*
+ * In-core version of the leaf and free block headers to abstract the
+ * differences in the v2 and v3 disk format of the headers.
+ */
+struct xfs_dir3_icleaf_hdr {
+       uint32_t                forw;
+       uint32_t                back;
+       uint16_t                magic;
+       uint16_t                count;
+       uint16_t                stale;
+};
+
+struct xfs_dir3_icfree_hdr {
+       uint32_t                magic;
+       uint32_t                firstdb;
+       uint32_t                nvalid;
+       uint32_t                nused;
+};
+
 /* xfs_dir2.c */
 extern int xfs_dir2_grow_inode(struct xfs_da_args *args, int space,
                                xfs_dir2_db_t *dbp);