f2fs: introduce CP_TRIMMED_FLAG to avoid unneeded discard
authorChao Yu <yuchao0@huawei.com>
Fri, 28 Apr 2017 05:56:08 +0000 (13:56 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 3 May 2017 17:04:56 +0000 (10:04 -0700)
commit1f43e2ad7bff54f7c82a084a57e5c90da0d3f4d9
treee10bc36ec318ab4c4b8d9b5c9aad579d9f516b4f
parentc473f1a9658b6c23d576136d5a49b1c731ef1767
f2fs: introduce CP_TRIMMED_FLAG to avoid unneeded discard

Introduce CP_TRIMMED_FLAG to indicate all invalid block were trimmed
before umount, so once we do mount with image which contain the flag,
we don't record invalid blocks as undiscard one, when fstrim is being
triggered, we can avoid issuing redundant discard commands.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/checkpoint.c
fs/f2fs/f2fs.h
fs/f2fs/segment.c
fs/f2fs/super.c
include/linux/f2fs_fs.h
include/trace/events/f2fs.h