summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-07-04 15:22:53 +0200
committerDavid Sterba <dsterba@suse.com>2016-07-04 15:22:53 +0200
commit72e2a08a5c6d5f12be273e286e3355496e4a2f08 (patch)
tree45aa7334c37a9275c40bb9088d32791ab79e0474
parentbbebe814c0e335745cfa773df966418e754b50e3 (diff)
btrfs-progs: factor out repair mode
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--cmds-check.c1
-rw-r--r--repair.c2
-rw-r--r--repair.h2
3 files changed, 4 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c
index b14cb1fa..6a748ace 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -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;
diff --git a/repair.c b/repair.c
index 4f747421..07a1232e 100644
--- 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)
diff --git a/repair.h b/repair.h
index 3fc0e8b6..355bbf2c 100644
--- 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;