summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chunk-recover.c8
-rw-r--r--ctree.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/chunk-recover.c b/chunk-recover.c
index 8bc5bc30..b638ada6 100644
--- a/chunk-recover.c
+++ b/chunk-recover.c
@@ -42,8 +42,6 @@
#include "btrfsck.h"
#include "commands.h"
-#define BTRFS_NUM_MIRRORS 3
-
struct recover_control {
int verbose;
int yes;
@@ -71,8 +69,8 @@ struct extent_record {
struct cache_extent cache;
u64 generation;
u8 csum[BTRFS_CSUM_SIZE];
- struct btrfs_device *devices[BTRFS_NUM_MIRRORS];
- u64 offsets[BTRFS_NUM_MIRRORS];
+ struct btrfs_device *devices[BTRFS_MAX_MIRRORS];
+ u64 offsets[BTRFS_MAX_MIRRORS];
int nmirrors;
};
@@ -128,7 +126,7 @@ again:
memcmp(exist->csum, rec->csum, BTRFS_CSUM_SIZE)) {
ret = -EEXIST;
} else {
- BUG_ON(exist->nmirrors >= BTRFS_NUM_MIRRORS);
+ BUG_ON(exist->nmirrors >= BTRFS_MAX_MIRRORS);
exist->devices[exist->nmirrors] = device;
exist->offsets[exist->nmirrors] = offset;
exist->nmirrors++;
diff --git a/ctree.h b/ctree.h
index 94893388..fa73c4a4 100644
--- a/ctree.h
+++ b/ctree.h
@@ -40,6 +40,8 @@ struct btrfs_trans_handle;
struct btrfs_free_space_ctl;
#define BTRFS_MAGIC 0x4D5F53665248425FULL /* ascii _BHRfS_M, no null */
+#define BTRFS_MAX_MIRRORS 3
+
#define BTRFS_MAX_LEVEL 8
#define BTRFS_COMPAT_EXTENT_TREE_V0