diff options
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 23 |
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 | ||
103 | struct scrub_block { | 102 | struct 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 | ||
181 | struct scrub_warning { | 178 | struct 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); |
236 | static void scrub_bio_end_io(struct bio *bio, int err); | 233 | static void scrub_bio_end_io(struct bio *bio, int err); |
237 | static void scrub_bio_end_io_worker(struct btrfs_work_struct *work); | 234 | static void scrub_bio_end_io_worker(struct btrfs_work *work); |
238 | static void scrub_block_complete(struct scrub_block *sblock); | 235 | static void scrub_block_complete(struct scrub_block *sblock); |
239 | static void scrub_remap_extent(struct btrfs_fs_info *fs_info, | 236 | static 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); |
252 | static void scrub_wr_submit(struct scrub_ctx *sctx); | 249 | static void scrub_wr_submit(struct scrub_ctx *sctx); |
253 | static void scrub_wr_bio_end_io(struct bio *bio, int err); | 250 | static void scrub_wr_bio_end_io(struct bio *bio, int err); |
254 | static void scrub_wr_bio_end_io_worker(struct btrfs_work_struct *work); | 251 | static void scrub_wr_bio_end_io_worker(struct btrfs_work *work); |
255 | static int write_page_nocow(struct scrub_ctx *sctx, | 252 | static 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); |
257 | static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, | 254 | static 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); |
259 | static int copy_nocow_pages(struct scrub_ctx *sctx, u64 logical, u64 len, | 256 | static 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); |
261 | static void copy_nocow_pages_worker(struct btrfs_work_struct *work); | 258 | static void copy_nocow_pages_worker(struct btrfs_work *work); |
262 | static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info); | 259 | static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info); |
263 | static void scrub_blocked_if_needed(struct btrfs_fs_info *fs_info); | 260 | static 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 | ||
740 | static void scrub_fixup_nodatasum(struct btrfs_work_struct *work) | 737 | static 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 | ||
1625 | static void scrub_wr_bio_end_io_worker(struct btrfs_work_struct *work) | 1622 | static 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 | ||
2093 | static void scrub_bio_end_io_worker(struct btrfs_work_struct *work) | 2090 | static 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 | ||
3164 | static void copy_nocow_pages_worker(struct btrfs_work_struct *work) | 3161 | static 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); |