diff options
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index ddf2c90d3fc..9770cc5bfb7 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "transaction.h" | 25 | #include "transaction.h" |
26 | #include "backref.h" | 26 | #include "backref.h" |
27 | #include "extent_io.h" | 27 | #include "extent_io.h" |
28 | #include "check-integrity.h" | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * This is only the first step towards a full-features scrub. It reads all | 31 | * This is only the first step towards a full-features scrub. It reads all |
@@ -309,7 +310,7 @@ static void scrub_print_warning(const char *errstr, struct scrub_bio *sbio, | |||
309 | u8 ref_level; | 310 | u8 ref_level; |
310 | unsigned long ptr = 0; | 311 | unsigned long ptr = 0; |
311 | const int bufsize = 4096; | 312 | const int bufsize = 4096; |
312 | u64 extent_offset; | 313 | u64 extent_item_pos; |
313 | 314 | ||
314 | path = btrfs_alloc_path(); | 315 | path = btrfs_alloc_path(); |
315 | 316 | ||
@@ -329,12 +330,13 @@ static void scrub_print_warning(const char *errstr, struct scrub_bio *sbio, | |||
329 | if (ret < 0) | 330 | if (ret < 0) |
330 | goto out; | 331 | goto out; |
331 | 332 | ||
332 | extent_offset = swarn.logical - found_key.objectid; | 333 | extent_item_pos = swarn.logical - found_key.objectid; |
333 | swarn.extent_item_size = found_key.offset; | 334 | swarn.extent_item_size = found_key.offset; |
334 | 335 | ||
335 | eb = path->nodes[0]; | 336 | eb = path->nodes[0]; |
336 | ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item); | 337 | ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item); |
337 | item_size = btrfs_item_size_nr(eb, path->slots[0]); | 338 | item_size = btrfs_item_size_nr(eb, path->slots[0]); |
339 | btrfs_release_path(path); | ||
338 | 340 | ||
339 | if (ret & BTRFS_EXTENT_FLAG_TREE_BLOCK) { | 341 | if (ret & BTRFS_EXTENT_FLAG_TREE_BLOCK) { |
340 | do { | 342 | do { |
@@ -351,7 +353,7 @@ static void scrub_print_warning(const char *errstr, struct scrub_bio *sbio, | |||
351 | } else { | 353 | } else { |
352 | swarn.path = path; | 354 | swarn.path = path; |
353 | iterate_extent_inodes(fs_info, path, found_key.objectid, | 355 | iterate_extent_inodes(fs_info, path, found_key.objectid, |
354 | extent_offset, | 356 | extent_item_pos, |
355 | scrub_print_warning_inode, &swarn); | 357 | scrub_print_warning_inode, &swarn); |
356 | } | 358 | } |
357 | 359 | ||
@@ -732,7 +734,7 @@ static int scrub_fixup_io(int rw, struct block_device *bdev, sector_t sector, | |||
732 | bio_add_page(bio, page, PAGE_SIZE, 0); | 734 | bio_add_page(bio, page, PAGE_SIZE, 0); |
733 | bio->bi_end_io = scrub_fixup_end_io; | 735 | bio->bi_end_io = scrub_fixup_end_io; |
734 | bio->bi_private = &complete; | 736 | bio->bi_private = &complete; |
735 | submit_bio(rw, bio); | 737 | btrfsic_submit_bio(rw, bio); |
736 | 738 | ||
737 | /* this will also unplug the queue */ | 739 | /* this will also unplug the queue */ |
738 | wait_for_completion(&complete); | 740 | wait_for_completion(&complete); |
@@ -958,7 +960,7 @@ static int scrub_submit(struct scrub_dev *sdev) | |||
958 | sdev->curr = -1; | 960 | sdev->curr = -1; |
959 | atomic_inc(&sdev->in_flight); | 961 | atomic_inc(&sdev->in_flight); |
960 | 962 | ||
961 | submit_bio(READ, sbio->bio); | 963 | btrfsic_submit_bio(READ, sbio->bio); |
962 | 964 | ||
963 | return 0; | 965 | return 0; |
964 | } | 966 | } |