aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans_buf.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_trans_buf.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_trans_buf.c')
-rw-r--r--fs/xfs/xfs_trans_buf.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index 3edf5dbee001..f950edd0d537 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -659,6 +659,7 @@ xfs_trans_binval(
659 ASSERT(XFS_BUF_ISSTALE(bp)); 659 ASSERT(XFS_BUF_ISSTALE(bp));
660 ASSERT(!(bip->bli_flags & (XFS_BLI_LOGGED | XFS_BLI_DIRTY))); 660 ASSERT(!(bip->bli_flags & (XFS_BLI_LOGGED | XFS_BLI_DIRTY)));
661 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_INODE_BUF)); 661 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_INODE_BUF));
662 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_TYPE_MASK));
662 ASSERT(bip->__bli_format.blf_flags & XFS_BLF_CANCEL); 663 ASSERT(bip->__bli_format.blf_flags & XFS_BLF_CANCEL);
663 ASSERT(bip->bli_item.li_desc->lid_flags & XFS_LID_DIRTY); 664 ASSERT(bip->bli_item.li_desc->lid_flags & XFS_LID_DIRTY);
664 ASSERT(tp->t_flags & XFS_TRANS_DIRTY); 665 ASSERT(tp->t_flags & XFS_TRANS_DIRTY);
@@ -671,6 +672,7 @@ xfs_trans_binval(
671 bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY); 672 bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY);
672 bip->__bli_format.blf_flags &= ~XFS_BLF_INODE_BUF; 673 bip->__bli_format.blf_flags &= ~XFS_BLF_INODE_BUF;
673 bip->__bli_format.blf_flags |= XFS_BLF_CANCEL; 674 bip->__bli_format.blf_flags |= XFS_BLF_CANCEL;
675 bip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK;
674 for (i = 0; i < bip->bli_format_count; i++) { 676 for (i = 0; i < bip->bli_format_count; i++) {
675 memset(bip->bli_formats[i].blf_data_map, 0, 677 memset(bip->bli_formats[i].blf_data_map, 0,
676 (bip->bli_formats[i].blf_map_size * sizeof(uint))); 678 (bip->bli_formats[i].blf_map_size * sizeof(uint)));
@@ -751,6 +753,26 @@ xfs_trans_inode_alloc_buf(
751 bip->bli_flags |= XFS_BLI_INODE_ALLOC_BUF; 753 bip->bli_flags |= XFS_BLI_INODE_ALLOC_BUF;
752} 754}
753 755
756/*
757 * Set the type of the buffer for log recovery so that it can correctly identify
758 * and hence attach the correct buffer ops to the buffer after replay.
759 */
760void
761xfs_trans_buf_set_type(
762 struct xfs_trans *tp,
763 struct xfs_buf *bp,
764 uint type)
765{
766 struct xfs_buf_log_item *bip = bp->b_fspriv;
767
768 ASSERT(bp->b_transp == tp);
769 ASSERT(bip != NULL);
770 ASSERT(atomic_read(&bip->bli_refcount) > 0);
771 ASSERT((type & XFS_BLF_TYPE_MASK) != 0);
772
773 bip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK;
774 bip->__bli_format.blf_flags |= type;
775}
754 776
755/* 777/*
756 * Similar to xfs_trans_inode_buf(), this marks the buffer as a cluster of 778 * Similar to xfs_trans_inode_buf(), this marks the buffer as a cluster of
@@ -769,14 +791,9 @@ xfs_trans_dquot_buf(
769 xfs_buf_t *bp, 791 xfs_buf_t *bp,
770 uint type) 792 uint type)
771{ 793{
772 xfs_buf_log_item_t *bip = bp->b_fspriv;
773
774 ASSERT(bp->b_transp == tp);
775 ASSERT(bip != NULL);
776 ASSERT(type == XFS_BLF_UDQUOT_BUF || 794 ASSERT(type == XFS_BLF_UDQUOT_BUF ||
777 type == XFS_BLF_PDQUOT_BUF || 795 type == XFS_BLF_PDQUOT_BUF ||
778 type == XFS_BLF_GDQUOT_BUF); 796 type == XFS_BLF_GDQUOT_BUF);
779 ASSERT(atomic_read(&bip->bli_refcount) > 0);
780 797
781 bip->__bli_format.blf_flags |= type; 798 xfs_trans_buf_set_type(tp, bp, type);
782} 799}