btrfs: zoned: sink zone check into btrfs_repair_one_zone
[sfrench/cifs-2.6.git] / fs / btrfs / volumes.c
index 9db9d66b54704c7567e30b2c3d165e55829b6597..f8be80aad8f0860e552fe4f6724f0825571bda03 100644 (file)
@@ -8341,23 +8341,26 @@ out:
        return ret;
 }
 
-int btrfs_repair_one_zone(struct btrfs_fs_info *fs_info, u64 logical)
+bool btrfs_repair_one_zone(struct btrfs_fs_info *fs_info, u64 logical)
 {
        struct btrfs_block_group *cache;
 
+       if (!btrfs_is_zoned(fs_info))
+               return false;
+
        /* Do not attempt to repair in degraded state */
        if (btrfs_test_opt(fs_info, DEGRADED))
-               return 0;
+               return true;
 
        cache = btrfs_lookup_block_group(fs_info, logical);
        if (!cache)
-               return 0;
+               return true;
 
        spin_lock(&cache->lock);
        if (cache->relocating_repair) {
                spin_unlock(&cache->lock);
                btrfs_put_block_group(cache);
-               return 0;
+               return true;
        }
        cache->relocating_repair = 1;
        spin_unlock(&cache->lock);
@@ -8365,5 +8368,5 @@ int btrfs_repair_one_zone(struct btrfs_fs_info *fs_info, u64 logical)
        kthread_run(relocating_repair_kthread, cache,
                    "btrfs-relocating-repair");
 
-       return 0;
+       return true;
 }