aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2008-11-11 19:26:57 -0500
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:34:18 -0500
commit976331d8789d4d84a11b45b87c520ade83715343 (patch)
treec167f7655162e6ddbf62a3680c3272b101f06a45 /fs/ocfs2/xattr.c
parent757055adc5d41b910bdead925060f077dd2d9169 (diff)
ocfs2/xattr: Only extend xattr bucket in need.
When the first block of a bucket is filled up with xattr entries, we normally extend the bucket. But if we are just replace one xattr with small length, we don't need to extend it. This is important since we will calculate what we need before the transaction and in this situation no resources will be allocated. Signed-off-by: Tao Ma <tao.ma@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index d8fc714e9415..4501c63193df 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -4564,7 +4564,9 @@ try_again:
4564 free, need, max_free, le16_to_cpu(xh->xh_free_start), 4564 free, need, max_free, le16_to_cpu(xh->xh_free_start),
4565 le16_to_cpu(xh->xh_name_value_len)); 4565 le16_to_cpu(xh->xh_name_value_len));
4566 4566
4567 if (free < need || count == ocfs2_xattr_max_xe_in_bucket(inode->i_sb)) { 4567 if (free < need ||
4568 (xs->not_found &&
4569 count == ocfs2_xattr_max_xe_in_bucket(inode->i_sb))) {
4568 if (need <= max_free && 4570 if (need <= max_free &&
4569 count < ocfs2_xattr_max_xe_in_bucket(inode->i_sb)) { 4571 count < ocfs2_xattr_max_xe_in_bucket(inode->i_sb)) {
4570 /* 4572 /*