f2fs: remove redundant check in f2fs_sanity_check_cluster
authorZhang Qilong <zhangqilong3@huawei.com>
Thu, 1 Sep 2022 07:19:37 +0000 (15:19 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 4 Oct 2022 20:31:42 +0000 (13:31 -0700)
It have checked "compressed" at the entry of
f2fs_sanity_check_cluster, just remove the
redundant check for better performance here.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/compress.c

index 6baaff4c52bafd00bdb5260aa28a1d862b71b5c9..c16bab5bd6000d4265dc5b6c7e4259f4b0b83cf8 100644 (file)
@@ -912,17 +912,15 @@ bool f2fs_sanity_check_cluster(struct dnode_of_data *dn)
                        reason = "[C|*|C|*]";
                        goto out;
                }
-               if (compressed) {
-                       if (!__is_valid_data_blkaddr(blkaddr)) {
-                               if (!cluster_end)
-                                       cluster_end = i;
-                               continue;
-                       }
-                       /* [COMPR_ADDR, NULL_ADDR or NEW_ADDR, valid_blkaddr] */
-                       if (cluster_end) {
-                               reason = "[C|N|N|V]";
-                               goto out;
-                       }
+               if (!__is_valid_data_blkaddr(blkaddr)) {
+                       if (!cluster_end)
+                               cluster_end = i;
+                       continue;
+               }
+               /* [COMPR_ADDR, NULL_ADDR or NEW_ADDR, valid_blkaddr] */
+               if (cluster_end) {
+                       reason = "[C|N|N|V]";
+                       goto out;
                }
        }
        return false;