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>
This commit is contained in:
Jaegeuk Kim
2016-04-13 16:14:38 -07:00
parent c27753d675
commit eca76e783c
+7 -3
View File
@@ -1272,10 +1272,14 @@ next_step:
* we should not skip writing node pages. * we should not skip writing node pages.
*/ */
lock_node: lock_node:
if (ino && ino_of_node(page) == ino) if (ino) {
lock_page(page); if (ino_of_node(page) == ino)
else if (!trylock_page(page)) lock_page(page);
else
continue;
} else if (!trylock_page(page)) {
continue; continue;
}
if (unlikely(page->mapping != NODE_MAPPING(sbi))) { if (unlikely(page->mapping != NODE_MAPPING(sbi))) {
continue_unlock: continue_unlock: