From: Jaegeuk Kim Date: Tue, 6 Sep 2016 22:55:54 +0000 (-0700) Subject: f2fs: avoid page allocation for truncating partial inline_data X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=6438097bd16f607c7babbb54159753d0e8b94d75;p=deliverable%2Flinux.git f2fs: avoid page allocation for truncating partial inline_data When truncating cached inline_data, we don't need to allocate a new page all the time. Instead, it must check its page cache only. Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index b74e985213f4..3b62949dfb07 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -523,7 +523,7 @@ static int truncate_partial_data_page(struct inode *inode, u64 from, return 0; if (cache_only) { - page = f2fs_grab_cache_page(mapping, index, false); + page = find_lock_page(mapping, index); if (page && PageUptodate(page)) goto truncate_out; f2fs_put_page(page, 1);