summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_data.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-07-08 14:35:42 +0200
committerChristoph Hellwig <hch@lst.de>2011-07-08 14:35:42 +0200
commit0ba9cd84ef2af58645333a86f9c901684ab1fef6 (patch)
tree0c25f43b83bb77ceb44cf29d207a295ac0b77b31 /fs/xfs/xfs_dir2_data.h
parentc2066e2662070e794f57a96a129c42575e77cfcb (diff)
downloadop-kernel-dev-0ba9cd84ef2af58645333a86f9c901684ab1fef6.zip
op-kernel-dev-0ba9cd84ef2af58645333a86f9c901684ab1fef6.tar.gz
xfs: kill struct xfs_dir2_data
Remove the confusing xfs_dir2_data structure. It is supposed to describe an XFS dir2 data 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_data.h')
-rw-r--r--fs/xfs/xfs_dir2_data.h33
1 files changed, 16 insertions, 17 deletions
diff --git a/fs/xfs/xfs_dir2_data.h b/fs/xfs/xfs_dir2_data.h
index aa6bf91c..ca02cc7 100644
--- a/fs/xfs/xfs_dir2_data.h
+++ b/fs/xfs/xfs_dir2_data.h
@@ -20,6 +20,22 @@
/*
* Directory format 2, data block structures.
+ *
+ * A pure data block 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 |
+ * +-------------------------------------------------+
+ *
+ * As all the entries are variable size structures the accessors in this
+ * file should be used to iterate over them.
*/
struct xfs_dabuf;
@@ -103,23 +119,6 @@ typedef struct xfs_dir2_data_unused {
__be16 tag; /* starting offset of us */
} xfs_dir2_data_unused_t;
-typedef union {
- xfs_dir2_data_entry_t entry;
- xfs_dir2_data_unused_t unused;
-} xfs_dir2_data_union_t;
-
-/*
- * Generic data block structure, for xfs_db.
- */
-typedef struct xfs_dir2_data {
- xfs_dir2_data_hdr_t hdr; /* magic XFS_DIR2_DATA_MAGIC */
- xfs_dir2_data_union_t u[1];
-} xfs_dir2_data_t;
-
-/*
- * Macros.
- */
-
/*
* Size of a data entry.
*/
OpenPOWER on IntegriCloud