aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-06-12 08:42:56 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-06-16 02:21:03 -0400
commit0989a025d2f4f9f51ea641bd26c563c53dc63f55 (patch)
tree5b4f29d3b1a3d09d3052e0c18d63dba8a946da86 /block
parent81be834713a7d6b9463663145d493fe9daee2d61 (diff)
block: don't overwrite bdi->state after bdi_init() has been run
Move the defaults to where we do the init of the backing_dev_info. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c5
-rw-r--r--block/blk-settings.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index f6452f692501..94d88fabc4bd 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -498,6 +498,11 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
498 498
499 q->backing_dev_info.unplug_io_fn = blk_backing_dev_unplug; 499 q->backing_dev_info.unplug_io_fn = blk_backing_dev_unplug;
500 q->backing_dev_info.unplug_io_data = q; 500 q->backing_dev_info.unplug_io_data = q;
501 q->backing_dev_info.ra_pages =
502 (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
503 q->backing_dev_info.state = 0;
504 q->backing_dev_info.capabilities = BDI_CAP_MAP_COPY;
505
501 err = bdi_init(&q->backing_dev_info); 506 err = bdi_init(&q->backing_dev_info);
502 if (err) { 507 if (err) {
503 kmem_cache_free(blk_requestq_cachep, q); 508 kmem_cache_free(blk_requestq_cachep, q);
diff --git a/block/blk-settings.c b/block/blk-settings.c
index d71cedc09c4e..138610b98956 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -129,10 +129,6 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
129 blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE); 129 blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE);
130 130
131 q->make_request_fn = mfn; 131 q->make_request_fn = mfn;
132 q->backing_dev_info.ra_pages =
133 (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
134 q->backing_dev_info.state = 0;
135 q->backing_dev_info.capabilities = BDI_CAP_MAP_COPY;
136 blk_queue_max_sectors(q, SAFE_MAX_SECTORS); 132 blk_queue_max_sectors(q, SAFE_MAX_SECTORS);
137 blk_queue_logical_block_size(q, 512); 133 blk_queue_logical_block_size(q, 512);
138 blk_queue_dma_alignment(q, 511); 134 blk_queue_dma_alignment(q, 511);