From: Tao Ma <tm@tao.ma>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/3] ocfs2: Add ocfs2_trim_fs for SSD trim support.
Date: Tue, 08 Mar 2011 15:53:36 +0800 [thread overview]
Message-ID: <4D75E080.4060502@tao.ma> (raw)
In-Reply-To: <4D75B6DF.3030508@oracle.com>
On 03/08/2011 12:55 PM, Tristan Ye wrote:
> Hi Tao,
>
> Most of codes looks pretty neat to me, few comments inlined below:
>
> Tao Ma wrote:
>> From: Tao Ma <boyu.mt@taobao.com>
>>
>> Add ocfs2_trim_fs to support trimming freed clusters in the
>> volume. A range will be given and all the freed clusters greater
>> than minlen will be discarded to the block layer.
>>
>> Signed-off-by: Tao Ma <boyu.mt@taobao.com>
>> ---
>> fs/ocfs2/alloc.c | 154
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> fs/ocfs2/alloc.h | 1 +
>> 2 files changed, 155 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
>> index b27a0d8..6e1b3b5 100644
>> --- a/fs/ocfs2/alloc.c
>> +++ b/fs/ocfs2/alloc.c
<snip>
>> +static int ocfs2_trim_group(struct super_block *sb,
>> + struct ocfs2_group_desc *gd,
>> + int start, int max, int minbits)
>> +{
>> + int ret = 0, count = 0, next;
>> + void *bitmap = gd->bg_bitmap;
>> +
>> + while (start < max) {
>> + start = ocfs2_find_next_zero_bit(bitmap, max, start);
>> + if (start >= max)
>> + break;
>
> /* What if the 'start' stands within a hole */
>
> if (ocfs2_test_bit(...)) {
> start = ocfs2_find_next_zero_bit(...);
> if ((start == -1) || (start >= max))
> break;
> }
I just noticed that I forget to response to this. what do you define a
hole? It is within the global bitmap, so it is either freed or
allocated. I don't get your meaning of 'hole'. ocfs2_find_next_zero_bit
will do as we expected.
Regards,
Tao
next prev parent reply other threads:[~2011-03-08 7:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-07 10:02 [Ocfs2-devel] [PATCH 0/3] ocfs2: Add batched discard support Tao Ma
2011-03-07 10:05 ` [Ocfs2-devel] [PATCH 1/3] ocfs2: Add ocfs2_trim_fs for SSD trim support Tao Ma
2011-03-08 4:55 ` Tristan Ye
2011-03-08 5:53 ` Tao Ma
2011-03-08 6:23 ` Tristan Ye
2011-03-08 6:42 ` Tao Ma
2011-03-08 6:53 ` Tristan Ye
2011-03-08 7:47 ` Tao Ma
2011-03-08 7:53 ` Tao Ma [this message]
2011-03-08 7:59 ` Tristan Ye
2011-03-07 10:05 ` [Ocfs2-devel] [PATCH 2/3] ocfs2: Add FITRIM ioctl Tao Ma
2011-03-07 10:05 ` [Ocfs2-devel] [PATCH 3/3] ocfs2: Add trace event for trim Tao Ma
2011-03-08 15:26 ` [Ocfs2-devel] [PATCH 1/3 v2] ocfs2: Add ocfs2_trim_fs for SSD trim support Tao Ma
-- strict thread matches above, loose matches on Subject: below --
2011-05-06 9:23 [Ocfs2-devel] [PATCH 0/3] ocfs2: Add batched discard support Tao Ma
2011-05-06 9:27 ` [Ocfs2-devel] [PATCH 1/3] ocfs2: Add ocfs2_trim_fs for SSD trim support Tao Ma
2011-05-09 23:02 ` Sunil Mushran
2011-05-10 3:14 ` Tao Ma
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=4D75E080.4060502@tao.ma \
--to=tm@tao.ma \
--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.