volumes.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2007 Oracle. All rights reserved.
  4. */
  5. #ifndef BTRFS_VOLUMES_H
  6. #define BTRFS_VOLUMES_H
  7. #include <linux/bio.h>
  8. #include <linux/sort.h>
  9. #include <linux/btrfs.h>
  10. #include "async-thread.h"
  11. #define BTRFS_MAX_DATA_CHUNK_SIZE (10ULL * SZ_1G)
  12. extern struct mutex uuid_mutex;
  13. #define BTRFS_STRIPE_LEN SZ_64K
  14. struct buffer_head;
  15. struct btrfs_pending_bios {
  16. struct bio *head;
  17. struct bio *tail;
  18. };
  19. struct btrfs_io_geometry {
  20. /* remaining bytes before crossing a stripe */
  21. u64 len;
  22. /* offset of logical address in chunk */
  23. u64 offset;
  24. /* length of single IO stripe */
  25. u64 stripe_len;
  26. /* number of stripe where address falls */
  27. u64 stripe_nr;
  28. /* offset of address in stripe */
  29. u64 stripe_offset;
  30. /* offset of raid56 stripe into the chunk */
  31. u64 raid56_stripe_offset;
  32. };
  33. /*
  34. * Use sequence counter to get consistent device stat data on
  35. * 32-bit processors.
  36. */
  37. #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
  38. #include <linux/seqlock.h>
  39. #define __BTRFS_NEED_DEVICE_DATA_ORDERED
  40. #define btrfs_device_data_ordered_init(device) \
  41. seqcount_init(&device->data_seqcount)
  42. #else
  43. #define btrfs_device_data_ordered_init(device) do { } while (0)
  44. #endif
  45. #define BTRFS_DEV_STATE_WRITEABLE (0)
  46. #define BTRFS_DEV_STATE_IN_FS_METADATA (1)
  47. #define BTRFS_DEV_STATE_MISSING (2)
  48. #define BTRFS_DEV_STATE_REPLACE_TGT (3)
  49. #define BTRFS_DEV_STATE_FLUSH_SENT (4)
  50. #define BTRFS_DEV_STATE_NO_READA (5)
  51. struct btrfs_device {
  52. struct list_head dev_list; /* device_list_mutex */
  53. struct list_head dev_alloc_list; /* chunk mutex */
  54. struct list_head post_commit_list; /* chunk mutex */
  55. struct btrfs_fs_devices *fs_devices;
  56. struct btrfs_fs_info *fs_info;
  57. struct rcu_string *name;
  58. u64 generation;
  59. spinlock_t io_lock ____cacheline_aligned;
  60. int running_pending;
  61. /* regular prio bios */
  62. struct btrfs_pending_bios pending_bios;
  63. /* sync bios */
  64. struct btrfs_pending_bios pending_sync_bios;
  65. struct block_device *bdev;
  66. /* the mode sent to blkdev_get */
  67. fmode_t mode;
  68. unsigned long dev_state;
  69. blk_status_t last_flush_error;
  70. #ifdef __BTRFS_NEED_DEVICE_DATA_ORDERED
  71. seqcount_t data_seqcount;
  72. #endif
  73. /* the internal btrfs device id */
  74. u64 devid;
  75. /* size of the device in memory */
  76. u64 total_bytes;
  77. /* size of the device on disk */
  78. u64 disk_total_bytes;
  79. /* bytes used */
  80. u64 bytes_used;
  81. /* optimal io alignment for this device */
  82. u32 io_align;
  83. /* optimal io width for this device */
  84. u32 io_width;
  85. /* type and info about this device */
  86. u64 type;
  87. /* minimal io size for this device */
  88. u32 sector_size;
  89. /* physical drive uuid (or lvm uuid) */
  90. u8 uuid[BTRFS_UUID_SIZE];
  91. /*
  92. * size of the device on the current transaction
  93. *
  94. * This variant is update when committing the transaction,
  95. * and protected by chunk mutex
  96. */
  97. u64 commit_total_bytes;
  98. /* bytes used on the current transaction */
  99. u64 commit_bytes_used;
  100. /* for sending down flush barriers */
  101. struct bio *flush_bio;
  102. struct completion flush_wait;
  103. /* per-device scrub information */
  104. struct scrub_ctx *scrub_ctx;
  105. struct btrfs_work work;
  106. /* readahead state */
  107. atomic_t reada_in_flight;
  108. u64 reada_next;
  109. struct reada_zone *reada_curr_zone;
  110. struct radix_tree_root reada_zones;
  111. struct radix_tree_root reada_extents;
  112. /* disk I/O failure stats. For detailed description refer to
  113. * enum btrfs_dev_stat_values in ioctl.h */
  114. int dev_stats_valid;
  115. /* Counter to record the change of device stats */
  116. atomic_t dev_stats_ccnt;
  117. atomic_t dev_stat_values[BTRFS_DEV_STAT_VALUES_MAX];
  118. struct extent_io_tree alloc_state;
  119. };
  120. /*
  121. * If we read those variants at the context of their own lock, we needn't
  122. * use the following helpers, reading them directly is safe.
  123. */
  124. #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
  125. #define BTRFS_DEVICE_GETSET_FUNCS(name) \
  126. static inline u64 \
  127. btrfs_device_get_##name(const struct btrfs_device *dev) \
  128. { \
  129. u64 size; \
  130. unsigned int seq; \
  131. \
  132. do { \
  133. seq = read_seqcount_begin(&dev->data_seqcount); \
  134. size = dev->name; \
  135. } while (read_seqcount_retry(&dev->data_seqcount, seq)); \
  136. return size; \
  137. } \
  138. \
  139. static inline void \
  140. btrfs_device_set_##name(struct btrfs_device *dev, u64 size) \
  141. { \
  142. preempt_disable(); \
  143. write_seqcount_begin(&dev->data_seqcount); \
  144. dev->name = size; \
  145. write_seqcount_end(&dev->data_seqcount); \
  146. preempt_enable(); \
  147. }
  148. #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
  149. #define BTRFS_DEVICE_GETSET_FUNCS(name) \
  150. static inline u64 \
  151. btrfs_device_get_##name(const struct btrfs_device *dev) \
  152. { \
  153. u64 size; \
  154. \
  155. preempt_disable(); \
  156. size = dev->name; \
  157. preempt_enable(); \
  158. return size; \
  159. } \
  160. \
  161. static inline void \
  162. btrfs_device_set_##name(struct btrfs_device *dev, u64 size) \
  163. { \
  164. preempt_disable(); \
  165. dev->name = size; \
  166. preempt_enable(); \
  167. }
  168. #else
  169. #define BTRFS_DEVICE_GETSET_FUNCS(name) \
  170. static inline u64 \
  171. btrfs_device_get_##name(const struct btrfs_device *dev) \
  172. { \
  173. return dev->name; \
  174. } \
  175. \
  176. static inline void \
  177. btrfs_device_set_##name(struct btrfs_device *dev, u64 size) \
  178. { \
  179. dev->name = size; \
  180. }
  181. #endif
  182. BTRFS_DEVICE_GETSET_FUNCS(total_bytes);
  183. BTRFS_DEVICE_GETSET_FUNCS(disk_total_bytes);
  184. BTRFS_DEVICE_GETSET_FUNCS(bytes_used);
  185. struct btrfs_fs_devices {
  186. u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
  187. u8 metadata_uuid[BTRFS_FSID_SIZE];
  188. bool fsid_change;
  189. struct list_head fs_list;
  190. u64 num_devices;
  191. u64 open_devices;
  192. u64 rw_devices;
  193. u64 missing_devices;
  194. u64 total_rw_bytes;
  195. u64 total_devices;
  196. /* Highest generation number of seen devices */
  197. u64 latest_generation;
  198. struct block_device *latest_bdev;
  199. /* all of the devices in the FS, protected by a mutex
  200. * so we can safely walk it to write out the supers without
  201. * worrying about add/remove by the multi-device code.
  202. * Scrubbing super can kick off supers writing by holding
  203. * this mutex lock.
  204. */
  205. struct mutex device_list_mutex;
  206. /* List of all devices, protected by device_list_mutex */
  207. struct list_head devices;
  208. /*
  209. * Devices which can satisfy space allocation. Protected by
  210. * chunk_mutex
  211. */
  212. struct list_head alloc_list;
  213. struct btrfs_fs_devices *seed;
  214. int seeding;
  215. int opened;
  216. /* set when we find or add a device that doesn't have the
  217. * nonrot flag set
  218. */
  219. int rotating;
  220. struct btrfs_fs_info *fs_info;
  221. /* sysfs kobjects */
  222. struct kobject fsid_kobj;
  223. struct kobject *device_dir_kobj;
  224. struct completion kobj_unregister;
  225. };
  226. #define BTRFS_BIO_INLINE_CSUM_SIZE 64
  227. #define BTRFS_MAX_DEVS(info) ((BTRFS_MAX_ITEM_SIZE(info) \
  228. - sizeof(struct btrfs_chunk)) \
  229. / sizeof(struct btrfs_stripe) + 1)
  230. #define BTRFS_MAX_DEVS_SYS_CHUNK ((BTRFS_SYSTEM_CHUNK_ARRAY_SIZE \
  231. - 2 * sizeof(struct btrfs_disk_key) \
  232. - 2 * sizeof(struct btrfs_chunk)) \
  233. / sizeof(struct btrfs_stripe) + 1)
  234. /*
  235. * we need the mirror number and stripe index to be passed around
  236. * the call chain while we are processing end_io (especially errors).
  237. * Really, what we need is a btrfs_bio structure that has this info
  238. * and is properly sized with its stripe array, but we're not there
  239. * quite yet. We have our own btrfs bioset, and all of the bios
  240. * we allocate are actually btrfs_io_bios. We'll cram as much of
  241. * struct btrfs_bio as we can into this over time.
  242. */
  243. struct btrfs_io_bio {
  244. unsigned int mirror_num;
  245. unsigned int stripe_index;
  246. u64 logical;
  247. u8 *csum;
  248. u8 csum_inline[BTRFS_BIO_INLINE_CSUM_SIZE];
  249. struct bvec_iter iter;
  250. /*
  251. * This member must come last, bio_alloc_bioset will allocate enough
  252. * bytes for entire btrfs_io_bio but relies on bio being last.
  253. */
  254. struct bio bio;
  255. };
  256. static inline struct btrfs_io_bio *btrfs_io_bio(struct bio *bio)
  257. {
  258. return container_of(bio, struct btrfs_io_bio, bio);
  259. }
  260. static inline void btrfs_io_bio_free_csum(struct btrfs_io_bio *io_bio)
  261. {
  262. if (io_bio->csum != io_bio->csum_inline) {
  263. kfree(io_bio->csum);
  264. io_bio->csum = NULL;
  265. }
  266. }
  267. struct btrfs_bio_stripe {
  268. struct btrfs_device *dev;
  269. u64 physical;
  270. u64 length; /* only used for discard mappings */
  271. };
  272. struct btrfs_bio {
  273. refcount_t refs;
  274. atomic_t stripes_pending;
  275. struct btrfs_fs_info *fs_info;
  276. u64 map_type; /* get from map_lookup->type */
  277. bio_end_io_t *end_io;
  278. struct bio *orig_bio;
  279. void *private;
  280. atomic_t error;
  281. int max_errors;
  282. int num_stripes;
  283. int mirror_num;
  284. int num_tgtdevs;
  285. int *tgtdev_map;
  286. /*
  287. * logical block numbers for the start of each stripe
  288. * The last one or two are p/q. These are sorted,
  289. * so raid_map[0] is the start of our full stripe
  290. */
  291. u64 *raid_map;
  292. struct btrfs_bio_stripe stripes[];
  293. };
  294. struct btrfs_device_info {
  295. struct btrfs_device *dev;
  296. u64 dev_offset;
  297. u64 max_avail;
  298. u64 total_avail;
  299. };
  300. struct btrfs_raid_attr {
  301. u8 sub_stripes; /* sub_stripes info for map */
  302. u8 dev_stripes; /* stripes per dev */
  303. u8 devs_max; /* max devs to use */
  304. u8 devs_min; /* min devs needed */
  305. u8 tolerated_failures; /* max tolerated fail devs */
  306. u8 devs_increment; /* ndevs has to be a multiple of this */
  307. u8 ncopies; /* how many copies to data has */
  308. u8 nparity; /* number of stripes worth of bytes to store
  309. * parity information */
  310. u8 mindev_error; /* error code if min devs requisite is unmet */
  311. const char raid_name[8]; /* name of the raid */
  312. u64 bg_flag; /* block group flag of the raid */
  313. };
  314. extern const struct btrfs_raid_attr btrfs_raid_array[BTRFS_NR_RAID_TYPES];
  315. struct map_lookup {
  316. u64 type;
  317. int io_align;
  318. int io_width;
  319. u64 stripe_len;
  320. int num_stripes;
  321. int sub_stripes;
  322. int verified_stripes; /* For mount time dev extent verification */
  323. struct btrfs_bio_stripe stripes[];
  324. };
  325. #define map_lookup_size(n) (sizeof(struct map_lookup) + \
  326. (sizeof(struct btrfs_bio_stripe) * (n)))
  327. struct btrfs_balance_args;
  328. struct btrfs_balance_progress;
  329. struct btrfs_balance_control {
  330. struct btrfs_balance_args data;
  331. struct btrfs_balance_args meta;
  332. struct btrfs_balance_args sys;
  333. u64 flags;
  334. struct btrfs_balance_progress stat;
  335. };
  336. enum btrfs_map_op {
  337. BTRFS_MAP_READ,
  338. BTRFS_MAP_WRITE,
  339. BTRFS_MAP_DISCARD,
  340. BTRFS_MAP_GET_READ_MIRRORS,
  341. };
  342. static inline enum btrfs_map_op btrfs_op(struct bio *bio)
  343. {
  344. switch (bio_op(bio)) {
  345. case REQ_OP_DISCARD:
  346. return BTRFS_MAP_DISCARD;
  347. case REQ_OP_WRITE:
  348. return BTRFS_MAP_WRITE;
  349. default:
  350. WARN_ON_ONCE(1);
  351. /* fall through */
  352. case REQ_OP_READ:
  353. return BTRFS_MAP_READ;
  354. }
  355. }
  356. void btrfs_get_bbio(struct btrfs_bio *bbio);
  357. void btrfs_put_bbio(struct btrfs_bio *bbio);
  358. int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
  359. u64 logical, u64 *length,
  360. struct btrfs_bio **bbio_ret, int mirror_num);
  361. int btrfs_map_sblock(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
  362. u64 logical, u64 *length,
  363. struct btrfs_bio **bbio_ret);
  364. int btrfs_get_io_geometry(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
  365. u64 logical, u64 len, struct btrfs_io_geometry *io_geom);
  366. int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start,
  367. u64 physical, u64 **logical, int *naddrs, int *stripe_len);
  368. int btrfs_read_sys_array(struct btrfs_fs_info *fs_info);
  369. int btrfs_read_chunk_tree(struct btrfs_fs_info *fs_info);
  370. int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, u64 type);
  371. void btrfs_mapping_tree_free(struct extent_map_tree *tree);
  372. blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
  373. int mirror_num, int async_submit);
  374. int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
  375. fmode_t flags, void *holder);
  376. struct btrfs_device *btrfs_scan_one_device(const char *path,
  377. fmode_t flags, void *holder);
  378. int btrfs_forget_devices(const char *path);
  379. int btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
  380. void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step);
  381. void btrfs_assign_next_active_device(struct btrfs_device *device,
  382. struct btrfs_device *this_dev);
  383. struct btrfs_device *btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info,
  384. u64 devid,
  385. const char *devpath);
  386. struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info,
  387. const u64 *devid,
  388. const u8 *uuid);
  389. void btrfs_free_device(struct btrfs_device *device);
  390. int btrfs_rm_device(struct btrfs_fs_info *fs_info,
  391. const char *device_path, u64 devid);
  392. void __exit btrfs_cleanup_fs_uuids(void);
  393. int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len);
  394. int btrfs_grow_device(struct btrfs_trans_handle *trans,
  395. struct btrfs_device *device, u64 new_size);
  396. struct btrfs_device *btrfs_find_device(struct btrfs_fs_devices *fs_devices,
  397. u64 devid, u8 *uuid, u8 *fsid, bool seed);
  398. int btrfs_shrink_device(struct btrfs_device *device, u64 new_size);
  399. int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path);
  400. int btrfs_balance(struct btrfs_fs_info *fs_info,
  401. struct btrfs_balance_control *bctl,
  402. struct btrfs_ioctl_balance_args *bargs);
  403. void btrfs_describe_block_groups(u64 flags, char *buf, u32 size_buf);
  404. int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info);
  405. int btrfs_recover_balance(struct btrfs_fs_info *fs_info);
  406. int btrfs_pause_balance(struct btrfs_fs_info *fs_info);
  407. int btrfs_cancel_balance(struct btrfs_fs_info *fs_info);
  408. int btrfs_create_uuid_tree(struct btrfs_fs_info *fs_info);
  409. int btrfs_check_uuid_tree(struct btrfs_fs_info *fs_info);
  410. int btrfs_chunk_readonly(struct btrfs_fs_info *fs_info, u64 chunk_offset);
  411. int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes,
  412. u64 *start, u64 *max_avail);
  413. void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index);
  414. int btrfs_get_dev_stats(struct btrfs_fs_info *fs_info,
  415. struct btrfs_ioctl_get_dev_stats *stats);
  416. void btrfs_init_devices_late(struct btrfs_fs_info *fs_info);
  417. int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info);
  418. int btrfs_run_dev_stats(struct btrfs_trans_handle *trans);
  419. void btrfs_rm_dev_replace_remove_srcdev(struct btrfs_device *srcdev);
  420. void btrfs_rm_dev_replace_free_srcdev(struct btrfs_device *srcdev);
  421. void btrfs_destroy_dev_replace_tgtdev(struct btrfs_device *tgtdev);
  422. void btrfs_scratch_superblocks(struct block_device *bdev, const char *device_path);
  423. int btrfs_is_parity_mirror(struct btrfs_fs_info *fs_info,
  424. u64 logical, u64 len);
  425. unsigned long btrfs_full_stripe_len(struct btrfs_fs_info *fs_info,
  426. u64 logical);
  427. int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans,
  428. u64 chunk_offset, u64 chunk_size);
  429. int btrfs_remove_chunk(struct btrfs_trans_handle *trans, u64 chunk_offset);
  430. struct extent_map *btrfs_get_chunk_map(struct btrfs_fs_info *fs_info,
  431. u64 logical, u64 length);
  432. static inline void btrfs_dev_stat_inc(struct btrfs_device *dev,
  433. int index)
  434. {
  435. atomic_inc(dev->dev_stat_values + index);
  436. /*
  437. * This memory barrier orders stores updating statistics before stores
  438. * updating dev_stats_ccnt.
  439. *
  440. * It pairs with smp_rmb() in btrfs_run_dev_stats().
  441. */
  442. smp_mb__before_atomic();
  443. atomic_inc(&dev->dev_stats_ccnt);
  444. }
  445. static inline int btrfs_dev_stat_read(struct btrfs_device *dev,
  446. int index)
  447. {
  448. return atomic_read(dev->dev_stat_values + index);
  449. }
  450. static inline int btrfs_dev_stat_read_and_reset(struct btrfs_device *dev,
  451. int index)
  452. {
  453. int ret;
  454. ret = atomic_xchg(dev->dev_stat_values + index, 0);
  455. /*
  456. * atomic_xchg implies a full memory barriers as per atomic_t.txt:
  457. * - RMW operations that have a return value are fully ordered;
  458. *
  459. * This implicit memory barriers is paired with the smp_rmb in
  460. * btrfs_run_dev_stats
  461. */
  462. atomic_inc(&dev->dev_stats_ccnt);
  463. return ret;
  464. }
  465. static inline void btrfs_dev_stat_set(struct btrfs_device *dev,
  466. int index, unsigned long val)
  467. {
  468. atomic_set(dev->dev_stat_values + index, val);
  469. /*
  470. * This memory barrier orders stores updating statistics before stores
  471. * updating dev_stats_ccnt.
  472. *
  473. * It pairs with smp_rmb() in btrfs_run_dev_stats().
  474. */
  475. smp_mb__before_atomic();
  476. atomic_inc(&dev->dev_stats_ccnt);
  477. }
  478. /*
  479. * Convert block group flags (BTRFS_BLOCK_GROUP_*) to btrfs_raid_types, which
  480. * can be used as index to access btrfs_raid_array[].
  481. */
  482. static inline enum btrfs_raid_types btrfs_bg_flags_to_raid_index(u64 flags)
  483. {
  484. if (flags & BTRFS_BLOCK_GROUP_RAID10)
  485. return BTRFS_RAID_RAID10;
  486. else if (flags & BTRFS_BLOCK_GROUP_RAID1)
  487. return BTRFS_RAID_RAID1;
  488. else if (flags & BTRFS_BLOCK_GROUP_DUP)
  489. return BTRFS_RAID_DUP;
  490. else if (flags & BTRFS_BLOCK_GROUP_RAID0)
  491. return BTRFS_RAID_RAID0;
  492. else if (flags & BTRFS_BLOCK_GROUP_RAID5)
  493. return BTRFS_RAID_RAID5;
  494. else if (flags & BTRFS_BLOCK_GROUP_RAID6)
  495. return BTRFS_RAID_RAID6;
  496. return BTRFS_RAID_SINGLE; /* BTRFS_BLOCK_GROUP_SINGLE */
  497. }
  498. void btrfs_commit_device_sizes(struct btrfs_transaction *trans);
  499. struct list_head *btrfs_get_fs_uuids(void);
  500. void btrfs_set_fs_info_ptr(struct btrfs_fs_info *fs_info);
  501. void btrfs_reset_fs_info_ptr(struct btrfs_fs_info *fs_info);
  502. bool btrfs_check_rw_degradable(struct btrfs_fs_info *fs_info,
  503. struct btrfs_device *failing_dev);
  504. int btrfs_bg_type_to_factor(u64 flags);
  505. const char *btrfs_bg_type_to_raid_name(u64 flags);
  506. int btrfs_verify_dev_extents(struct btrfs_fs_info *fs_info);
  507. #endif