aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-04-13 16:14:38 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:33:20 +0200
commit5082299b063446c3c4b252a20489c4c8c7d1ef3f (patch)
tree64991951c40f61ca2fd15d40c7d4c0ae1865c160 /fs/f2fs/node.c
parente078f89999e9463f10f6469aedbdffa5bce13e5f (diff)
f2fs: avoid needless lock for node pages when fsyncing a file
When fsync is called, sync_node_pages finds a proper direct node pages to flush. But, it locks unrelated direct node pages together unnecessarily. Acked-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index b34fafc58..132111688 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1277,10 +1277,14 @@ next_step:
* we should not skip writing node pages.
*/
lock_node:
- if (ino && ino_of_node(page) == ino)
- lock_page(page);
- else if (!trylock_page(page))
+ if (ino) {
+ if (ino_of_node(page) == ino)
+ lock_page(page);
+ else
+ continue;
+ } else if (!trylock_page(page)) {
continue;
+ }
if (unlikely(page->mapping != NODE_MAPPING(sbi))) {
continue_unlock: