aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ag.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-04-03 01:11:13 -0400
committerBen Myers <bpm@sgi.com>2013-04-21 15:54:46 -0400
commit4e0e6040c4052aff15a494ac05778f4086d24c33 (patch)
tree6116acb302eb4be87e0193cb7476812a4cbddaac /fs/xfs/xfs_ag.h
parentee1a47ab0e77600fcbdf1c87d461bd8f3f63150d (diff)
xfs: add CRC checks to the AGF
The AGF already has some self identifying fields (e.g. the sequence number) so we only need to add the uuid to it to identify the filesystem it belongs to. The location is fixed based on the sequence number, so there's no need to add a block number, either. Hence the only additional fields are the CRC and LSN fields. These are unlogged, so place some space between the end of the logged fields and them so that future expansion of the AGF for logged fields can be placed adjacent to the existing logged fields and hence not complicate the field-derived range based logging we currently have. Based originally on a patch from myself, modified further by Christoph Hellwig and then modified again to fit into the verifier structure with additional fields by myself. The multiple signed-off-by tags indicate the age and history of this patch. Signed-off-by: Dave Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@lst.de> 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_ag.h')
-rw-r--r--fs/xfs/xfs_ag.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h
index f2aeedb6a579..9f4815e0c96f 100644
--- a/fs/xfs/xfs_ag.h
+++ b/fs/xfs/xfs_ag.h
@@ -63,12 +63,29 @@ typedef struct xfs_agf {
63 __be32 agf_spare0; /* spare field */ 63 __be32 agf_spare0; /* spare field */
64 __be32 agf_levels[XFS_BTNUM_AGF]; /* btree levels */ 64 __be32 agf_levels[XFS_BTNUM_AGF]; /* btree levels */
65 __be32 agf_spare1; /* spare field */ 65 __be32 agf_spare1; /* spare field */
66
66 __be32 agf_flfirst; /* first freelist block's index */ 67 __be32 agf_flfirst; /* first freelist block's index */
67 __be32 agf_fllast; /* last freelist block's index */ 68 __be32 agf_fllast; /* last freelist block's index */
68 __be32 agf_flcount; /* count of blocks in freelist */ 69 __be32 agf_flcount; /* count of blocks in freelist */
69 __be32 agf_freeblks; /* total free blocks */ 70 __be32 agf_freeblks; /* total free blocks */
71
70 __be32 agf_longest; /* longest free space */ 72 __be32 agf_longest; /* longest free space */
71 __be32 agf_btreeblks; /* # of blocks held in AGF btrees */ 73 __be32 agf_btreeblks; /* # of blocks held in AGF btrees */
74 uuid_t agf_uuid; /* uuid of filesystem */
75
76 /*
77 * reserve some contiguous space for future logged fields before we add
78 * the unlogged fields. This makes the range logging via flags and
79 * structure offsets much simpler.
80 */
81 __be64 agf_spare64[16];
82
83 /* unlogged fields, written during buffer writeback. */
84 __be64 agf_lsn; /* last write sequence */
85 __be32 agf_crc; /* crc of agf sector */
86 __be32 agf_spare2;
87
88 /* structure must be padded to 64 bit alignment */
72} xfs_agf_t; 89} xfs_agf_t;
73 90
74#define XFS_AGF_MAGICNUM 0x00000001 91#define XFS_AGF_MAGICNUM 0x00000001
@@ -83,7 +100,8 @@ typedef struct xfs_agf {
83#define XFS_AGF_FREEBLKS 0x00000200 100#define XFS_AGF_FREEBLKS 0x00000200
84#define XFS_AGF_LONGEST 0x00000400 101#define XFS_AGF_LONGEST 0x00000400
85#define XFS_AGF_BTREEBLKS 0x00000800 102#define XFS_AGF_BTREEBLKS 0x00000800
86#define XFS_AGF_NUM_BITS 12 103#define XFS_AGF_UUID 0x00001000
104#define XFS_AGF_NUM_BITS 13
87#define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1) 105#define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1)
88 106
89#define XFS_AGF_FLAGS \ 107#define XFS_AGF_FLAGS \
@@ -98,7 +116,8 @@ typedef struct xfs_agf {
98 { XFS_AGF_FLCOUNT, "FLCOUNT" }, \ 116 { XFS_AGF_FLCOUNT, "FLCOUNT" }, \
99 { XFS_AGF_FREEBLKS, "FREEBLKS" }, \ 117 { XFS_AGF_FREEBLKS, "FREEBLKS" }, \
100 { XFS_AGF_LONGEST, "LONGEST" }, \ 118 { XFS_AGF_LONGEST, "LONGEST" }, \
101 { XFS_AGF_BTREEBLKS, "BTREEBLKS" } 119 { XFS_AGF_BTREEBLKS, "BTREEBLKS" }, \
120 { XFS_AGF_UUID, "UUID" }
102 121
103/* disk block (xfs_daddr_t) in the AG */ 122/* disk block (xfs_daddr_t) in the AG */
104#define XFS_AGF_DADDR(mp) ((xfs_daddr_t)(1 << (mp)->m_sectbb_log)) 123#define XFS_AGF_DADDR(mp) ((xfs_daddr_t)(1 << (mp)->m_sectbb_log))