diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-11-12 06:54:00 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-11-13 17:40:59 -0500 |
commit | de497688daaabbab425a8a969528272ec1d962a6 (patch) | |
tree | 31721e42e4d6382d338867f18f70dfd0bb09fa9e /fs/xfs/xfs_fsops.c | |
parent | fd23683c3b1ab905cba61ea2981c156f4bf52845 (diff) |
xfs: make growfs initialise the AGFL header
For verification purposes, AGFLs need to be initialised to a known
set of values. For upcoming CRC changes, they are also headers that
need to be initialised. Currently, growfs does neither for the AGFLs
- it ignores them completely. Add initialisation of the AGFL to be
full of invalid block numbers (NULLAGBLOCK) to put the
infrastructure in place needed for CRC support.
Includes a comment clarification from Jeff Liu.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
-rw-r--r-- | fs/xfs/xfs_fsops.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 2196830bf5c0..bd9cb7f0b073 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
@@ -140,6 +140,7 @@ xfs_growfs_data_private( | |||
140 | xfs_growfs_data_t *in) /* growfs data input struct */ | 140 | xfs_growfs_data_t *in) /* growfs data input struct */ |
141 | { | 141 | { |
142 | xfs_agf_t *agf; | 142 | xfs_agf_t *agf; |
143 | struct xfs_agfl *agfl; | ||
143 | xfs_agi_t *agi; | 144 | xfs_agi_t *agi; |
144 | xfs_agnumber_t agno; | 145 | xfs_agnumber_t agno; |
145 | xfs_extlen_t agsize; | 146 | xfs_extlen_t agsize; |
@@ -207,7 +208,7 @@ xfs_growfs_data_private( | |||
207 | nfree = 0; | 208 | nfree = 0; |
208 | for (agno = nagcount - 1; agno >= oagcount; agno--, new -= agsize) { | 209 | for (agno = nagcount - 1; agno >= oagcount; agno--, new -= agsize) { |
209 | /* | 210 | /* |
210 | * AG freelist header block | 211 | * AG freespace header block |
211 | */ | 212 | */ |
212 | bp = xfs_growfs_get_hdr_buf(mp, | 213 | bp = xfs_growfs_get_hdr_buf(mp, |
213 | XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), | 214 | XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), |
@@ -244,6 +245,26 @@ xfs_growfs_data_private( | |||
244 | goto error0; | 245 | goto error0; |
245 | 246 | ||
246 | /* | 247 | /* |
248 | * AG freelist header block | ||
249 | */ | ||
250 | bp = xfs_growfs_get_hdr_buf(mp, | ||
251 | XFS_AG_DADDR(mp, agno, XFS_AGFL_DADDR(mp)), | ||
252 | XFS_FSS_TO_BB(mp, 1), 0); | ||
253 | if (!bp) { | ||
254 | error = ENOMEM; | ||
255 | goto error0; | ||
256 | } | ||
257 | |||
258 | agfl = XFS_BUF_TO_AGFL(bp); | ||
259 | for (bucket = 0; bucket < XFS_AGFL_SIZE(mp); bucket++) | ||
260 | agfl->agfl_bno[bucket] = cpu_to_be32(NULLAGBLOCK); | ||
261 | |||
262 | error = xfs_bwrite(bp); | ||
263 | xfs_buf_relse(bp); | ||
264 | if (error) | ||
265 | goto error0; | ||
266 | |||
267 | /* | ||
247 | * AG inode header block | 268 | * AG inode header block |
248 | */ | 269 | */ |
249 | bp = xfs_growfs_get_hdr_buf(mp, | 270 | bp = xfs_growfs_get_hdr_buf(mp, |