From: TaoMa <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/2] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead.
Date: Tue, 02 Feb 2010 06:20:14 +0800 [thread overview]
Message-ID: <4B67539E.5060201@oracle.com> (raw)
In-Reply-To: <1265020173-14623-1-git-send-email-tristan.ye@oracle.com>
Hi Tristan,
Tristan Ye wrote:
> Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
> ---
> fs/ocfs2/alloc.c | 695 +++++++++++------------------------------------
> fs/ocfs2/alloc.h | 6 +-
> fs/ocfs2/dir.c | 2 +-
> fs/ocfs2/file.c | 11 +-
> fs/ocfs2/inode.c | 9 +-
> fs/ocfs2/refcounttree.c | 29 +--
> fs/ocfs2/refcounttree.h | 4 +-
> 7 files changed, 177 insertions(+), 579 deletions(-)
>
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index 38a42f5..bad3feb 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -5670,19 +5670,97 @@ out:
> return ret;
> }
>
>
<snip>
> +static int ocfs2_reserve_blocks_for_rec_trunc(struct inode *inode,
> + struct ocfs2_extent_tree *et,
> + u32 extents_to_split,
> + struct ocfs2_alloc_context **ac,
> + int extra_blocks)
> +{
> + int ret = 0, num_free_extents, blocks = extra_blocks;
> + unsigned int max_recs_needed = 2 * extents_to_split;
> + struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
> +
> + *ac = NULL;
> +
> + num_free_extents = ocfs2_num_free_extents(osb, et);
> + if (num_free_extents < 0) {
> + ret = num_free_extents;
> + mlog_errno(ret);
> + goto out;
> + }
> +
> + if (!num_free_extents ||
> + (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed))
> + blocks += ocfs2_extend_meta_needed(et->et_root_el);
> +
> + if (!blocks) {
> + ret = ocfs2_reserve_new_metadata_blocks(osb, blocks, ac);
>
Oh, this is a bug. I just wonder why I didn't find it earlier. Sorry.
the check condition should be
if (blocks) {
So do please run some stress test on these 2 patches.
Regards,
Tao
next prev parent reply other threads:[~2010-02-01 22:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-01 10:29 [Ocfs2-devel] [PATCH 1/2] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead Tristan Ye
2010-02-01 10:29 ` [Ocfs2-devel] [PATCH 2/2] Ocfs2: Fix punching hole codes to correctly do CoW during cluster zeroing Tristan Ye
2010-02-01 22:13 ` TaoMa
2010-02-02 1:24 ` tristan
2010-02-01 22:20 ` TaoMa [this message]
2010-02-02 1:32 ` [Ocfs2-devel] [PATCH 1/2] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead tristan
-- strict thread matches above, loose matches on Subject: below --
2010-02-05 10:45 Tristan Ye
2010-02-06 0:32 ` Tao Ma
2010-02-08 2:12 ` tristan
2010-02-09 0:47 ` Joel Becker
2010-02-09 1:12 ` tristan
2010-02-08 10:51 Tristan Ye
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=4B67539E.5060201@oracle.com \
--to=tao.ma@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.