diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-04-03 09:11:29 +0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-04-27 22:01:06 +0400 |
commit | d75afeb3d302019527331520a2632b6614425b40 (patch) | |
tree | 181dec415cdae00398086764a6229d115114354d /fs/xfs/xfs_attr_leaf.c | |
parent | d2e448d5fdebdcda93ed171339a3d864f65c227e (diff) | |
download | linux-d75afeb3d302019527331520a2632b6614425b40.tar.xz |
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_attr_leaf.c')
-rw-r--r-- | fs/xfs/xfs_attr_leaf.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 287c8089b705..92cda03d1c01 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c @@ -271,8 +271,13 @@ xfs_attr3_leaf_read( xfs_daddr_t mappedbno, struct xfs_buf **bpp) { - return xfs_da_read_buf(tp, dp, bno, mappedbno, bpp, + int err; + + err = xfs_da_read_buf(tp, dp, bno, mappedbno, bpp, XFS_ATTR_FORK, &xfs_attr3_leaf_buf_ops); + if (!err && tp) + xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_ATTR_LEAF_BUF); + return err; } /*======================================================================== @@ -1078,6 +1083,7 @@ xfs_attr3_leaf_to_node( goto out; /* copy leaf to new buffer, update identifiers */ + xfs_trans_buf_set_type(args->trans, bp2, XFS_BLF_ATTR_LEAF_BUF); bp2->b_ops = bp1->b_ops; memcpy(bp2->b_addr, bp1->b_addr, XFS_LBSIZE(mp)); if (xfs_sb_version_hascrc(&mp->m_sb)) { @@ -1140,6 +1146,7 @@ xfs_attr3_leaf_create( if (error) return error; bp->b_ops = &xfs_attr3_leaf_buf_ops; + xfs_trans_buf_set_type(args->trans, bp, XFS_BLF_ATTR_LEAF_BUF); leaf = bp->b_addr; memset(leaf, 0, XFS_LBSIZE(mp)); |