aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ag.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_ag.h')
-rw-r--r--fs/xfs/xfs_ag.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h
index 9f4815e0c96f..272ef097e2be 100644
--- a/fs/xfs/xfs_ag.h
+++ b/fs/xfs/xfs_ag.h
@@ -30,6 +30,7 @@ struct xfs_trans;
30 30
31#define XFS_AGF_MAGIC 0x58414746 /* 'XAGF' */ 31#define XFS_AGF_MAGIC 0x58414746 /* 'XAGF' */
32#define XFS_AGI_MAGIC 0x58414749 /* 'XAGI' */ 32#define XFS_AGI_MAGIC 0x58414749 /* 'XAGI' */
33#define XFS_AGFL_MAGIC 0x5841464c /* 'XAFL' */
33#define XFS_AGF_VERSION 1 34#define XFS_AGF_VERSION 1
34#define XFS_AGI_VERSION 1 35#define XFS_AGI_VERSION 1
35 36
@@ -190,11 +191,31 @@ extern const struct xfs_buf_ops xfs_agi_buf_ops;
190 */ 191 */
191#define XFS_AGFL_DADDR(mp) ((xfs_daddr_t)(3 << (mp)->m_sectbb_log)) 192#define XFS_AGFL_DADDR(mp) ((xfs_daddr_t)(3 << (mp)->m_sectbb_log))
192#define XFS_AGFL_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGFL_DADDR(mp)) 193#define XFS_AGFL_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGFL_DADDR(mp))
193#define XFS_AGFL_SIZE(mp) ((mp)->m_sb.sb_sectsize / sizeof(xfs_agblock_t))
194#define XFS_BUF_TO_AGFL(bp) ((xfs_agfl_t *)((bp)->b_addr)) 194#define XFS_BUF_TO_AGFL(bp) ((xfs_agfl_t *)((bp)->b_addr))
195 195
196#define XFS_BUF_TO_AGFL_BNO(mp, bp) \
197 (xfs_sb_version_hascrc(&((mp)->m_sb)) ? \
198 &(XFS_BUF_TO_AGFL(bp)->agfl_bno[0]) : \
199 (__be32 *)(bp)->b_addr)
200
201/*
202 * Size of the AGFL. For CRC-enabled filesystes we steal a couple of
203 * slots in the beginning of the block for a proper header with the
204 * location information and CRC.
205 */
206#define XFS_AGFL_SIZE(mp) \
207 (((mp)->m_sb.sb_sectsize - \
208 (xfs_sb_version_hascrc(&((mp)->m_sb)) ? \
209 sizeof(struct xfs_agfl) : 0)) / \
210 sizeof(xfs_agblock_t))
211
196typedef struct xfs_agfl { 212typedef struct xfs_agfl {
197 __be32 agfl_bno[1]; /* actually XFS_AGFL_SIZE(mp) */ 213 __be32 agfl_magicnum;
214 __be32 agfl_seqno;
215 uuid_t agfl_uuid;
216 __be64 agfl_lsn;
217 __be32 agfl_crc;
218 __be32 agfl_bno[]; /* actually XFS_AGFL_SIZE(mp) */
198} xfs_agfl_t; 219} xfs_agfl_t;
199 220
200/* 221/*