Commit 02dbf38d authored by Joel Becker's avatar Joel Becker Committed by Mark Fasheh

ocfs2: Use buckets in ocfs2_xattr_set_entry_in_bucket().

The ocfs2_xattr_set_entry_in_bucket() function is already working on an
ocfs2_xattr_bucket structure, so let's use the bucket API.
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
Signed-off-by: default avatarMark Fasheh <mfasheh@suse.com>
parent 161d6f30
...@@ -4083,25 +4083,24 @@ static int ocfs2_xattr_set_entry_in_bucket(struct inode *inode, ...@@ -4083,25 +4083,24 @@ static int ocfs2_xattr_set_entry_in_bucket(struct inode *inode,
{ {
int ret; int ret;
handle_t *handle = NULL; handle_t *handle = NULL;
u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
u64 blkno;
mlog(0, "Set xattr entry len = %lu index = %d in bucket %llu\n", mlog(0, "Set xattr entry len = %lu index = %d in bucket %llu\n",
(unsigned long)xi->value_len, xi->name_index, (unsigned long)xi->value_len, xi->name_index,
(unsigned long long)bucket_blkno(xs->bucket)); (unsigned long long)bucket_blkno(xs->bucket));
if (!xs->bucket->bu_bhs[1]) { if (!xs->bucket->bu_bhs[1]) {
ret = ocfs2_read_blocks(inode, blkno = bucket_blkno(xs->bucket);
bucket_blkno(xs->bucket) + 1, ocfs2_xattr_bucket_relse(xs->bucket);
blk_per_bucket - 1, &xs->bucket->bu_bhs[1], ret = ocfs2_read_xattr_bucket(xs->bucket, blkno);
0);
if (ret) { if (ret) {
mlog_errno(ret); mlog_errno(ret);
goto out; goto out;
} }
} }
handle = ocfs2_start_trans(osb, blk_per_bucket); handle = ocfs2_start_trans(osb, xs->bucket->bu_blocks);
if (IS_ERR(handle)) { if (IS_ERR(handle)) {
ret = PTR_ERR(handle); ret = PTR_ERR(handle);
handle = NULL; handle = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment