aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_fsops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2013-04-21 15:53:46 -0400
committerBen Myers <bpm@sgi.com>2013-04-21 15:53:46 -0400
commitee1a47ab0e77600fcbdf1c87d461bd8f3f63150d (patch)
tree6340d9f4b8b53c0d18045da1372599645375efce /fs/xfs/xfs_fsops.c
parenta2050646f655a90400cbb66c3866d2e0137eee0c (diff)
xfs: add support for large btree blocks
Add support for larger btree blocks that contains a CRC32C checksum, a filesystem uuid and block number for detecting filesystem consistency and out of place writes. [dchinner@redhat.com] Also include an owner field to allow reverse mappings to be implemented for improved repairability and a LSN field to so that log recovery can easily determine the last modification that made it to disk for each buffer. [dchinner@redhat.com] Add buffer log format flags to indicate the type of buffer to recovery so that we don't have to do blind magic number tests to determine what the buffer is. [dchinner@redhat.com] Modified to fit into the verifier structure. 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_fsops.c')
-rw-r--r--fs/xfs/xfs_fsops.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 2866b8c78b7a..6fe286a8e29b 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -316,7 +316,13 @@ xfs_growfs_data_private(
316 goto error0; 316 goto error0;
317 } 317 }
318 318
319 xfs_btree_init_block(mp, bp, XFS_ABTB_MAGIC, 0, 1, 0); 319 if (xfs_sb_version_hascrc(&mp->m_sb))
320 xfs_btree_init_block(mp, bp, XFS_ABTB_CRC_MAGIC, 0, 1,
321 agno, XFS_BTREE_CRC_BLOCKS);
322 else
323 xfs_btree_init_block(mp, bp, XFS_ABTB_MAGIC, 0, 1,
324 agno, 0);
325
320 arec = XFS_ALLOC_REC_ADDR(mp, XFS_BUF_TO_BLOCK(bp), 1); 326 arec = XFS_ALLOC_REC_ADDR(mp, XFS_BUF_TO_BLOCK(bp), 1);
321 arec->ar_startblock = cpu_to_be32(XFS_PREALLOC_BLOCKS(mp)); 327 arec->ar_startblock = cpu_to_be32(XFS_PREALLOC_BLOCKS(mp));
322 arec->ar_blockcount = cpu_to_be32( 328 arec->ar_blockcount = cpu_to_be32(
@@ -339,7 +345,13 @@ xfs_growfs_data_private(
339 goto error0; 345 goto error0;
340 } 346 }
341 347
342 xfs_btree_init_block(mp, bp, XFS_ABTC_MAGIC, 0, 1, 0); 348 if (xfs_sb_version_hascrc(&mp->m_sb))
349 xfs_btree_init_block(mp, bp, XFS_ABTC_CRC_MAGIC, 0, 1,
350 agno, XFS_BTREE_CRC_BLOCKS);
351 else
352 xfs_btree_init_block(mp, bp, XFS_ABTC_MAGIC, 0, 1,
353 agno, 0);
354
343 arec = XFS_ALLOC_REC_ADDR(mp, XFS_BUF_TO_BLOCK(bp), 1); 355 arec = XFS_ALLOC_REC_ADDR(mp, XFS_BUF_TO_BLOCK(bp), 1);
344 arec->ar_startblock = cpu_to_be32(XFS_PREALLOC_BLOCKS(mp)); 356 arec->ar_startblock = cpu_to_be32(XFS_PREALLOC_BLOCKS(mp));
345 arec->ar_blockcount = cpu_to_be32( 357 arec->ar_blockcount = cpu_to_be32(
@@ -363,7 +375,12 @@ xfs_growfs_data_private(
363 goto error0; 375 goto error0;
364 } 376 }
365 377
366 xfs_btree_init_block(mp, bp, XFS_IBT_MAGIC, 0, 0, 0); 378 if (xfs_sb_version_hascrc(&mp->m_sb))
379 xfs_btree_init_block(mp, bp, XFS_IBT_CRC_MAGIC, 0, 0,
380 agno, XFS_BTREE_CRC_BLOCKS);
381 else
382 xfs_btree_init_block(mp, bp, XFS_IBT_MAGIC, 0, 0,
383 agno, 0);
367 384
368 error = xfs_bwrite(bp); 385 error = xfs_bwrite(bp);
369 xfs_buf_relse(bp); 386 xfs_buf_relse(bp);