diff options
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r-- | block/ll_rw_blk.c | 13 |
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; | |||
1839 | struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) | 1840 | struct 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; |