aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 5a240f5e6ceb..db21a1360e13 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -96,8 +96,7 @@ struct scrub_bio {
96#endif 96#endif
97 int page_count; 97 int page_count;
98 int next_free; 98 int next_free;
99 struct btrfs_work_struct 99 struct btrfs_work work;
100 work;
101}; 100};
102 101
103struct scrub_block { 102struct scrub_block {
@@ -155,8 +154,7 @@ struct scrub_fixup_nodatasum {
155 struct btrfs_device *dev; 154 struct btrfs_device *dev;
156 u64 logical; 155 u64 logical;
157 struct btrfs_root *root; 156 struct btrfs_root *root;
158 struct btrfs_work_struct 157 struct btrfs_work work;
159 work;
160 int mirror_num; 158 int mirror_num;
161}; 159};
162 160
@@ -174,8 +172,7 @@ struct scrub_copy_nocow_ctx {
174 int mirror_num; 172 int mirror_num;
175 u64 physical_for_dev_replace; 173 u64 physical_for_dev_replace;
176 struct list_head inodes; 174 struct list_head inodes;
177 struct btrfs_work_struct 175 struct btrfs_work work;
178 work;
179}; 176};
180 177
181struct scrub_warning { 178struct scrub_warning {
@@ -234,7 +231,7 @@ static int scrub_pages(struct scrub_ctx *sctx, u64 logical, u64 len,
234 u64 gen, int mirror_num, u8 *csum, int force, 231 u64 gen, int mirror_num, u8 *csum, int force,
235 u64 physical_for_dev_replace); 232 u64 physical_for_dev_replace);
236static void scrub_bio_end_io(struct bio *bio, int err); 233static void scrub_bio_end_io(struct bio *bio, int err);
237static void scrub_bio_end_io_worker(struct btrfs_work_struct *work); 234static void scrub_bio_end_io_worker(struct btrfs_work *work);
238static void scrub_block_complete(struct scrub_block *sblock); 235static void scrub_block_complete(struct scrub_block *sblock);
239static void scrub_remap_extent(struct btrfs_fs_info *fs_info, 236static void scrub_remap_extent(struct btrfs_fs_info *fs_info,
240 u64 extent_logical, u64 extent_len, 237 u64 extent_logical, u64 extent_len,
@@ -251,14 +248,14 @@ static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx,
251 struct scrub_page *spage); 248 struct scrub_page *spage);
252static void scrub_wr_submit(struct scrub_ctx *sctx); 249static void scrub_wr_submit(struct scrub_ctx *sctx);
253static void scrub_wr_bio_end_io(struct bio *bio, int err); 250static void scrub_wr_bio_end_io(struct bio *bio, int err);
254static void scrub_wr_bio_end_io_worker(struct btrfs_work_struct *work); 251static void scrub_wr_bio_end_io_worker(struct btrfs_work *work);
255static int write_page_nocow(struct scrub_ctx *sctx, 252static int write_page_nocow(struct scrub_ctx *sctx,
256 u64 physical_for_dev_replace, struct page *page); 253 u64 physical_for_dev_replace, struct page *page);
257static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, 254static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root,
258 struct scrub_copy_nocow_ctx *ctx); 255 struct scrub_copy_nocow_ctx *ctx);
259static int copy_nocow_pages(struct scrub_ctx *sctx, u64 logical, u64 len, 256static int copy_nocow_pages(struct scrub_ctx *sctx, u64 logical, u64 len,
260 int mirror_num, u64 physical_for_dev_replace); 257 int mirror_num, u64 physical_for_dev_replace);
261static void copy_nocow_pages_worker(struct btrfs_work_struct *work); 258static void copy_nocow_pages_worker(struct btrfs_work *work);
262static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info); 259static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info);
263static void scrub_blocked_if_needed(struct btrfs_fs_info *fs_info); 260static void scrub_blocked_if_needed(struct btrfs_fs_info *fs_info);
264 261
@@ -737,7 +734,7 @@ out:
737 return -EIO; 734 return -EIO;
738} 735}
739 736
740static void scrub_fixup_nodatasum(struct btrfs_work_struct *work) 737static void scrub_fixup_nodatasum(struct btrfs_work *work)
741{ 738{
742 int ret; 739 int ret;
743 struct scrub_fixup_nodatasum *fixup; 740 struct scrub_fixup_nodatasum *fixup;
@@ -1622,7 +1619,7 @@ static void scrub_wr_bio_end_io(struct bio *bio, int err)
1622 btrfs_queue_work(fs_info->scrub_wr_completion_workers, &sbio->work); 1619 btrfs_queue_work(fs_info->scrub_wr_completion_workers, &sbio->work);
1623} 1620}
1624 1621
1625static void scrub_wr_bio_end_io_worker(struct btrfs_work_struct *work) 1622static void scrub_wr_bio_end_io_worker(struct btrfs_work *work)
1626{ 1623{
1627 struct scrub_bio *sbio = container_of(work, struct scrub_bio, work); 1624 struct scrub_bio *sbio = container_of(work, struct scrub_bio, work);
1628 struct scrub_ctx *sctx = sbio->sctx; 1625 struct scrub_ctx *sctx = sbio->sctx;
@@ -2090,7 +2087,7 @@ static void scrub_bio_end_io(struct bio *bio, int err)
2090 btrfs_queue_work(fs_info->scrub_workers, &sbio->work); 2087 btrfs_queue_work(fs_info->scrub_workers, &sbio->work);
2091} 2088}
2092 2089
2093static void scrub_bio_end_io_worker(struct btrfs_work_struct *work) 2090static void scrub_bio_end_io_worker(struct btrfs_work *work)
2094{ 2091{
2095 struct scrub_bio *sbio = container_of(work, struct scrub_bio, work); 2092 struct scrub_bio *sbio = container_of(work, struct scrub_bio, work);
2096 struct scrub_ctx *sctx = sbio->sctx; 2093 struct scrub_ctx *sctx = sbio->sctx;
@@ -3161,7 +3158,7 @@ static int record_inode_for_nocow(u64 inum, u64 offset, u64 root, void *ctx)
3161 3158
3162#define COPY_COMPLETE 1 3159#define COPY_COMPLETE 1
3163 3160
3164static void copy_nocow_pages_worker(struct btrfs_work_struct *work) 3161static void copy_nocow_pages_worker(struct btrfs_work *work)
3165{ 3162{
3166 struct scrub_copy_nocow_ctx *nocow_ctx = 3163 struct scrub_copy_nocow_ctx *nocow_ctx =
3167 container_of(work, struct scrub_copy_nocow_ctx, work); 3164 container_of(work, struct scrub_copy_nocow_ctx, work);