summaryrefslogtreecommitdiff
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2014-09-25 23:23:40 +0800
committerJens Axboe <axboe@fb.com>2014-09-25 15:22:35 -0600
commitf355265571440a7db16e784b6edf4e7d26971a03 (patch)
tree79b20c37c734b5932dcecc9e85850847b0a69855 /block/blk-core.c
parent1bcb1eada4f11a713cbe586d1b5a5d93a48277cb (diff)
downloadkernel-f355265571440a7db16e784b6edf4e7d26971a03.tar.gz
block: introduce blk_init_flush and its pair
These two temporary functions are introduced for holding flush initialization and de-initialization, so that we can introduce 'flush queue' easier in the following patch. And once 'flush queue' and its allocation/free functions are ready, they will be removed for sake of code readability. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 6946a4275e6f..0a9d17269957 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -705,8 +705,7 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
if (!q)
return NULL;
- q->flush_rq = kzalloc(sizeof(struct request), GFP_KERNEL);
- if (!q->flush_rq)
+ if (blk_init_flush(q))
return NULL;
if (blk_init_rl(&q->root_rl, q, GFP_KERNEL))
@@ -742,7 +741,7 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
return q;
fail:
- kfree(q->flush_rq);
+ blk_exit_flush(q);
return NULL;
}
EXPORT_SYMBOL(blk_init_allocated_queue);