Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11805
b: refs/heads/master
c: 83521d3
h: refs/heads/master
i:
  11803: 4a88212
v: v3
  • Loading branch information
Christoph Hellwig authored and Linus Torvalds committed Oct 31, 2005
1 parent 18e3ee1 commit ca46e7a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 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: a8db2db1e6a8d323d87a67c5391d48fe2b97faf5
refs/heads/master: 83521d3eb8dd2dfb04dd78b4733e9766f61bb47e
2 changes: 1 addition & 1 deletion trunk/drivers/block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,8 +1973,8 @@ static int __init as_init(void)

static void __exit as_exit(void)
{
kmem_cache_destroy(arq_pool);
elv_unregister(&iosched_as);
kmem_cache_destroy(arq_pool);
}

module_init(as_init);
Expand Down
22 changes: 1 addition & 21 deletions trunk/drivers/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2418,28 +2418,8 @@ static int __init cfq_init(void)

static void __exit cfq_exit(void)
{
struct task_struct *g, *p;
unsigned long flags;

read_lock_irqsave(&tasklist_lock, flags);

/*
* iterate each process in the system, removing our io_context
*/
do_each_thread(g, p) {
struct io_context *ioc = p->io_context;

if (ioc && ioc->cic) {
ioc->cic->exit(ioc->cic);
cfq_free_io_context(ioc->cic);
ioc->cic = NULL;
}
} while_each_thread(g, p);

read_unlock_irqrestore(&tasklist_lock, flags);

cfq_slab_kill();
elv_unregister(&iosched_cfq);
cfq_slab_kill();
}

module_init(cfq_init);
Expand Down
21 changes: 21 additions & 0 deletions trunk/drivers/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,27 @@ EXPORT_SYMBOL_GPL(elv_register);

void elv_unregister(struct elevator_type *e)
{
struct task_struct *g, *p;

/*
* Iterate every thread in the process to remove the io contexts.
*/
read_lock(&tasklist_lock);
do_each_thread(g, p) {
struct io_context *ioc = p->io_context;
if (ioc && ioc->cic) {
ioc->cic->exit(ioc->cic);
ioc->cic->dtor(ioc->cic);
ioc->cic = NULL;
}
if (ioc && ioc->aic) {
ioc->aic->exit(ioc->aic);
ioc->aic->dtor(ioc->aic);
ioc->aic = NULL;
}
} while_each_thread(g, p);
read_unlock(&tasklist_lock);

spin_lock_irq(&elv_list_lock);
list_del_init(&e->list);
spin_unlock_irq(&elv_list_lock);
Expand Down

0 comments on commit ca46e7a

Please sign in to comment.