aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h42
1 files changed, 38 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index e7d40791ec9f..0d50c57caf5d 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -23,6 +23,7 @@
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/highmem.h> 24#include <linux/highmem.h>
25#include <linux/fs.h> 25#include <linux/fs.h>
26#include <linux/rwsem.h>
26#include <linux/completion.h> 27#include <linux/completion.h>
27#include <linux/backing-dev.h> 28#include <linux/backing-dev.h>
28#include <linux/wait.h> 29#include <linux/wait.h>
@@ -33,6 +34,7 @@
33#include "extent_io.h" 34#include "extent_io.h"
34#include "extent_map.h" 35#include "extent_map.h"
35#include "async-thread.h" 36#include "async-thread.h"
37#include "ioctl.h"
36 38
37struct btrfs_trans_handle; 39struct btrfs_trans_handle;
38struct btrfs_transaction; 40struct btrfs_transaction;
@@ -193,7 +195,6 @@ struct btrfs_mapping_tree {
193 struct extent_map_tree map_tree; 195 struct extent_map_tree map_tree;
194}; 196};
195 197
196#define BTRFS_UUID_SIZE 16
197struct btrfs_dev_item { 198struct btrfs_dev_item {
198 /* the internal btrfs device id */ 199 /* the internal btrfs device id */
199 __le64 devid; 200 __le64 devid;
@@ -300,7 +301,6 @@ static inline unsigned long btrfs_chunk_item_size(int num_stripes)
300 sizeof(struct btrfs_stripe) * (num_stripes - 1); 301 sizeof(struct btrfs_stripe) * (num_stripes - 1);
301} 302}
302 303
303#define BTRFS_FSID_SIZE 16
304#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0) 304#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0)
305#define BTRFS_HEADER_FLAG_RELOC (1ULL << 1) 305#define BTRFS_HEADER_FLAG_RELOC (1ULL << 1)
306 306
@@ -516,6 +516,12 @@ struct btrfs_extent_item_v0 {
516/* use full backrefs for extent pointers in the block */ 516/* use full backrefs for extent pointers in the block */
517#define BTRFS_BLOCK_FLAG_FULL_BACKREF (1ULL << 8) 517#define BTRFS_BLOCK_FLAG_FULL_BACKREF (1ULL << 8)
518 518
519/*
520 * this flag is only used internally by scrub and may be changed at any time
521 * it is only declared here to avoid collisions
522 */
523#define BTRFS_EXTENT_FLAG_SUPER (1ULL << 48)
524
519struct btrfs_tree_block_info { 525struct btrfs_tree_block_info {
520 struct btrfs_disk_key key; 526 struct btrfs_disk_key key;
521 u8 level; 527 u8 level;
@@ -1083,6 +1089,17 @@ struct btrfs_fs_info {
1083 1089
1084 void *bdev_holder; 1090 void *bdev_holder;
1085 1091
1092 /* private scrub information */
1093 struct mutex scrub_lock;
1094 atomic_t scrubs_running;
1095 atomic_t scrub_pause_req;
1096 atomic_t scrubs_paused;
1097 atomic_t scrub_cancel_req;
1098 wait_queue_head_t scrub_pause_wait;
1099 struct rw_semaphore scrub_super_lock;
1100 int scrub_workers_refcnt;
1101 struct btrfs_workers scrub_workers;
1102
1086 /* filesystem state */ 1103 /* filesystem state */
1087 u64 fs_state; 1104 u64 fs_state;
1088 1105
@@ -2422,8 +2439,11 @@ struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans,
2422 struct btrfs_root *root, 2439 struct btrfs_root *root,
2423 struct btrfs_path *path, 2440 struct btrfs_path *path,
2424 u64 bytenr, int cow); 2441 u64 bytenr, int cow);
2425int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, 2442int btrfs_csum_truncate(struct btrfs_trans_handle *trans,
2426 u64 end, struct list_head *list); 2443 struct btrfs_root *root, struct btrfs_path *path,
2444 u64 isize);
2445int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
2446 struct list_head *list, int search_commit);
2427/* inode.c */ 2447/* inode.c */
2428 2448
2429/* RHEL and EL kernels have a patch that renames PG_checked to FsMisc */ 2449/* RHEL and EL kernels have a patch that renames PG_checked to FsMisc */
@@ -2577,4 +2597,18 @@ void btrfs_reloc_pre_snapshot(struct btrfs_trans_handle *trans,
2577 u64 *bytes_to_reserve); 2597 u64 *bytes_to_reserve);
2578void btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans, 2598void btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans,
2579 struct btrfs_pending_snapshot *pending); 2599 struct btrfs_pending_snapshot *pending);
2600
2601/* scrub.c */
2602int btrfs_scrub_dev(struct btrfs_root *root, u64 devid, u64 start, u64 end,
2603 struct btrfs_scrub_progress *progress, int readonly);
2604int btrfs_scrub_pause(struct btrfs_root *root);
2605int btrfs_scrub_pause_super(struct btrfs_root *root);
2606int btrfs_scrub_continue(struct btrfs_root *root);
2607int btrfs_scrub_continue_super(struct btrfs_root *root);
2608int btrfs_scrub_cancel(struct btrfs_root *root);
2609int btrfs_scrub_cancel_dev(struct btrfs_root *root, struct btrfs_device *dev);
2610int btrfs_scrub_cancel_devid(struct btrfs_root *root, u64 devid);
2611int btrfs_scrub_progress(struct btrfs_root *root, u64 devid,
2612 struct btrfs_scrub_progress *progress);
2613
2580#endif 2614#endif