Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96158
b: refs/heads/master
c: 07416d2
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe committed May 7, 2008
1 parent 6309bd1 commit cf28872
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 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: aa94b5371f6f898558d9fa5690cc6e4bf917a572
refs/heads/master: 07416d29bcf608257f1e5280642dcbe0021518a3
2 changes: 1 addition & 1 deletion trunk/block/blk-ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ int put_io_context(struct io_context *ioc)
rcu_read_lock();
if (ioc->aic && ioc->aic->dtor)
ioc->aic->dtor(ioc->aic);
rcu_read_unlock();
cfq_dtor(ioc);
rcu_read_unlock();

kmem_cache_free(iocontext_cachep, ioc);
return 1;
Expand Down
19 changes: 13 additions & 6 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,19 +1142,26 @@ static void cfq_put_queue(struct cfq_queue *cfqq)
kmem_cache_free(cfq_pool, cfqq);
}

static void
__call_for_each_cic(struct io_context *ioc,
void (*func)(struct io_context *, struct cfq_io_context *))
{
struct cfq_io_context *cic;
struct hlist_node *n;

hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list)
func(ioc, cic);
}

/*
* Call func for each cic attached to this ioc.
*/
static void
call_for_each_cic(struct io_context *ioc,
void (*func)(struct io_context *, struct cfq_io_context *))
{
struct cfq_io_context *cic;
struct hlist_node *n;

rcu_read_lock();
hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list)
func(ioc, cic);
__call_for_each_cic(ioc, func);
rcu_read_unlock();
}

Expand Down Expand Up @@ -1198,7 +1205,7 @@ static void cfq_free_io_context(struct io_context *ioc)
* should be ok to iterate over the known list, we will see all cic's
* since no new ones are added.
*/
call_for_each_cic(ioc, cic_free_func);
__call_for_each_cic(ioc, cic_free_func);
}

static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq)
Expand Down

0 comments on commit cf28872

Please sign in to comment.