@@ -480,6 +480,7 @@ struct btrfs_super_block {
#define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)
#define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)
#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
+#define BTRFS_FEATURE_INCOMPAT_SPARE_DEV (1ULL << 10)
#define BTRFS_FEATURE_COMPAT_SUPP 0ULL
@@ -495,7 +496,8 @@ struct btrfs_super_block {
BTRFS_FEATURE_INCOMPAT_RAID56 | \
BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS | \
BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA | \
- BTRFS_FEATURE_INCOMPAT_NO_HOLES)
+ BTRFS_FEATURE_INCOMPAT_NO_HOLES | \
+ BTRFS_FEATURE_INCOMPAT_SPARE_DEV)
/*
* A leaf is full of items. offset and size tell us where to find
@@ -101,6 +101,10 @@ static int device_list_add(const char *path,
fs_devices->latest_devid = devid;
fs_devices->latest_trans = found_transid;
fs_devices->lowest_devid = (u64)-1;
+ if (btrfs_super_incompat_flags(disk_super) &
+ BTRFS_FEATURE_INCOMPAT_SPARE_DEV)
+ fs_devices->spare = 1;
+
device = NULL;
} else {
device = __find_device(&fs_devices->devices, devid,
@@ -83,6 +83,8 @@ struct btrfs_fs_devices {
int seeding;
struct btrfs_fs_devices *seed;
+
+ int spare;
};
struct btrfs_bio_stripe {
Signed-off-by: Anand Jain <anand.jain@oracle.com> --- ctree.h | 4 +++- volumes.c | 4 ++++ volumes.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-)