All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 01/13] ocfs2: Dirty the entire bucket in	ocfs2_bucket_value_truncate()
Date: Thu, 11 Dec 2008 10:39:42 -0800	[thread overview]
Message-ID: <20081211183942.GA12336@mail.oracle.com> (raw)
In-Reply-To: <20081127030109.GC6259@mail.oracle.com>


On Wed, Nov 26, 2008 at 07:01:09PM -0800, Joel Becker wrote:
> 	Good point.  Here's an updated version.

	Tristan's testing revealed a bug in the credits calculation in
ocfs2_delete_xattr_in_bucket(), which Tao found the fix for.  oss
bugzilla 1059.  That's been merged into the patch.  
	In addition, Tao added this change which I've added to my
branch.

From a647d0ab5a278b7ddcee5075ef345c40f2783a33 Mon Sep 17 00:00:00 2001
From: Tao Ma <tao.ma@oracle.com>
Date: Thu, 11 Dec 2008 08:54:11 +0800
Subject: [PATCH] ocfs2: Narrow the transaction for deleting xattrs from a bucket.

We move the transaction into the loop because in
ocfs2_remove_extent, we will double the credits in function
ocfs2_extend_rotate_transaction. So if we have a large loop
number, we will soon waste much the journal space.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
---
 fs/ocfs2/xattr.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 365b876..93c5668 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -5100,30 +5100,30 @@ static int ocfs2_delete_xattr_in_bucket(struct inode *inode,
 
 	ocfs2_init_dealloc_ctxt(&ctxt.dealloc);
 
-	ctxt.handle = ocfs2_start_trans(osb, credits);
-	if (IS_ERR(ctxt.handle)) {
-		ret = PTR_ERR(ctxt.handle);
-		mlog_errno(ret);
-		goto out;
-	}
-
 	for (i = 0; i < le16_to_cpu(xh->xh_count); i++) {
 		xe = &xh->xh_entries[i];
 		if (ocfs2_xattr_is_local(xe))
 			continue;
 
+		ctxt.handle = ocfs2_start_trans(osb, credits);
+		if (IS_ERR(ctxt.handle)) {
+			ret = PTR_ERR(ctxt.handle);
+			mlog_errno(ret);
+			break;
+		}
+
 		ret = ocfs2_xattr_bucket_value_truncate(inode, bucket,
 							i, 0, &ctxt);
+
+		ocfs2_commit_trans(osb, ctxt.handle);
 		if (ret) {
 			mlog_errno(ret);
 			break;
 		}
 	}
 
-	ret = ocfs2_commit_trans(osb, ctxt.handle);
 	ocfs2_schedule_truncate_log_flush(osb, 1);
 	ocfs2_run_deallocs(osb, &ctxt.dealloc);
-out:
 	return ret;
 }
 
-- 
1.5.6.5


-- 

 One look at the From:
 understanding has blossomed
 .procmailrc grows
	- Alexander Viro

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2008-12-11 18:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-27  0:06 [Ocfs2-devel] [PATCH 0/13] More xattr bucket consolidation Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 01/13] ocfs2: Dirty the entire bucket in ocfs2_bucket_value_truncate() Joel Becker
2008-11-27  1:23   ` Tao Ma
2008-11-27  3:01     ` Joel Becker
2008-12-11 18:39       ` Joel Becker [this message]
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 02/13] ocfs2: Dirty the entire first bucket in ocfs2_extend_xattr_bucket() Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 03/13] ocfs2: Dirty the entire first bucket in ocfs2_cp_xattr_cluster() Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 04/13] ocfs2: Explain t_is_new " Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 05/13] ocfs2: Use ocfs2_cp_xattr_bucket() in ocfs2_mv_xattr_bucket_cross_cluster() Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 06/13] ocfs2: Rename ocfs2_cp_xattr_cluster() to ocfs2_mv_xattr_buckets() Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 07/13] ocfs2: ocfs2_mv_xattr_buckets() can handle a partial cluster now Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 08/13] ocfs2: Use ocfs2_mv_xattr_buckets() in ocfs2_mv_xattr_bucket_cross_cluster() Joel Becker
2008-11-27  2:10   ` Tao Ma
2008-11-27  3:03     ` Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 09/13] ocfs2: Start using buckets in ocfs2_adjust_xattr_cross_cluster() Joel Becker
2008-11-27  2:16   ` Tao Ma
2008-11-27  3:04     ` Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 10/13] ocfs2: Pass buckets into ocfs2_mv_xattr_bucket_cross_cluster() Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 11/13] ocfs2: Move buckets up into ocfs2_add_new_xattr_cluster() Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 12/13] ocfs2: Move buckets up into ocfs2_add_new_xattr_bucket() Joel Becker
2008-12-11  2:13   ` Joel Becker
2008-11-27  0:06 ` [Ocfs2-devel] [PATCH 13/13] ocfs2: Pass xs->bucket " Joel Becker
2008-11-27  2:39   ` Tao Ma
2008-11-27  3:05     ` Joel Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081211183942.GA12336@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.