Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125779
b: refs/heads/master
c: 4980c6d
h: refs/heads/master
i:
  125777: 90315a4
  125775: 8aa31ef
v: v3
  • Loading branch information
Joel Becker authored and Mark Fasheh committed Jan 5, 2009
1 parent be36aca commit 31aaad2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1224be020f62ada3e19822feeac3840abf80de3e
refs/heads/master: 4980c6daba967124ed6420032960abd2b48412e2
26 changes: 16 additions & 10 deletions trunk/fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,19 @@ static void ocfs2_xattr_bucket_journal_dirty(handle_t *handle,
ocfs2_journal_dirty(handle, bucket->bu_bhs[i]);
}

static void ocfs2_xattr_bucket_copy_data(struct inode *inode,
struct ocfs2_xattr_bucket *dest,
struct ocfs2_xattr_bucket *src)
{
int i;
int blocksize = inode->i_sb->s_blocksize;
int blks = ocfs2_blocks_per_xattr_bucket(inode->i_sb);

for (i = 0; i < blks; i++) {
memcpy(bucket_block(dest, i), bucket_block(src, i),
blocksize);
}
}

static inline const char *ocfs2_xattr_prefix(int name_index)
{
Expand Down Expand Up @@ -3299,9 +3312,7 @@ static int ocfs2_divide_xattr_bucket(struct inode *inode,
}

/* copy the whole bucket to the new first. */
for (i = 0; i < blk_per_bucket; i++)
memcpy(bucket_block(&t_bucket, i), bucket_block(&s_bucket, i),
blocksize);
ocfs2_xattr_bucket_copy_data(inode, &t_bucket, &s_bucket);

/* update the new bucket. */
xh = bucket_xh(&t_bucket);
Expand Down Expand Up @@ -3410,9 +3421,7 @@ static int ocfs2_cp_xattr_bucket(struct inode *inode,
u64 t_blkno,
int t_is_new)
{
int ret, i;
int blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
int blocksize = inode->i_sb->s_blocksize;
int ret;
struct ocfs2_xattr_bucket s_bucket, t_bucket;

BUG_ON(s_blkno == t_blkno);
Expand Down Expand Up @@ -3443,10 +3452,7 @@ static int ocfs2_cp_xattr_bucket(struct inode *inode,
if (ret)
goto out;

for (i = 0; i < blk_per_bucket; i++) {
memcpy(bucket_block(&t_bucket, i), bucket_block(&s_bucket, i),
blocksize);
}
ocfs2_xattr_bucket_copy_data(inode, &t_bucket, &s_bucket);
ocfs2_xattr_bucket_journal_dirty(handle, inode, &t_bucket);

out:
Expand Down

0 comments on commit 31aaad2

Please sign in to comment.