Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176542
b: refs/heads/master
c: 90abb8c
h: refs/heads/master
v: v3
  • Loading branch information
Kiyoshi Ueda authored and Alasdair G Kergon committed Dec 10, 2009
1 parent 44b5b09 commit 7c001c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: 9ca170a3c0cbb0d5251cef6f5a3300fa436ba8ec
refs/heads/master: 90abb8c4cec8f0aa4ce58790542e3cf13071601a
9 changes: 7 additions & 2 deletions trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ static void free_bio_info(struct dm_rq_clone_bio_info *info)
mempool_free(info, info->tio->md->io_pool);
}

static int md_in_flight(struct mapped_device *md)
{
return atomic_read(&md->pending[READ]) +
atomic_read(&md->pending[WRITE]);
}

static void start_io_acct(struct dm_io *io)
{
struct mapped_device *md = io->md;
Expand Down Expand Up @@ -2100,8 +2106,7 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible)
break;
}
spin_unlock_irqrestore(q->queue_lock, flags);
} else if (!atomic_read(&md->pending[0]) &&
!atomic_read(&md->pending[1]))
} else if (!md_in_flight(md))
break;

if (interruptible == TASK_INTERRUPTIBLE &&
Expand Down

0 comments on commit 7c001c5

Please sign in to comment.