diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-04-11 17:30:21 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-04-27 13:19:53 -0400 |
commit | 24df33b45ecf5ca413ef1530e0aca5506d9be2cc (patch) | |
tree | c4f3ca2bfdd25b09706ad3d4ccd4f45fff6710a9 /fs/xfs/xfs_da_btree.h | |
parent | 33363feed1614def83d0a6870051f0a7828cd61b (diff) |
xfs: add CRC checking to dir2 leaf blocks
This addition follows the same pattern as the dir2 block CRCs.
Seeing as both LEAF1 and LEAFN types need to changed at the same
time, this is a pretty large amount of change. leaf block headers
need to be abstracted away from the on-disk structures (struct
xfs_dir3_icleaf_hdr), as do the base leaf entry locations.
This header abstract allows the in-core header and leaf entry
location to be passed around instead of the leaf block itself. This
saves a lot of converting individual variables from on-disk format
to host format where they are used, so there's a good chance that
the compiler will be able to produce much more optimal code as it's
not having to byteswap variables all over the place.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_da_btree.h')
-rw-r--r-- | fs/xfs/xfs_da_btree.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h index ee5170c46ae1..0854b95b1dc1 100644 --- a/fs/xfs/xfs_da_btree.h +++ b/fs/xfs/xfs_da_btree.h | |||
@@ -47,6 +47,29 @@ typedef struct xfs_da_blkinfo { | |||
47 | } xfs_da_blkinfo_t; | 47 | } xfs_da_blkinfo_t; |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * CRC enabled directory structure types | ||
51 | * | ||
52 | * The headers change size for the additional verification information, but | ||
53 | * otherwise the tree layouts and contents are unchanged. | ||
54 | */ | ||
55 | #define XFS_DIR3_LEAF1_MAGIC 0x3df1 /* magic number: v2 dirlf single blks */ | ||
56 | #define XFS_DIR3_LEAFN_MAGIC 0x3dff /* magic number: v2 dirlf multi blks */ | ||
57 | |||
58 | struct xfs_da3_blkinfo { | ||
59 | /* | ||
60 | * the node link manipulation code relies on the fact that the first | ||
61 | * element of this structure is the struct xfs_da_blkinfo so it can | ||
62 | * ignore the differences in the rest of the structures. | ||
63 | */ | ||
64 | struct xfs_da_blkinfo hdr; | ||
65 | __be32 crc; /* CRC of block */ | ||
66 | __be64 blkno; /* first block of the buffer */ | ||
67 | __be64 lsn; /* sequence number of last write */ | ||
68 | uuid_t uuid; /* filesystem we belong to */ | ||
69 | __be64 owner; /* inode that owns the block */ | ||
70 | }; | ||
71 | |||
72 | /* | ||
50 | * This is the structure of the root and intermediate nodes in the Btree. | 73 | * This is the structure of the root and intermediate nodes in the Btree. |
51 | * The leaf nodes are defined above. | 74 | * The leaf nodes are defined above. |
52 | * | 75 | * |