Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253098
b: refs/heads/master
c: e7786c3
h: refs/heads/master
v: v3
  • Loading branch information
Arne Jansen authored and Chris Mason committed Jun 4, 2011
1 parent f0c811b commit 9606abf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a4689d2bd3b00dcf5c4320f06e0ab88810fbff9c
refs/heads/master: e7786c3ae517b2c433edc91714e86be770e9f1ce
7 changes: 4 additions & 3 deletions trunk/fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ static int scrub_fixup_io(int rw, struct block_device *bdev, sector_t sector,
int ret;
DECLARE_COMPLETION_ONSTACK(complete);

/* we are going to wait on this IO */
rw |= REQ_SYNC;

bio = bio_alloc(GFP_NOFS, 1);
bio->bi_bdev = bdev;
bio->bi_sector = sector;
Expand All @@ -359,6 +356,7 @@ static int scrub_fixup_io(int rw, struct block_device *bdev, sector_t sector,
bio->bi_private = &complete;
submit_bio(rw, bio);

/* this will also unplug the queue */
wait_for_completion(&complete);

ret = !test_bit(BIO_UPTODATE, &bio->bi_flags);
Expand Down Expand Up @@ -743,6 +741,7 @@ static noinline_for_stack int scrub_stripe(struct scrub_dev *sdev,
struct btrfs_root *root = fs_info->extent_root;
struct btrfs_root *csum_root = fs_info->csum_root;
struct btrfs_extent_item *extent;
struct blk_plug plug;
u64 flags;
int ret;
int slot;
Expand Down Expand Up @@ -847,6 +846,7 @@ static noinline_for_stack int scrub_stripe(struct scrub_dev *sdev,
* the scrub. This might currently (crc32) end up to be about 1MB
*/
start_stripe = 0;
blk_start_plug(&plug);
again:
logical = base + offset + start_stripe * increment;
for (i = start_stripe; i < nstripes; ++i) {
Expand Down Expand Up @@ -988,6 +988,7 @@ static noinline_for_stack int scrub_stripe(struct scrub_dev *sdev,
scrub_submit(sdev);

out:
blk_finish_plug(&plug);
btrfs_free_path(path);
return ret < 0 ? ret : 0;
}
Expand Down

0 comments on commit 9606abf

Please sign in to comment.