OSDN Git Service

f2fs: wrap discard policy
authorChao Yu <yuchao0@huawei.com>
Wed, 4 Oct 2017 01:08:33 +0000 (09:08 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 26 Oct 2017 08:44:07 +0000 (10:44 +0200)
commitecc9aa00dbb10416d3c1d8ef44ee38d20a36d172
tree26777da62be0b8b69522755be29284d4255f7e84
parent8412663d177d95beff799c8bb256fccef86d09e6
f2fs: wrap discard policy

This patch wraps scattered optional parameters into discard policy as
below, later, with it we expect that we can adjust these parameters with
proper strategy in different scenario.

struct discard_policy {
unsigned int min_interval; /* used for candidates exist */
unsigned int max_interval; /* used for candidates not exist */
unsigned int max_requests; /* # of discards issued per round */
unsigned int io_aware_gran; /* minimum granularity discard not be aware of I/O */
bool io_aware; /* issue discard in idle time */
bool sync; /* submit discard with REQ_SYNC flag */
};

This patch doesn't change any logic of codes.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/segment.c