aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-17 02:25:46 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:45 -0400
commite0bf68ddec4f4f90e5871404be4f1854c17f3120 (patch)
tree36203a3558cbe26d698bed18be69b3822fb5eef2 /block
parentdc62a30e274d003a4d08fb888f1520add4b21373 (diff)
mm: bdi init hooks
provide BDI constructor/destructor hooks [akpm@linux-foundation.org: compile fix] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block')
-rw-r--r--block/ll_rw_blk.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 9eabac95fbe0..524404bd08c1 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1786,6 +1786,7 @@ static void blk_release_queue(struct kobject *kobj)
1786 1786
1787 blk_trace_shutdown(q); 1787 blk_trace_shutdown(q);
1788 1788
1789 bdi_destroy(&q->backing_dev_info);
1789 kmem_cache_free(requestq_cachep, q); 1790 kmem_cache_free(requestq_cachep, q);
1790} 1791}
1791 1792
@@ -1839,21 +1840,27 @@ static struct kobj_type queue_ktype;
1839struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) 1840struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
1840{ 1841{
1841 struct request_queue *q; 1842 struct request_queue *q;
1843 int err;
1842 1844
1843 q = kmem_cache_alloc_node(requestq_cachep, 1845 q = kmem_cache_alloc_node(requestq_cachep,
1844 gfp_mask | __GFP_ZERO, node_id); 1846 gfp_mask | __GFP_ZERO, node_id);
1845 if (!q) 1847 if (!q)
1846 return NULL; 1848 return NULL;
1847 1849
1850 q->backing_dev_info.unplug_io_fn = blk_backing_dev_unplug;
1851 q->backing_dev_info.unplug_io_data = q;
1852 err = bdi_init(&q->backing_dev_info);
1853 if (err) {
1854 kmem_cache_free(requestq_cachep, q);
1855 return NULL;
1856 }
1857
1848 init_timer(&q->unplug_timer); 1858 init_timer(&q->unplug_timer);
1849 1859
1850 kobject_set_name(&q->kobj, "%s", "queue"); 1860 kobject_set_name(&q->kobj, "%s", "queue");
1851 q->kobj.ktype = &queue_ktype; 1861 q->kobj.ktype = &queue_ktype;
1852 kobject_init(&q->kobj); 1862 kobject_init(&q->kobj);
1853 1863
1854 q->backing_dev_info.unplug_io_fn = blk_backing_dev_unplug;
1855 q->backing_dev_info.unplug_io_data = q;
1856
1857 mutex_init(&q->sysfs_lock); 1864 mutex_init(&q->sysfs_lock);
1858 1865
1859 return q; 1866 return q;