From: tristan <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/4] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead.
Date: Tue, 11 May 2010 09:29:45 +0800 [thread overview]
Message-ID: <4BE8B309.3080901@oracle.com> (raw)
In-Reply-To: <20100510194006.GA2836@mail.oracle.com>
Joel Becker wrote:
> On Thu, May 06, 2010 at 02:50:15PM +0800, Tristan Ye wrote:
>
>> The patch has been tested normally for sanity check, stress tests with heavier workload
>> will be expected.
>>
>
> The patch looks functionally good. A couple housekeeping
> comments.
>
>
>> +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);
>>
>
> You don't need the blocks variable. Just use extra_blocks here.
> Save us a word on the stack.
>
That's right.
>
>> int ocfs2_remove_btree_range(struct inode *inode,
>> struct ocfs2_extent_tree *et,
>> u32 cpos, u32 phys_cpos, u32 len,
>>
>
> Move flags here: u32 cpos, u32 phys_cpos, u32 len, int flags,
>
>
>> - struct ocfs2_cached_dealloc_ctxt *dealloc)
>> + struct ocfs2_cached_dealloc_ctxt *dealloc,
>> + u64 refcount_loc, int flags)
>>
>
> It fits with the tuple representing the extent range.
>
Thank you for pointing this out, it leads to a better understanding and
readability.
>
>> diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
>> index 33dd2a1..cabdcf8 100644
>> --- a/fs/ocfs2/refcounttree.c
>> +++ b/fs/ocfs2/refcounttree.c
>> @@ -2508,21 +2508,20 @@ out:
>> * we gonna touch and whether we need to create new blocks.
>> *
>> * Normally the refcount blocks store these refcount should be
>> - * contiguous also, so that we can get the number easily.
>> - * As for meta_ac, we will at most add split 2 refcount record and
>> - * 2 more refcount block, so just check it in a rough way.
>> + * continguous also, so that we can get the number easily.
>>
>
> Whoops, you misspelled 'contiguous' here.
>
Feel sorry;-(
> Joel
>
>
next prev parent reply other threads:[~2010-05-11 1:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 6:50 [Ocfs2-devel] [PATCH 1/4] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead Tristan Ye
2010-05-06 6:50 ` [Ocfs2-devel] [PATCH 2/4] Ocfs2: Fix punching hole codes to correctly do CoW during cluster zeroing Tristan Ye
2010-05-06 6:50 ` [Ocfs2-devel] [PATCH 3/4] Ocfs2: Make ocfs2_find_cpos_for_left_leaf() public Tristan Ye
2010-05-06 6:50 ` [Ocfs2-devel] [PATCH 4/4] Ocfs2: Optimize punching-hole codes v5 Tristan Ye
2010-05-10 19:40 ` [Ocfs2-devel] [PATCH 1/4] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead Joel Becker
2010-05-11 1:29 ` tristan [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-05-11 8:10 [Ocfs2-devel] [PATCH 0/4] Patches series for optimization of truncating and punching-hole Tristan Ye
2010-05-11 8:10 ` [Ocfs2-devel] [PATCH 1/4] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead Tristan Ye
2010-05-11 9:53 [Ocfs2-devel] [PATCH 0/4] Patches series for optimization of truncating and punching-hole Tristan Ye
2010-05-11 9:53 ` [Ocfs2-devel] [PATCH 1/4] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead Tristan Ye
2010-05-11 9:54 [Ocfs2-devel] [PATCH 0/4] Patches series for optimization of truncating and punching-hole Tristan Ye
2010-05-11 9:54 ` [Ocfs2-devel] [PATCH 1/4] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead Tristan Ye
2010-05-18 18:50 ` Mark Fasheh
2010-05-19 2:00 ` tristan
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=4BE8B309.3080901@oracle.com \
--to=tristan.ye@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).