Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288466
b: refs/heads/master
c: ff8c147
h: refs/heads/master
v: v3
  • Loading branch information
Xiaotian Feng authored and Jens Axboe committed Mar 14, 2012
1 parent a426833 commit c8c2bc9
Show file tree
Hide file tree
Showing 2 changed files with 7 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: ea5f4db8ece896c2ab9eafa0924148a2596c52e4
refs/heads/master: ff8c1474cc2f5e11414c71ec4d739c18e6e669c0
6 changes: 6 additions & 0 deletions trunk/block/blk-ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static void ioc_release_fn(struct work_struct *work)
void put_io_context(struct io_context *ioc)
{
unsigned long flags;
bool free_ioc = false;

if (ioc == NULL)
return;
Expand All @@ -144,8 +145,13 @@ void put_io_context(struct io_context *ioc)
spin_lock_irqsave(&ioc->lock, flags);
if (!hlist_empty(&ioc->icq_list))
schedule_work(&ioc->release_work);
else
free_ioc = true;
spin_unlock_irqrestore(&ioc->lock, flags);
}

if (free_ioc)
kmem_cache_free(iocontext_cachep, ioc);
}
EXPORT_SYMBOL(put_io_context);

Expand Down

0 comments on commit c8c2bc9

Please sign in to comment.