aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans_buf.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-04-03 01:11:29 -0400
committerBen Myers <bpm@sgi.com>2013-04-27 14:01:06 -0400
commitd75afeb3d302019527331520a2632b6614425b40 (patch)
tree181dec415cdae00398086764a6229d115114354d /fs/xfs/xfs_trans_buf.c
parentd2e448d5fdebdcda93ed171339a3d864f65c227e (diff)
xfs: add buffer types to directory and attribute buffers
Add buffer types to the buffer log items so that log recovery can validate the buffers and calculate CRCs correctly after the buffers are recovered. 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.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index 8a0f6af51206..40871bf607f0 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -768,6 +768,9 @@ xfs_trans_buf_set_type(
768{ 768{
769 struct xfs_buf_log_item *bip = bp->b_fspriv; 769 struct xfs_buf_log_item *bip = bp->b_fspriv;
770 770
771 if (!tp)
772 return;
773
771 ASSERT(bp->b_transp == tp); 774 ASSERT(bp->b_transp == tp);
772 ASSERT(bip != NULL); 775 ASSERT(bip != NULL);
773 ASSERT(atomic_read(&bip->bli_refcount) > 0); 776 ASSERT(atomic_read(&bip->bli_refcount) > 0);
@@ -777,6 +780,20 @@ xfs_trans_buf_set_type(
777 bip->__bli_format.blf_flags |= type; 780 bip->__bli_format.blf_flags |= type;
778} 781}
779 782
783void
784xfs_trans_buf_copy_type(
785 struct xfs_buf *dst_bp,
786 struct xfs_buf *src_bp)
787{
788 struct xfs_buf_log_item *sbip = src_bp->b_fspriv;
789 struct xfs_buf_log_item *dbip = dst_bp->b_fspriv;
790 uint type;
791
792 type = sbip->__bli_format.blf_flags & XFS_BLF_TYPE_MASK;
793 dbip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK;
794 dbip->__bli_format.blf_flags |= type;
795}
796
780/* 797/*
781 * Similar to xfs_trans_inode_buf(), this marks the buffer as a cluster of 798 * Similar to xfs_trans_inode_buf(), this marks the buffer as a cluster of
782 * dquots. However, unlike in inode buffer recovery, dquot buffers get 799 * dquots. However, unlike in inode buffer recovery, dquot buffers get