aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-12-05 14:19:37 -0500
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:40:32 -0500
commit4d0e214ee83185fcaa2cb97cd026d32bdc5c994a (patch)
tree7e5c2a6a2f2a384a0ebc0804f126a8106ad0b43f /fs/ocfs2/xattr.c
parent13723d00e374c2a6d6ccb5af6de965e89c3e1b01 (diff)
ocfs2: Add ecc and checksums to ocfs2 xattr buckets.
The xattr bucket can span multiple blocks on disk. We have wrappers for this structure in the code. We use the new multi-block ecc calls to calculate and validate the bucket. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index bc822d6ba542..7c2f4c9d1bd9 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -273,6 +273,15 @@ static int ocfs2_read_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
273 rc = ocfs2_read_blocks(bucket->bu_inode, xb_blkno, 273 rc = ocfs2_read_blocks(bucket->bu_inode, xb_blkno,
274 bucket->bu_blocks, bucket->bu_bhs, 0, 274 bucket->bu_blocks, bucket->bu_bhs, 0,
275 NULL); 275 NULL);
276 if (!rc) {
277 rc = ocfs2_validate_meta_ecc_bhs(bucket->bu_inode->i_sb,
278 bucket->bu_bhs,
279 bucket->bu_blocks,
280 &bucket_xh(bucket)->xh_check);
281 if (rc)
282 mlog_errno(rc);
283 }
284
276 if (rc) 285 if (rc)
277 ocfs2_xattr_bucket_relse(bucket); 286 ocfs2_xattr_bucket_relse(bucket);
278 return rc; 287 return rc;
@@ -301,6 +310,10 @@ static void ocfs2_xattr_bucket_journal_dirty(handle_t *handle,
301{ 310{
302 int i; 311 int i;
303 312
313 ocfs2_compute_meta_ecc_bhs(bucket->bu_inode->i_sb,
314 bucket->bu_bhs, bucket->bu_blocks,
315 &bucket_xh(bucket)->xh_check);
316
304 for (i = 0; i < bucket->bu_blocks; i++) 317 for (i = 0; i < bucket->bu_blocks; i++)
305 ocfs2_journal_dirty(handle, bucket->bu_bhs[i]); 318 ocfs2_journal_dirty(handle, bucket->bu_bhs[i]);
306} 319}