From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] defrag.f2fs: enhance allocation speed
Date: Sat, 19 Dec 2015 17:44:45 +0800 [thread overview]
Message-ID: <5675270D.6040806@kernel.org> (raw)
In-Reply-To: <1450476805-98536-1-git-send-email-jaegeuk@kernel.org>
Hi Jaegeuk,
On 12/19/15 6:13 AM, Jaegeuk Kim wrote:
> This patch improves the allocation speed.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fsck/f2fs.h | 2 +-
> fsck/mount.c | 10 ++++++----
> 2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/fsck/f2fs.h b/fsck/f2fs.h
> index af5cc40..f990527 100644
> --- a/fsck/f2fs.h
> +++ b/fsck/f2fs.h
> @@ -295,7 +295,7 @@ static inline block_t __end_block_addr(struct f2fs_sb_info *sbi)
> #define GET_R2L_SEGNO(sbi, segno) (segno + FREE_I_START_SEGNO(sbi))
>
> #define START_BLOCK(sbi, segno) (SM_I(sbi)->main_blkaddr + \
> - (segno << sbi->log_blocks_per_seg))
> + ((segno) << sbi->log_blocks_per_seg))
>
> static inline struct curseg_info *CURSEG_I(struct f2fs_sb_info *sbi, int type)
> {
> diff --git a/fsck/mount.c b/fsck/mount.c
> index 4b38df8..82af895 100644
> --- a/fsck/mount.c
> +++ b/fsck/mount.c
> @@ -1401,9 +1401,11 @@ int find_next_free_block(struct f2fs_sb_info *sbi, u64 *to, int left, int type)
> se = get_seg_entry(sbi, segno);
>
> if (se->valid_blocks == sbi->blocks_per_seg ||
> - IS_CUR_SEGNO(sbi, segno, type))
> - goto next;
> -
> + IS_CUR_SEGNO(sbi, segno, type)) {
> + *to = left ? START_BLOCK(sbi, segno - 1) :
When traversing leftward, shouldn't next position be
*to = left ? START_BLOCK(sbi, segno) - 1 : ?
Thanks,
> + START_BLOCK(sbi, segno + 1);
> + continue;
> + }
> if (se->valid_blocks == 0 && !(segno % sbi->segs_per_sec)) {
> struct seg_entry *se2;
> int i;
> @@ -1420,7 +1422,7 @@ int find_next_free_block(struct f2fs_sb_info *sbi, u64 *to, int left, int type)
> if (se->type == type &&
> !f2fs_test_bit(offset, (const char *)se->cur_valid_map))
> return 0;
> -next:
> +
> *to = left ? *to - 1: *to + 1;
> }
> return -1;
>
------------------------------------------------------------------------------
next prev parent reply other threads:[~2015-12-19 9:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-18 22:13 [PATCH] defrag.f2fs: enhance allocation speed Jaegeuk Kim
2015-12-19 9:44 ` Chao Yu [this message]
2015-12-19 11:26 ` Jaegeuk Kim
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=5675270D.6040806@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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.