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 1014d349a386..9e3f3cc85d0d 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1787,6 +1787,7 @@ static void blk_release_queue(struct kobject *kobj) | |||
1787 | 1787 | ||
1788 | blk_trace_shutdown(q); | 1788 | blk_trace_shutdown(q); |
1789 | 1789 | ||
1790 | bdi_destroy(&q->backing_dev_info); | ||
1790 | kmem_cache_free(requestq_cachep, q); | 1791 | kmem_cache_free(requestq_cachep, q); |
1791 | } | 1792 | } |
1792 | 1793 | ||
@@ -1840,21 +1841,27 @@ static struct kobj_type queue_ktype; | |||
1840 | struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) | 1841 | struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) |
1841 | { | 1842 | { |
1842 | struct request_queue *q; | 1843 | struct request_queue *q; |
1844 | int err; | ||
1843 | 1845 | ||
1844 | q = kmem_cache_alloc_node(requestq_cachep, | 1846 | q = kmem_cache_alloc_node(requestq_cachep, |
1845 | gfp_mask | __GFP_ZERO, node_id); | 1847 | gfp_mask | __GFP_ZERO, node_id); |
1846 | if (!q) | 1848 | if (!q) |
1847 | return NULL; | 1849 | return NULL; |
1848 | 1850 | ||
1851 | q->backing_dev_info.unplug_io_fn = blk_backing_dev_unplug; | ||
1852 | q->backing_dev_info.unplug_io_data = q; | ||
1853 | err = bdi_init(&q->backing_dev_info); | ||
1854 | if (err) { | ||
1855 | kmem_cache_free(requestq_cachep, q); | ||
1856 | return NULL; | ||
1857 | } | ||
1858 | |||
1849 | init_timer(&q->unplug_timer); | 1859 | init_timer(&q->unplug_timer); |
1850 | 1860 | ||
1851 | kobject_set_name(&q->kobj, "%s", "queue"); | 1861 | kobject_set_name(&q->kobj, "%s", "queue"); |
1852 | q->kobj.ktype = &queue_ktype; | 1862 | q->kobj.ktype = &queue_ktype; |
1853 | kobject_init(&q->kobj); | 1863 | kobject_init(&q->kobj); |
1854 | 1864 | ||
1855 | q->backing_dev_info.unplug_io_fn = blk_backing_dev_unplug; | ||
1856 | q->backing_dev_info.unplug_io_data = q; | ||
1857 | |||
1858 | mutex_init(&q->sysfs_lock); | 1865 | mutex_init(&q->sysfs_lock); |
1859 | 1866 | ||
1860 | return q; | 1867 | return q; |