]> git.karo-electronics.de Git - linux-beck.git/commitdiff
f2fs: optimize f2fs_write_cache_pages
authorTiezhu Yang <kernelpatch@126.com>
Fri, 17 Jul 2015 04:56:00 +0000 (12:56 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 5 Aug 2015 15:08:10 +0000 (08:08 -0700)
The if statement "goto continue_unlock" is exactly the same when
each if condition is true that is depended on the value of both
"step" and "is_cold_data(page)" are 0 or 1. That means when the
value of "step" equals to "is_cold_data(page)", the if condition
is true and the if statement "goto continue_unlock" appears only
once, so it can be optimized to reduce the duplicated code.

Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 7f51296fbbf6b357da97683257b82e0a1e18893f..801b0b0b08f4c0ee3461aabb656327e2b26ab0b6 100644 (file)
@@ -1207,9 +1207,7 @@ continue_unlock:
                                goto continue_unlock;
                        }
 
-                       if (step == 0 && !is_cold_data(page))
-                               goto continue_unlock;
-                       if (step == 1 && is_cold_data(page))
+                       if (step == is_cold_data(page))
                                goto continue_unlock;
 
                        if (PageWriteback(page)) {