| .. | .. |
|---|
| 17 | 17 | |
|---|
| 18 | 18 | #define BTRFS_STRIPE_LEN SZ_64K |
|---|
| 19 | 19 | |
|---|
| 20 | | -struct buffer_head; |
|---|
| 21 | | -struct btrfs_pending_bios { |
|---|
| 22 | | - struct bio *head; |
|---|
| 23 | | - struct bio *tail; |
|---|
| 20 | +struct btrfs_io_geometry { |
|---|
| 21 | + /* remaining bytes before crossing a stripe */ |
|---|
| 22 | + u64 len; |
|---|
| 23 | + /* offset of logical address in chunk */ |
|---|
| 24 | + u64 offset; |
|---|
| 25 | + /* length of single IO stripe */ |
|---|
| 26 | + u64 stripe_len; |
|---|
| 27 | + /* number of stripe where address falls */ |
|---|
| 28 | + u64 stripe_nr; |
|---|
| 29 | + /* offset of address in stripe */ |
|---|
| 30 | + u64 stripe_offset; |
|---|
| 31 | + /* offset of raid56 stripe into the chunk */ |
|---|
| 32 | + u64 raid56_stripe_offset; |
|---|
| 24 | 33 | }; |
|---|
| 25 | 34 | |
|---|
| 26 | 35 | /* |
|---|
| .. | .. |
|---|
| 41 | 50 | #define BTRFS_DEV_STATE_MISSING (2) |
|---|
| 42 | 51 | #define BTRFS_DEV_STATE_REPLACE_TGT (3) |
|---|
| 43 | 52 | #define BTRFS_DEV_STATE_FLUSH_SENT (4) |
|---|
| 53 | +#define BTRFS_DEV_STATE_NO_READA (5) |
|---|
| 44 | 54 | |
|---|
| 45 | 55 | struct btrfs_device { |
|---|
| 46 | | - struct list_head dev_list; |
|---|
| 47 | | - struct list_head dev_alloc_list; |
|---|
| 56 | + struct list_head dev_list; /* device_list_mutex */ |
|---|
| 57 | + struct list_head dev_alloc_list; /* chunk mutex */ |
|---|
| 58 | + struct list_head post_commit_list; /* chunk mutex */ |
|---|
| 48 | 59 | struct btrfs_fs_devices *fs_devices; |
|---|
| 49 | 60 | struct btrfs_fs_info *fs_info; |
|---|
| 50 | 61 | |
|---|
| 51 | | - struct rcu_string *name; |
|---|
| 62 | + struct rcu_string __rcu *name; |
|---|
| 52 | 63 | |
|---|
| 53 | 64 | u64 generation; |
|---|
| 54 | | - |
|---|
| 55 | | - spinlock_t io_lock ____cacheline_aligned; |
|---|
| 56 | | - int running_pending; |
|---|
| 57 | | - /* When true means this device has pending chunk alloc in |
|---|
| 58 | | - * current transaction. Protected by chunk_mutex. |
|---|
| 59 | | - */ |
|---|
| 60 | | - bool has_pending_chunks; |
|---|
| 61 | | - |
|---|
| 62 | | - /* regular prio bios */ |
|---|
| 63 | | - struct btrfs_pending_bios pending_bios; |
|---|
| 64 | | - /* sync bios */ |
|---|
| 65 | | - struct btrfs_pending_bios pending_sync_bios; |
|---|
| 66 | 65 | |
|---|
| 67 | 66 | struct block_device *bdev; |
|---|
| 68 | 67 | |
|---|
| .. | .. |
|---|
| 71 | 70 | |
|---|
| 72 | 71 | unsigned long dev_state; |
|---|
| 73 | 72 | blk_status_t last_flush_error; |
|---|
| 74 | | - int flush_bio_sent; |
|---|
| 75 | 73 | |
|---|
| 76 | 74 | #ifdef __BTRFS_NEED_DEVICE_DATA_ORDERED |
|---|
| 77 | 75 | seqcount_t data_seqcount; |
|---|
| .. | .. |
|---|
| 107 | 105 | * size of the device on the current transaction |
|---|
| 108 | 106 | * |
|---|
| 109 | 107 | * This variant is update when committing the transaction, |
|---|
| 110 | | - * and protected by device_list_mutex |
|---|
| 108 | + * and protected by chunk mutex |
|---|
| 111 | 109 | */ |
|---|
| 112 | 110 | u64 commit_total_bytes; |
|---|
| 113 | 111 | |
|---|
| 114 | 112 | /* bytes used on the current transaction */ |
|---|
| 115 | 113 | u64 commit_bytes_used; |
|---|
| 116 | | - /* |
|---|
| 117 | | - * used to manage the device which is resized |
|---|
| 118 | | - * |
|---|
| 119 | | - * It is protected by chunk_lock. |
|---|
| 120 | | - */ |
|---|
| 121 | | - struct list_head resized_list; |
|---|
| 122 | 114 | |
|---|
| 123 | 115 | /* for sending down flush barriers */ |
|---|
| 124 | 116 | struct bio *flush_bio; |
|---|
| .. | .. |
|---|
| 126 | 118 | |
|---|
| 127 | 119 | /* per-device scrub information */ |
|---|
| 128 | 120 | struct scrub_ctx *scrub_ctx; |
|---|
| 129 | | - |
|---|
| 130 | | - struct btrfs_work work; |
|---|
| 131 | | - struct rcu_head rcu; |
|---|
| 132 | 121 | |
|---|
| 133 | 122 | /* readahead state */ |
|---|
| 134 | 123 | atomic_t reada_in_flight; |
|---|
| .. | .. |
|---|
| 144 | 133 | /* Counter to record the change of device stats */ |
|---|
| 145 | 134 | atomic_t dev_stats_ccnt; |
|---|
| 146 | 135 | atomic_t dev_stat_values[BTRFS_DEV_STAT_VALUES_MAX]; |
|---|
| 136 | + |
|---|
| 137 | + struct extent_io_tree alloc_state; |
|---|
| 138 | + |
|---|
| 139 | + struct completion kobj_unregister; |
|---|
| 140 | + /* For sysfs/FSID/devinfo/devid/ */ |
|---|
| 141 | + struct kobject devid_kobj; |
|---|
| 147 | 142 | }; |
|---|
| 148 | 143 | |
|---|
| 149 | 144 | /* |
|---|
| .. | .. |
|---|
| 174 | 169 | write_seqcount_end(&dev->data_seqcount); \ |
|---|
| 175 | 170 | preempt_enable(); \ |
|---|
| 176 | 171 | } |
|---|
| 177 | | -#elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT) |
|---|
| 172 | +#elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPTION) |
|---|
| 178 | 173 | #define BTRFS_DEVICE_GETSET_FUNCS(name) \ |
|---|
| 179 | 174 | static inline u64 \ |
|---|
| 180 | 175 | btrfs_device_get_##name(const struct btrfs_device *dev) \ |
|---|
| .. | .. |
|---|
| 213 | 208 | BTRFS_DEVICE_GETSET_FUNCS(disk_total_bytes); |
|---|
| 214 | 209 | BTRFS_DEVICE_GETSET_FUNCS(bytes_used); |
|---|
| 215 | 210 | |
|---|
| 211 | +enum btrfs_chunk_allocation_policy { |
|---|
| 212 | + BTRFS_CHUNK_ALLOC_REGULAR, |
|---|
| 213 | +}; |
|---|
| 214 | + |
|---|
| 216 | 215 | struct btrfs_fs_devices { |
|---|
| 217 | 216 | u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */ |
|---|
| 217 | + u8 metadata_uuid[BTRFS_FSID_SIZE]; |
|---|
| 218 | + bool fsid_change; |
|---|
| 218 | 219 | struct list_head fs_list; |
|---|
| 219 | 220 | |
|---|
| 220 | 221 | u64 num_devices; |
|---|
| .. | .. |
|---|
| 223 | 224 | u64 missing_devices; |
|---|
| 224 | 225 | u64 total_rw_bytes; |
|---|
| 225 | 226 | u64 total_devices; |
|---|
| 227 | + |
|---|
| 228 | + /* Highest generation number of seen devices */ |
|---|
| 229 | + u64 latest_generation; |
|---|
| 230 | + |
|---|
| 226 | 231 | struct block_device *latest_bdev; |
|---|
| 227 | 232 | |
|---|
| 228 | 233 | /* all of the devices in the FS, protected by a mutex |
|---|
| .. | .. |
|---|
| 232 | 237 | * this mutex lock. |
|---|
| 233 | 238 | */ |
|---|
| 234 | 239 | struct mutex device_list_mutex; |
|---|
| 240 | + |
|---|
| 241 | + /* List of all devices, protected by device_list_mutex */ |
|---|
| 235 | 242 | struct list_head devices; |
|---|
| 236 | 243 | |
|---|
| 237 | | - struct list_head resized_devices; |
|---|
| 238 | | - /* devices not currently being allocated */ |
|---|
| 244 | + /* |
|---|
| 245 | + * Devices which can satisfy space allocation. Protected by |
|---|
| 246 | + * chunk_mutex |
|---|
| 247 | + */ |
|---|
| 239 | 248 | struct list_head alloc_list; |
|---|
| 240 | 249 | |
|---|
| 241 | | - struct btrfs_fs_devices *seed; |
|---|
| 242 | | - int seeding; |
|---|
| 250 | + struct list_head seed_list; |
|---|
| 251 | + bool seeding; |
|---|
| 243 | 252 | |
|---|
| 244 | 253 | int opened; |
|---|
| 245 | 254 | |
|---|
| 246 | 255 | /* set when we find or add a device that doesn't have the |
|---|
| 247 | 256 | * nonrot flag set |
|---|
| 248 | 257 | */ |
|---|
| 249 | | - int rotating; |
|---|
| 258 | + bool rotating; |
|---|
| 250 | 259 | |
|---|
| 251 | 260 | struct btrfs_fs_info *fs_info; |
|---|
| 252 | 261 | /* sysfs kobjects */ |
|---|
| 253 | 262 | struct kobject fsid_kobj; |
|---|
| 254 | | - struct kobject *device_dir_kobj; |
|---|
| 263 | + struct kobject *devices_kobj; |
|---|
| 264 | + struct kobject *devinfo_kobj; |
|---|
| 255 | 265 | struct completion kobj_unregister; |
|---|
| 266 | + |
|---|
| 267 | + enum btrfs_chunk_allocation_policy chunk_alloc_policy; |
|---|
| 256 | 268 | }; |
|---|
| 257 | 269 | |
|---|
| 258 | 270 | #define BTRFS_BIO_INLINE_CSUM_SIZE 64 |
|---|
| .. | .. |
|---|
| 275 | 287 | * we allocate are actually btrfs_io_bios. We'll cram as much of |
|---|
| 276 | 288 | * struct btrfs_bio as we can into this over time. |
|---|
| 277 | 289 | */ |
|---|
| 278 | | -typedef void (btrfs_io_bio_end_io_t) (struct btrfs_io_bio *bio, int err); |
|---|
| 279 | 290 | struct btrfs_io_bio { |
|---|
| 280 | 291 | unsigned int mirror_num; |
|---|
| 281 | | - unsigned int stripe_index; |
|---|
| 292 | + struct btrfs_device *device; |
|---|
| 282 | 293 | u64 logical; |
|---|
| 283 | 294 | u8 *csum; |
|---|
| 284 | 295 | u8 csum_inline[BTRFS_BIO_INLINE_CSUM_SIZE]; |
|---|
| 285 | | - u8 *csum_allocated; |
|---|
| 286 | | - btrfs_io_bio_end_io_t *end_io; |
|---|
| 287 | 296 | struct bvec_iter iter; |
|---|
| 288 | 297 | /* |
|---|
| 289 | 298 | * This member must come last, bio_alloc_bioset will allocate enough |
|---|
| .. | .. |
|---|
| 297 | 306 | return container_of(bio, struct btrfs_io_bio, bio); |
|---|
| 298 | 307 | } |
|---|
| 299 | 308 | |
|---|
| 309 | +static inline void btrfs_io_bio_free_csum(struct btrfs_io_bio *io_bio) |
|---|
| 310 | +{ |
|---|
| 311 | + if (io_bio->csum != io_bio->csum_inline) { |
|---|
| 312 | + kfree(io_bio->csum); |
|---|
| 313 | + io_bio->csum = NULL; |
|---|
| 314 | + } |
|---|
| 315 | +} |
|---|
| 316 | + |
|---|
| 300 | 317 | struct btrfs_bio_stripe { |
|---|
| 301 | 318 | struct btrfs_device *dev; |
|---|
| 302 | 319 | u64 physical; |
|---|
| 303 | 320 | u64 length; /* only used for discard mappings */ |
|---|
| 304 | 321 | }; |
|---|
| 305 | | - |
|---|
| 306 | | -struct btrfs_bio; |
|---|
| 307 | | -typedef void (btrfs_bio_end_io_t) (struct btrfs_bio *bio, int err); |
|---|
| 308 | 322 | |
|---|
| 309 | 323 | struct btrfs_bio { |
|---|
| 310 | 324 | refcount_t refs; |
|---|
| .. | .. |
|---|
| 337 | 351 | }; |
|---|
| 338 | 352 | |
|---|
| 339 | 353 | struct btrfs_raid_attr { |
|---|
| 340 | | - int sub_stripes; /* sub_stripes info for map */ |
|---|
| 341 | | - int dev_stripes; /* stripes per dev */ |
|---|
| 342 | | - int devs_max; /* max devs to use */ |
|---|
| 343 | | - int devs_min; /* min devs needed */ |
|---|
| 344 | | - int tolerated_failures; /* max tolerated fail devs */ |
|---|
| 345 | | - int devs_increment; /* ndevs has to be a multiple of this */ |
|---|
| 346 | | - int ncopies; /* how many copies to data has */ |
|---|
| 347 | | - int mindev_error; /* error code if min devs requisite is unmet */ |
|---|
| 354 | + u8 sub_stripes; /* sub_stripes info for map */ |
|---|
| 355 | + u8 dev_stripes; /* stripes per dev */ |
|---|
| 356 | + u8 devs_max; /* max devs to use */ |
|---|
| 357 | + u8 devs_min; /* min devs needed */ |
|---|
| 358 | + u8 tolerated_failures; /* max tolerated fail devs */ |
|---|
| 359 | + u8 devs_increment; /* ndevs has to be a multiple of this */ |
|---|
| 360 | + u8 ncopies; /* how many copies to data has */ |
|---|
| 361 | + u8 nparity; /* number of stripes worth of bytes to store |
|---|
| 362 | + * parity information */ |
|---|
| 363 | + u8 mindev_error; /* error code if min devs requisite is unmet */ |
|---|
| 348 | 364 | const char raid_name[8]; /* name of the raid */ |
|---|
| 349 | 365 | u64 bg_flag; /* block group flag of the raid */ |
|---|
| 350 | 366 | }; |
|---|
| .. | .. |
|---|
| 393 | 409 | return BTRFS_MAP_WRITE; |
|---|
| 394 | 410 | default: |
|---|
| 395 | 411 | WARN_ON_ONCE(1); |
|---|
| 412 | + fallthrough; |
|---|
| 396 | 413 | case REQ_OP_READ: |
|---|
| 397 | 414 | return BTRFS_MAP_READ; |
|---|
| 398 | 415 | } |
|---|
| .. | .. |
|---|
| 406 | 423 | int btrfs_map_sblock(struct btrfs_fs_info *fs_info, enum btrfs_map_op op, |
|---|
| 407 | 424 | u64 logical, u64 *length, |
|---|
| 408 | 425 | struct btrfs_bio **bbio_ret); |
|---|
| 409 | | -int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start, |
|---|
| 410 | | - u64 physical, u64 **logical, int *naddrs, int *stripe_len); |
|---|
| 426 | +int btrfs_get_io_geometry(struct btrfs_fs_info *fs_info, enum btrfs_map_op op, |
|---|
| 427 | + u64 logical, u64 len, struct btrfs_io_geometry *io_geom); |
|---|
| 411 | 428 | int btrfs_read_sys_array(struct btrfs_fs_info *fs_info); |
|---|
| 412 | 429 | int btrfs_read_chunk_tree(struct btrfs_fs_info *fs_info); |
|---|
| 413 | 430 | int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, u64 type); |
|---|
| 414 | | -void btrfs_mapping_init(struct btrfs_mapping_tree *tree); |
|---|
| 415 | | -void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree); |
|---|
| 431 | +void btrfs_mapping_tree_free(struct extent_map_tree *tree); |
|---|
| 416 | 432 | blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, |
|---|
| 417 | | - int mirror_num, int async_submit); |
|---|
| 433 | + int mirror_num); |
|---|
| 418 | 434 | int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, |
|---|
| 419 | 435 | fmode_t flags, void *holder); |
|---|
| 420 | 436 | struct btrfs_device *btrfs_scan_one_device(const char *path, |
|---|
| 421 | 437 | fmode_t flags, void *holder); |
|---|
| 422 | | -int btrfs_close_devices(struct btrfs_fs_devices *fs_devices); |
|---|
| 438 | +int btrfs_forget_devices(const char *path); |
|---|
| 439 | +void btrfs_close_devices(struct btrfs_fs_devices *fs_devices); |
|---|
| 423 | 440 | void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step); |
|---|
| 424 | 441 | void btrfs_assign_next_active_device(struct btrfs_device *device, |
|---|
| 425 | 442 | struct btrfs_device *this_dev); |
|---|
| 426 | | -int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info, |
|---|
| 427 | | - const char *device_path, |
|---|
| 428 | | - struct btrfs_device **device); |
|---|
| 429 | | -int btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info, u64 devid, |
|---|
| 430 | | - const char *devpath, |
|---|
| 431 | | - struct btrfs_device **device); |
|---|
| 443 | +struct btrfs_device *btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info, |
|---|
| 444 | + u64 devid, |
|---|
| 445 | + const char *devpath); |
|---|
| 432 | 446 | struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info, |
|---|
| 433 | 447 | const u64 *devid, |
|---|
| 434 | 448 | const u8 *uuid); |
|---|
| .. | .. |
|---|
| 446 | 460 | int btrfs_balance(struct btrfs_fs_info *fs_info, |
|---|
| 447 | 461 | struct btrfs_balance_control *bctl, |
|---|
| 448 | 462 | struct btrfs_ioctl_balance_args *bargs); |
|---|
| 463 | +void btrfs_describe_block_groups(u64 flags, char *buf, u32 size_buf); |
|---|
| 449 | 464 | int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info); |
|---|
| 450 | 465 | int btrfs_recover_balance(struct btrfs_fs_info *fs_info); |
|---|
| 451 | 466 | int btrfs_pause_balance(struct btrfs_fs_info *fs_info); |
|---|
| 452 | 467 | int btrfs_cancel_balance(struct btrfs_fs_info *fs_info); |
|---|
| 453 | 468 | int btrfs_create_uuid_tree(struct btrfs_fs_info *fs_info); |
|---|
| 454 | | -int btrfs_check_uuid_tree(struct btrfs_fs_info *fs_info); |
|---|
| 469 | +int btrfs_uuid_scan_kthread(void *data); |
|---|
| 455 | 470 | int btrfs_chunk_readonly(struct btrfs_fs_info *fs_info, u64 chunk_offset); |
|---|
| 456 | | -int find_free_dev_extent_start(struct btrfs_transaction *transaction, |
|---|
| 457 | | - struct btrfs_device *device, u64 num_bytes, |
|---|
| 458 | | - u64 search_start, u64 *start, u64 *max_avail); |
|---|
| 459 | | -int find_free_dev_extent(struct btrfs_trans_handle *trans, |
|---|
| 460 | | - struct btrfs_device *device, u64 num_bytes, |
|---|
| 471 | +int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes, |
|---|
| 461 | 472 | u64 *start, u64 *max_avail); |
|---|
| 462 | 473 | void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index); |
|---|
| 463 | 474 | int btrfs_get_dev_stats(struct btrfs_fs_info *fs_info, |
|---|
| 464 | 475 | struct btrfs_ioctl_get_dev_stats *stats); |
|---|
| 465 | 476 | void btrfs_init_devices_late(struct btrfs_fs_info *fs_info); |
|---|
| 466 | 477 | int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info); |
|---|
| 467 | | -int btrfs_run_dev_stats(struct btrfs_trans_handle *trans, |
|---|
| 468 | | - struct btrfs_fs_info *fs_info); |
|---|
| 478 | +int btrfs_run_dev_stats(struct btrfs_trans_handle *trans); |
|---|
| 469 | 479 | void btrfs_rm_dev_replace_remove_srcdev(struct btrfs_device *srcdev); |
|---|
| 470 | | -void btrfs_rm_dev_replace_free_srcdev(struct btrfs_fs_info *fs_info, |
|---|
| 471 | | - struct btrfs_device *srcdev); |
|---|
| 480 | +void btrfs_rm_dev_replace_free_srcdev(struct btrfs_device *srcdev); |
|---|
| 472 | 481 | void btrfs_destroy_dev_replace_tgtdev(struct btrfs_device *tgtdev); |
|---|
| 473 | | -void btrfs_scratch_superblocks(struct block_device *bdev, const char *device_path); |
|---|
| 474 | 482 | int btrfs_is_parity_mirror(struct btrfs_fs_info *fs_info, |
|---|
| 475 | 483 | u64 logical, u64 len); |
|---|
| 476 | 484 | unsigned long btrfs_full_stripe_len(struct btrfs_fs_info *fs_info, |
|---|
| .. | .. |
|---|
| 478 | 486 | int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans, |
|---|
| 479 | 487 | u64 chunk_offset, u64 chunk_size); |
|---|
| 480 | 488 | int btrfs_remove_chunk(struct btrfs_trans_handle *trans, u64 chunk_offset); |
|---|
| 489 | +struct extent_map *btrfs_get_chunk_map(struct btrfs_fs_info *fs_info, |
|---|
| 490 | + u64 logical, u64 length); |
|---|
| 491 | +void btrfs_release_disk_super(struct btrfs_super_block *super); |
|---|
| 481 | 492 | |
|---|
| 482 | 493 | static inline void btrfs_dev_stat_inc(struct btrfs_device *dev, |
|---|
| 483 | 494 | int index) |
|---|
| .. | .. |
|---|
| 530 | 541 | atomic_inc(&dev->dev_stats_ccnt); |
|---|
| 531 | 542 | } |
|---|
| 532 | 543 | |
|---|
| 533 | | -static inline void btrfs_dev_stat_reset(struct btrfs_device *dev, |
|---|
| 534 | | - int index) |
|---|
| 535 | | -{ |
|---|
| 536 | | - btrfs_dev_stat_set(dev, index, 0); |
|---|
| 537 | | -} |
|---|
| 538 | | - |
|---|
| 539 | 544 | /* |
|---|
| 540 | 545 | * Convert block group flags (BTRFS_BLOCK_GROUP_*) to btrfs_raid_types, which |
|---|
| 541 | 546 | * can be used as index to access btrfs_raid_array[]. |
|---|
| .. | .. |
|---|
| 546 | 551 | return BTRFS_RAID_RAID10; |
|---|
| 547 | 552 | else if (flags & BTRFS_BLOCK_GROUP_RAID1) |
|---|
| 548 | 553 | return BTRFS_RAID_RAID1; |
|---|
| 554 | + else if (flags & BTRFS_BLOCK_GROUP_RAID1C3) |
|---|
| 555 | + return BTRFS_RAID_RAID1C3; |
|---|
| 556 | + else if (flags & BTRFS_BLOCK_GROUP_RAID1C4) |
|---|
| 557 | + return BTRFS_RAID_RAID1C4; |
|---|
| 549 | 558 | else if (flags & BTRFS_BLOCK_GROUP_DUP) |
|---|
| 550 | 559 | return BTRFS_RAID_DUP; |
|---|
| 551 | 560 | else if (flags & BTRFS_BLOCK_GROUP_RAID0) |
|---|
| .. | .. |
|---|
| 558 | 567 | return BTRFS_RAID_SINGLE; /* BTRFS_BLOCK_GROUP_SINGLE */ |
|---|
| 559 | 568 | } |
|---|
| 560 | 569 | |
|---|
| 561 | | -const char *get_raid_name(enum btrfs_raid_types type); |
|---|
| 570 | +void btrfs_commit_device_sizes(struct btrfs_transaction *trans); |
|---|
| 562 | 571 | |
|---|
| 563 | | -void btrfs_update_commit_device_size(struct btrfs_fs_info *fs_info); |
|---|
| 564 | | -void btrfs_update_commit_device_bytes_used(struct btrfs_transaction *trans); |
|---|
| 565 | | - |
|---|
| 566 | | -struct list_head *btrfs_get_fs_uuids(void); |
|---|
| 567 | | -void btrfs_set_fs_info_ptr(struct btrfs_fs_info *fs_info); |
|---|
| 568 | | -void btrfs_reset_fs_info_ptr(struct btrfs_fs_info *fs_info); |
|---|
| 572 | +struct list_head * __attribute_const__ btrfs_get_fs_uuids(void); |
|---|
| 569 | 573 | bool btrfs_check_rw_degradable(struct btrfs_fs_info *fs_info, |
|---|
| 570 | 574 | struct btrfs_device *failing_dev); |
|---|
| 575 | +void btrfs_scratch_superblocks(struct btrfs_fs_info *fs_info, |
|---|
| 576 | + struct block_device *bdev, |
|---|
| 577 | + const char *device_path); |
|---|
| 571 | 578 | |
|---|
| 572 | 579 | int btrfs_bg_type_to_factor(u64 flags); |
|---|
| 580 | +const char *btrfs_bg_type_to_raid_name(u64 flags); |
|---|
| 573 | 581 | int btrfs_verify_dev_extents(struct btrfs_fs_info *fs_info); |
|---|
| 574 | 582 | |
|---|
| 575 | 583 | #endif |
|---|