Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125903
b: refs/heads/master
c: 90cb546
h: refs/heads/master
i:
  125901: 0ade685
  125899: ab84268
  125895: b750502
  125887: 1afc1f6
v: v3
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Jan 5, 2009
1 parent 069cf15 commit 43bcc74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 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: 4b3f6209bf9eec46fe5ebb168718fef5c443c157
refs/heads/master: 90cb546cada68bb8c2278afdb4b65c2ac11f2877
10 changes: 9 additions & 1 deletion trunk/fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2359,13 +2359,21 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
} else
xb = (struct ocfs2_xattr_block *)xbs->xattr_bh->b_data;

/*
* If there is already an xattr tree, good, we can calculate
* like other b-trees. Otherwise we may have the chance of
* create a tree, the credit calculation is borrowed from
* ocfs2_calc_extend_credits with root_el = NULL. And the
* new tree will be cluster based, so no meta is needed.
*/
if (le16_to_cpu(xb->xb_flags) & OCFS2_XATTR_INDEXED) {
struct ocfs2_extent_list *el =
&xb->xb_attrs.xb_root.xt_list;
meta_add += ocfs2_extend_meta_needed(el);
credits += ocfs2_calc_extend_credits(inode->i_sb,
el, 1);
}
} else
credits += OCFS2_SUBALLOC_ALLOC + 1;

/*
* This cluster will be used either for new bucket or for
Expand Down

0 comments on commit 43bcc74

Please sign in to comment.