OSDN Git Service

f2fs: avoid unneeded loop in build_sit_entries
authorChao Yu <yuchao0@huawei.com>
Fri, 19 Aug 2016 15:13:47 +0000 (23:13 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 30 Aug 2016 01:31:09 +0000 (18:31 -0700)
commitd600af236da51d9e3b90d21a23f95b820bd02e2f
tree062e92b147c18b8f125ef30f1fdfd7da736064f4
parent43ced84ec8a7cb1b2e56dd1e262a0c63db79c3c1
f2fs: avoid unneeded loop in build_sit_entries

When building each sit entry in cache, firstly, we will load it from
sit page, and then check all entries in sit journal, if there is one
updated entry in journal, cover cached entry with the journaled one.

Actually, most of check operation is unneeded since we only need
to update cached entries with journaled entries in batch, so
changing the flow as below for more efficient:
1. load all sit entries into cache from sit pages;
2. update sit entries with journal.

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