summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_block.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-07-08 14:35:32 +0200
committerChristoph Hellwig <hch@lst.de>2011-07-08 14:35:32 +0200
commita64b04179735de6bfd9f00c130a68ed7f20d18ef (patch)
tree36fe9aec30550aed6aecf6c2734fa365d1e7c83f /fs/xfs/xfs_dir2_block.h
parent4f6ae1a49ed5c81501d6f7385416bb4e07289e99 (diff)
downloadop-kernel-dev-a64b04179735de6bfd9f00c130a68ed7f20d18ef.zip
op-kernel-dev-a64b04179735de6bfd9f00c130a68ed7f20d18ef.tar.gz
xfs: kill struct xfs_dir2_block
Remove the confusing xfs_dir2_block structure. It is supposed to describe an XFS dir2 block format btree block, but due to the variable sized nature of almost all elements in it it can't actuall do anything close to that job. In addition to accessing the fixed offset header structure it was only used to get a pointer to the first dir or unused entry after it, which can be trivially replaced by pointer arithmetics on the header pointer. For most users that is actually more natural anyway, as they don't use a typed pointer but rather a character pointer for further arithmetics. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_block.h')
-rw-r--r--fs/xfs/xfs_dir2_block.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/fs/xfs/xfs_dir2_block.h b/fs/xfs/xfs_dir2_block.h
index fe91f88..de59677 100644
--- a/fs/xfs/xfs_dir2_block.h
+++ b/fs/xfs/xfs_dir2_block.h
@@ -19,10 +19,30 @@
#define __XFS_DIR2_BLOCK_H__
/*
- * xfs_dir2_block.h
- * Directory version 2, single block format structures
+ * Directory version 2, single block format structures.
+ *
+ * The single block format looks like the following drawing on disk:
+ *
+ * +-------------------------------------------------+
+ * | xfs_dir2_data_hdr_t |
+ * +-------------------------------------------------+
+ * | xfs_dir2_data_entry_t OR xfs_dir2_data_unused_t |
+ * | xfs_dir2_data_entry_t OR xfs_dir2_data_unused_t |
+ * | xfs_dir2_data_entry_t OR xfs_dir2_data_unused_t |
+ * | ... |
+ * +-------------------------------------------------+
+ * | unused space |
+ * +-------------------------------------------------+
+ * | ... |
+ * | xfs_dir2_leaf_entry_t |
+ * | xfs_dir2_leaf_entry_t |
+ * +-------------------------------------------------+
+ * | xfs_dir2_block_tail_t |
+ * +-------------------------------------------------+
+ *
+ * As all the entries are variable size structures the accessors in this
+ * file and xfs_dir2_data.h should be used to iterate over them.
*/
-
struct uio;
struct xfs_dabuf;
struct xfs_da_args;
@@ -32,14 +52,6 @@ struct xfs_inode;
struct xfs_mount;
struct xfs_trans;
-/*
- * The single block format is as follows:
- * xfs_dir2_data_hdr_t structure
- * xfs_dir2_data_entry_t and xfs_dir2_data_unused_t structures
- * xfs_dir2_leaf_entry_t structures
- * xfs_dir2_block_tail_t structure
- */
-
#define XFS_DIR2_BLOCK_MAGIC 0x58443242 /* XD2B: for one block dirs */
typedef struct xfs_dir2_block_tail {
@@ -48,16 +60,6 @@ typedef struct xfs_dir2_block_tail {
} xfs_dir2_block_tail_t;
/*
- * Generic single-block structure, for xfs_db.
- */
-typedef struct xfs_dir2_block {
- xfs_dir2_data_hdr_t hdr; /* magic XFS_DIR2_BLOCK_MAGIC */
- xfs_dir2_data_union_t u[1];
- xfs_dir2_leaf_entry_t leaf[1];
- xfs_dir2_block_tail_t tail;
-} xfs_dir2_block_t;
-
-/*
* Pointer to the leaf header embedded in a data block (1-block format)
*/
static inline xfs_dir2_block_tail_t *
OpenPOWER on IntegriCloud