Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128872
b: refs/heads/master
c: 492bb6d
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent f1d875e commit d1f4612
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 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: 3ce7e67a069b919be774a341b82fc20978b7f69d
refs/heads/master: 492bb6deee3416ad792dcd8584ebd95c463af1a6
10 changes: 9 additions & 1 deletion trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,23 @@ int run_scheduled_bios(struct btrfs_device *device)
pending = pending->bi_next;
cur->bi_next = NULL;
atomic_dec(&device->dev_root->fs_info->nr_async_submits);

BUG_ON(atomic_read(&cur->bi_cnt) == 0);
bio_get(cur);
submit_bio(cur->bi_rw, cur);
bio_put(cur);
num_run++;

/*
* we made progress, there is more work to do and the bdi
* is now congested. Back off and let other work structs
* run instead
*/
if (pending && num_run && bdi_write_congested(bdi)) {
if (pending && bdi_write_congested(bdi)) {
struct bio *old_head;

spin_lock(&device->io_lock);

old_head = device->pending_bios;
device->pending_bios = pending;
if (device->pending_bio_tail)
Expand Down Expand Up @@ -2125,7 +2130,9 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,

/* don't bother with additional async steps for reads, right now */
if (!(rw & (1 << BIO_RW))) {
bio_get(bio);
submit_bio(rw, bio);
bio_put(bio);
return 0;
}

Expand All @@ -2136,6 +2143,7 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
* on a queue for later
*/
atomic_inc(&root->fs_info->nr_async_submits);
WARN_ON(bio->bi_next);
bio->bi_next = NULL;
bio->bi_rw |= rw;

Expand Down

0 comments on commit d1f4612

Please sign in to comment.