From: hsiangkao--- via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: jaegeuk <jaegeuk@kernel.org>, chao <chao@kernel.org>
Cc: linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
Subject: question about find_next_free_block in f2fs-tools
Date: Sat, 9 Dec 2017 14:29:58 +0800 [thread overview]
Message-ID: <2017120914295588417753@aol.com> (raw)
Hi Jaegeuk and Chao,
I have a minor question about the following code snippet in find_next_free_block recently
if (se->valid_blocks == 0 && !(segno % sbi->segs_per_sec)) {
struct seg_entry *se2;
unsigned int i;
for (i = 1; i < sbi->segs_per_sec; i++) {
se2 = get_seg_entry(sbi, segno + i);
if (se2->valid_blocks)
break;
}
if (i == sbi->segs_per_sec)
return 0;
}
What does it do if a section has 2 or more segments?
It seems that it succeeds only if the section is totally free? if not, do SSR instead? I have no idea about that. :(
And the code mainly for SSR follows, but I am confused when I associate that with the above...
if (se->type == type &&
!f2fs_test_bit(offset, (const char *)se->cur_valid_map))
return 0;
Does that indicate segments of a section should have the same type?
but I could not find any mechanism to keep segments of a section in the same type..
And I could not understand what the commit message("fsck.f2fs: LFS alloc_type must have free segment after blkoff") means...
Why should the last of segment have no valid block in LFS mode?
Could you take some time and give me some clues on it... :D
Thanks a lot.
Gao Xiang
hsiangkao@aol.com
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next reply other threads:[~2017-12-09 6:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-09 6:29 hsiangkao--- via Linux-f2fs-devel [this message]
2017-12-12 10:01 ` question about find_next_free_block in f2fs-tools Chao Yu
-- strict thread matches above, loose matches on Subject: below --
2017-12-12 12:19 gaoxiang (P)
2017-12-15 7:55 gaoxiang (P)
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=2017120914295588417753@aol.com \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=chao@kernel.org \
--cc=hsiangkao@aol.com \
--cc=jaegeuk@kernel.org \
/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).