Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21125
b: refs/heads/master
c: a90d742
h: refs/heads/master
i:
  21123: 3399404
v: v3
  • Loading branch information
Al Viro committed Mar 18, 2006
1 parent 9761c7a commit 93e47fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 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: 483f4afc421435b7cfe5e88f74eea0b73a476d75
refs/heads/master: a90d742e4cbbc217c402265eb8b8bb0e0f9f8da2
28 changes: 7 additions & 21 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ static struct completion *ioc_gone;
* Per block device queue structure
*/
struct cfq_data {
atomic_t ref;
request_queue_t *queue;

/*
Expand Down Expand Up @@ -295,7 +294,6 @@ CFQ_CRQ_FNS(is_sync);

static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *, unsigned int, unsigned short);
static void cfq_dispatch_insert(request_queue_t *, struct cfq_rq *);
static void cfq_put_cfqd(struct cfq_data *cfqd);
static struct cfq_queue *cfq_get_queue(struct cfq_data *cfqd, unsigned int key, struct task_struct *tsk, gfp_t gfp_mask);

#define process_sync(tsk) ((tsk)->flags & PF_SYNCWRITE)
Expand Down Expand Up @@ -1168,8 +1166,6 @@ static void cfq_put_queue(struct cfq_queue *cfqq)
if (unlikely(cfqd->active_queue == cfqq))
__cfq_slice_expired(cfqd, cfqq, 0);

cfq_put_cfqd(cfqq->cfqd);

/*
* it's on the empty list and still hashed
*/
Expand Down Expand Up @@ -1442,7 +1438,6 @@ cfq_get_queue(struct cfq_data *cfqd, unsigned int key, struct task_struct *tsk,
hlist_add_head(&cfqq->cfq_hash, &cfqd->cfq_hash[hashval]);
atomic_set(&cfqq->ref, 0);
cfqq->cfqd = cfqd;
atomic_inc(&cfqd->ref);
cfqq->service_last = 0;
/*
* set ->slice_left to allow preemption for a new process
Expand Down Expand Up @@ -2144,19 +2139,6 @@ static void cfq_shutdown_timer_wq(struct cfq_data *cfqd)
blk_sync_queue(cfqd->queue);
}

static void cfq_put_cfqd(struct cfq_data *cfqd)
{
if (!atomic_dec_and_test(&cfqd->ref))
return;

cfq_shutdown_timer_wq(cfqd);

mempool_destroy(cfqd->crq_pool);
kfree(cfqd->crq_hash);
kfree(cfqd->cfq_hash);
kfree(cfqd);
}

static void cfq_exit_queue(elevator_t *e)
{
struct cfq_data *cfqd = e->elevator_data;
Expand Down Expand Up @@ -2184,7 +2166,13 @@ static void cfq_exit_queue(elevator_t *e)
}
spin_unlock_irq(q->queue_lock);
write_unlock(&cfq_exit_lock);
cfq_put_cfqd(cfqd);

cfq_shutdown_timer_wq(cfqd);

mempool_destroy(cfqd->crq_pool);
kfree(cfqd->crq_hash);
kfree(cfqd->cfq_hash);
kfree(cfqd);
}

static int cfq_init_queue(request_queue_t *q, elevator_t *e)
Expand Down Expand Up @@ -2241,8 +2229,6 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)

INIT_WORK(&cfqd->unplug_work, cfq_kick_queue, q);

atomic_set(&cfqd->ref, 1);

cfqd->cfq_queued = cfq_queued;
cfqd->cfq_quantum = cfq_quantum;
cfqd->cfq_fifo_expire[0] = cfq_fifo_expire[0];
Expand Down

0 comments on commit 93e47fd

Please sign in to comment.