btrfs: add helper to describe block group flags
[sfrench/cifs-2.6.git] / fs / btrfs / volumes.h
index aefce895e99468d428dd9d8f39af4fe6a6b4d18a..8b092bb1e2ee9efda7c720c346456efa24bdc77d 100644 (file)
@@ -210,6 +210,8 @@ BTRFS_DEVICE_GETSET_FUNCS(bytes_used);
 
 struct btrfs_fs_devices {
        u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
+       u8 metadata_uuid[BTRFS_FSID_SIZE];
+       bool fsid_change;
        struct list_head fs_list;
 
        u64 num_devices;
@@ -218,6 +220,10 @@ struct btrfs_fs_devices {
        u64 missing_devices;
        u64 total_rw_bytes;
        u64 total_devices;
+
+       /* Highest generation number of seen devices */
+       u64 latest_generation;
+
        struct block_device *latest_bdev;
 
        /* all of the devices in the FS, protected by a mutex
@@ -331,6 +337,8 @@ struct btrfs_raid_attr {
        int tolerated_failures; /* max tolerated fail devs */
        int devs_increment;     /* ndevs has to be a multiple of this */
        int ncopies;            /* how many copies to data has */
+       int nparity;            /* number of stripes worth of bytes to store
+                                * parity information */
        int mindev_error;       /* error code if min devs requisite is unmet */
        const char raid_name[8]; /* name of the raid */
        u64 bg_flag;            /* block group flag of the raid */
@@ -430,6 +438,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path);
 int btrfs_balance(struct btrfs_fs_info *fs_info,
                  struct btrfs_balance_control *bctl,
                  struct btrfs_ioctl_balance_args *bargs);
+void btrfs_describe_block_groups(u64 flags, char *buf, u32 size_buf);
 int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info);
 int btrfs_recover_balance(struct btrfs_fs_info *fs_info);
 int btrfs_pause_balance(struct btrfs_fs_info *fs_info);
@@ -462,6 +471,8 @@ unsigned long btrfs_full_stripe_len(struct btrfs_fs_info *fs_info,
 int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans,
                             u64 chunk_offset, u64 chunk_size);
 int btrfs_remove_chunk(struct btrfs_trans_handle *trans, u64 chunk_offset);
+struct extent_map *btrfs_get_chunk_map(struct btrfs_fs_info *fs_info,
+                                      u64 logical, u64 length);
 
 static inline void btrfs_dev_stat_inc(struct btrfs_device *dev,
                                      int index)