mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-13 17:21:05 +00:00
btrfs-progs: replace BTRFS_NUM_MIRRORS with BTRFS_MAX_MIRRORS
The chunk-recover.c/BTRFS_NUM_MIRRORS in the userspace means the same thing as ctree.h/BTRFS_MAX_MIRRORS in the kernelspace, so to stay consistent with the kernelspace, just make this movement in the userspace: chunk-recover.c/BTRFS_NUM_MIRRORS ===> ctree.h/BTRFS_MAX_MIRRORS This provides convenience for future use. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
70e3a85e9e
commit
ad70b55b66
@ -42,8 +42,6 @@
|
|||||||
#include "btrfsck.h"
|
#include "btrfsck.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
#define BTRFS_NUM_MIRRORS 3
|
|
||||||
|
|
||||||
struct recover_control {
|
struct recover_control {
|
||||||
int verbose;
|
int verbose;
|
||||||
int yes;
|
int yes;
|
||||||
@ -71,8 +69,8 @@ struct extent_record {
|
|||||||
struct cache_extent cache;
|
struct cache_extent cache;
|
||||||
u64 generation;
|
u64 generation;
|
||||||
u8 csum[BTRFS_CSUM_SIZE];
|
u8 csum[BTRFS_CSUM_SIZE];
|
||||||
struct btrfs_device *devices[BTRFS_NUM_MIRRORS];
|
struct btrfs_device *devices[BTRFS_MAX_MIRRORS];
|
||||||
u64 offsets[BTRFS_NUM_MIRRORS];
|
u64 offsets[BTRFS_MAX_MIRRORS];
|
||||||
int nmirrors;
|
int nmirrors;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -128,7 +126,7 @@ again:
|
|||||||
memcmp(exist->csum, rec->csum, BTRFS_CSUM_SIZE)) {
|
memcmp(exist->csum, rec->csum, BTRFS_CSUM_SIZE)) {
|
||||||
ret = -EEXIST;
|
ret = -EEXIST;
|
||||||
} else {
|
} else {
|
||||||
BUG_ON(exist->nmirrors >= BTRFS_NUM_MIRRORS);
|
BUG_ON(exist->nmirrors >= BTRFS_MAX_MIRRORS);
|
||||||
exist->devices[exist->nmirrors] = device;
|
exist->devices[exist->nmirrors] = device;
|
||||||
exist->offsets[exist->nmirrors] = offset;
|
exist->offsets[exist->nmirrors] = offset;
|
||||||
exist->nmirrors++;
|
exist->nmirrors++;
|
||||||
|
2
ctree.h
2
ctree.h
@ -40,6 +40,8 @@ struct btrfs_trans_handle;
|
|||||||
struct btrfs_free_space_ctl;
|
struct btrfs_free_space_ctl;
|
||||||
#define BTRFS_MAGIC 0x4D5F53665248425FULL /* ascii _BHRfS_M, no null */
|
#define BTRFS_MAGIC 0x4D5F53665248425FULL /* ascii _BHRfS_M, no null */
|
||||||
|
|
||||||
|
#define BTRFS_MAX_MIRRORS 3
|
||||||
|
|
||||||
#define BTRFS_MAX_LEVEL 8
|
#define BTRFS_MAX_LEVEL 8
|
||||||
|
|
||||||
#define BTRFS_COMPAT_EXTENT_TREE_V0
|
#define BTRFS_COMPAT_EXTENT_TREE_V0
|
||||||
|
Loading…
Reference in New Issue
Block a user