diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-10-27 21:07:45 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:34:18 -0500 |
commit | 02dbf38d19c19016f558fe0dc0c44f8041d3eb8e (patch) | |
tree | a0342ca55b1c39a835a0425e3f8ca13560299776 /fs/ocfs2/xattr.c | |
parent | 161d6f30f18c4a7e2b24705b6690cce3ff276eb9 (diff) |
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: 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.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 127a6285078..029a9f4559f 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -4083,25 +4083,24 @@ static int ocfs2_xattr_set_entry_in_bucket(struct inode *inode, | |||
4083 | { | 4083 | { |
4084 | int ret; | 4084 | int ret; |
4085 | handle_t *handle = NULL; | 4085 | handle_t *handle = NULL; |
4086 | u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); | ||
4087 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 4086 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
4087 | u64 blkno; | ||
4088 | 4088 | ||
4089 | mlog(0, "Set xattr entry len = %lu index = %d in bucket %llu\n", | 4089 | mlog(0, "Set xattr entry len = %lu index = %d in bucket %llu\n", |
4090 | (unsigned long)xi->value_len, xi->name_index, | 4090 | (unsigned long)xi->value_len, xi->name_index, |
4091 | (unsigned long long)bucket_blkno(xs->bucket)); | 4091 | (unsigned long long)bucket_blkno(xs->bucket)); |
4092 | 4092 | ||
4093 | if (!xs->bucket->bu_bhs[1]) { | 4093 | if (!xs->bucket->bu_bhs[1]) { |
4094 | ret = ocfs2_read_blocks(inode, | 4094 | blkno = bucket_blkno(xs->bucket); |
4095 | bucket_blkno(xs->bucket) + 1, | 4095 | ocfs2_xattr_bucket_relse(xs->bucket); |
4096 | blk_per_bucket - 1, &xs->bucket->bu_bhs[1], | 4096 | ret = ocfs2_read_xattr_bucket(xs->bucket, blkno); |
4097 | 0); | ||
4098 | if (ret) { | 4097 | if (ret) { |
4099 | mlog_errno(ret); | 4098 | mlog_errno(ret); |
4100 | goto out; | 4099 | goto out; |
4101 | } | 4100 | } |
4102 | } | 4101 | } |
4103 | 4102 | ||
4104 | handle = ocfs2_start_trans(osb, blk_per_bucket); | 4103 | handle = ocfs2_start_trans(osb, xs->bucket->bu_blocks); |
4105 | if (IS_ERR(handle)) { | 4104 | if (IS_ERR(handle)) { |
4106 | ret = PTR_ERR(handle); | 4105 | ret = PTR_ERR(handle); |
4107 | handle = NULL; | 4106 | handle = NULL; |