btrfs-progs: factor out repair mode
authorDavid Sterba <dsterba@suse.com>
Mon, 4 Jul 2016 13:22:53 +0000 (15:22 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Jul 2016 13:22:53 +0000 (15:22 +0200)
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c
repair.c
repair.h

index b14cb1fa0f9c0f2ef52e4923057a1ec4a06d9f59..6a748ace077efe8ba1fed330f44c7ccf4b6c807f 100644 (file)
@@ -67,7 +67,6 @@ static u64 data_bytes_referenced = 0;
 static int found_old_backref = 0;
 static LIST_HEAD(duplicate_extents);
 static LIST_HEAD(delete_items);
-static int repair = 0;
 static int no_holes = 0;
 static int init_extent_tree = 0;
 static int check_data_csum = 0;
index 4f747421a58ccd9efae9a5e0075ddd7760810638..07a1232e02aded245ae36772dfaeb68f00fcd7fe 100644 (file)
--- a/repair.c
+++ b/repair.c
@@ -21,6 +21,8 @@
 #include "utils.h"
 #include "repair.h"
 
+int repair = 0;
+
 int btrfs_add_corrupt_extent_record(struct btrfs_fs_info *info,
                                    struct btrfs_key *first_key,
                                    u64 start, u64 len, int level)
index 3fc0e8b6d07d73f827342ac1cf37d8d52c2d393a..355bbf2ccfc65b4f6d37f4e0b72a9b85e1c7a0c1 100644 (file)
--- a/repair.h
+++ b/repair.h
@@ -21,6 +21,8 @@
 
 #include "ctree.h"
 
+extern int repair; /* repair mode */
+
 struct btrfs_corrupt_block {
        struct cache_extent cache;
        struct btrfs_key key;