Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300177
b: refs/heads/master
c: c3a0ce2
h: refs/heads/master
i:
  300175: d648f37
v: v3
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed May 12, 2012
1 parent 8af966b commit 85057b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03aaae7cdc71bc306888440b1f569d463e917b6d
refs/heads/master: c3a0ce2eab76daf9516c817c3f227ea3f4549bd8
5 changes: 5 additions & 0 deletions trunk/drivers/md/dm-thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,7 @@ static void no_space(struct cell *cell)
static void process_discard(struct thin_c *tc, struct bio *bio)
{
int r;
unsigned long flags;
struct pool *pool = tc->pool;
struct cell *cell, *cell2;
struct cell_key key, key2;
Expand Down Expand Up @@ -1221,7 +1222,9 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
m->bio = bio;

if (!ds_add_work(&pool->all_io_ds, &m->list)) {
spin_lock_irqsave(&pool->lock, flags);
list_add(&m->list, &pool->prepared_discards);
spin_unlock_irqrestore(&pool->lock, flags);
wake_worker(pool);
}
} else {
Expand Down Expand Up @@ -2629,8 +2632,10 @@ static int thin_endio(struct dm_target *ti,
if (h->all_io_entry) {
INIT_LIST_HEAD(&work);
ds_dec(h->all_io_entry, &work);
spin_lock_irqsave(&pool->lock, flags);
list_for_each_entry_safe(m, tmp, &work, list)
list_add(&m->list, &pool->prepared_discards);
spin_unlock_irqrestore(&pool->lock, flags);
}

mempool_free(h, pool->endio_hook_pool);
Expand Down

0 comments on commit 85057b9

Please sign in to comment.