Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359509
b: refs/heads/master
c: 548bc8e
h: refs/heads/master
i:
  359507: 242ac29
v: v3
  • Loading branch information
Tejun Heo committed Jan 9, 2013
1 parent a9b37ab commit 066c399
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 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: 16b3de6652c7aef151f38726faf90f0dbc9e9c71
refs/heads/master: 548bc8e1b38e48653a90f48f636f8d253504f8a2
9 changes: 8 additions & 1 deletion trunk/block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,13 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
return res;
}

static void blk_free_queue_rcu(struct rcu_head *rcu_head)
{
struct request_queue *q = container_of(rcu_head, struct request_queue,
rcu_head);
kmem_cache_free(blk_requestq_cachep, q);
}

/**
* blk_release_queue: - release a &struct request_queue when it is no longer needed
* @kobj: the kobj belonging to the request queue to be released
Expand Down Expand Up @@ -538,7 +545,7 @@ static void blk_release_queue(struct kobject *kobj)
bdi_destroy(&q->backing_dev_info);

ida_simple_remove(&blk_queue_ida, q->id);
kmem_cache_free(blk_requestq_cachep, q);
call_rcu(&q->rcu_head, blk_free_queue_rcu);
}

static const struct sysfs_ops queue_sysfs_ops = {
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/gfp.h>
#include <linux/bsg.h>
#include <linux/smp.h>
#include <linux/rcupdate.h>

#include <asm/scatterlist.h>

Expand Down Expand Up @@ -437,6 +438,7 @@ struct request_queue {
/* Throttle data */
struct throtl_data *td;
#endif
struct rcu_head rcu_head;
};

#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
Expand Down

0 comments on commit 066c399

Please sign in to comment.