diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-24 20:41:45 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-29 17:34:37 -0700 |
commit | 7a20b8a61eff81bdb7097a578752a74860e9d142 (patch) | |
tree | aebd2031eeea3771201126c0b4020e4f09d6a20a /fs/f2fs/segment.c | |
parent | c541a51b8ce81d003b02ed67ad3604a2e6220e3e (diff) | |
download | linux-7a20b8a61eff81bdb7097a578752a74860e9d142.tar.bz2 |
f2fs: allocate node and hot data in the beginning of partition
In order to give more spatial locality, this patch changes the block allocation
policy which assigns beginning of partition for small and hot data/node blocks.
In order to do this, we set noheap allocation by default and introduce another
mount option, heap, to reset it back.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index c5a5258f71c5..c5f0075764bf 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1519,6 +1519,14 @@ static void reset_curseg(struct f2fs_sb_info *sbi, int type, int modified) __set_sit_entry_type(sbi, type, curseg->segno, modified); } +static unsigned int __get_next_segno(struct f2fs_sb_info *sbi, int type) +{ + if (type == CURSEG_HOT_DATA || IS_NODESEG(type)) + return 0; + + return CURSEG_I(sbi, type)->segno; +} + /* * Allocate a current working segment. * This function always allocates a free segment in LFS manner. @@ -1537,6 +1545,7 @@ static void new_curseg(struct f2fs_sb_info *sbi, int type, bool new_sec) if (test_opt(sbi, NOHEAP)) dir = ALLOC_RIGHT; + segno = __get_next_segno(sbi, type); get_new_segment(sbi, &segno, new_sec, dir); curseg->next_segno = segno; reset_curseg(sbi, type, 1); |