diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-04-03 07:11:29 +0200 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-04-27 20:01:06 +0200 |
commit | d75afeb3d302019527331520a2632b6614425b40 (patch) | |
tree | 181dec415cdae00398086764a6229d115114354d /fs/xfs/xfs_trans_buf.c | |
parent | xfs: add CRC protection to remote attributes (diff) | |
download | linux-d75afeb3d302019527331520a2632b6614425b40.tar.xz linux-d75afeb3d302019527331520a2632b6614425b40.zip |
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.c | 17 |
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( { struct xfs_buf_log_item *bip = bp->b_fspriv; + if (!tp) + return; + ASSERT(bp->b_transp == tp); ASSERT(bip != NULL); ASSERT(atomic_read(&bip->bli_refcount) > 0); @@ -777,6 +780,20 @@ xfs_trans_buf_set_type( bip->__bli_format.blf_flags |= type; } +void +xfs_trans_buf_copy_type( + struct xfs_buf *dst_bp, + struct xfs_buf *src_bp) +{ + struct xfs_buf_log_item *sbip = src_bp->b_fspriv; + struct xfs_buf_log_item *dbip = dst_bp->b_fspriv; + uint type; + + type = sbip->__bli_format.blf_flags & XFS_BLF_TYPE_MASK; + dbip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK; + dbip->__bli_format.blf_flags |= type; +} + /* * Similar to xfs_trans_inode_buf(), this marks the buffer as a cluster of * dquots. However, unlike in inode buffer recovery, dquot buffers get |