aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-03-05 16:15:24 -0500
committerJens Axboe <axboe@kernel.dk>2012-03-06 15:27:24 -0500
commit24acfc34fba0b4f62ef9d5c2616eb0faa802b606 (patch)
tree42d07b0e4ad922b24853fe542cb9ab543aa8174c /block/blk-core.c
parentb679281a6410676a41b175c5a185150a1ae42f9d (diff)
block: interface update for ioc/icq creation functions
Make the following interface updates to prepare for future ioc related changes. * create_io_context() returning ioc only works for %current because it doesn't increment ref on the ioc. Drop @task parameter from it and always assume %current. * Make create_io_context_slowpath() return 0 or -errno and rename it to create_task_io_context(). * Make ioc_create_icq() take @ioc as parameter instead of assuming that of %current. The caller, get_request(), is updated to create ioc explicitly and then pass it into ioc_create_icq(). Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 792a384a8e35..b2d0fcd8f87f 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -855,7 +855,7 @@ retry:
855 */ 855 */
856 if (!ioc && !retried) { 856 if (!ioc && !retried) {
857 spin_unlock_irq(q->queue_lock); 857 spin_unlock_irq(q->queue_lock);
858 create_io_context(current, gfp_mask, q->node); 858 create_io_context(gfp_mask, q->node);
859 spin_lock_irq(q->queue_lock); 859 spin_lock_irq(q->queue_lock);
860 retried = true; 860 retried = true;
861 goto retry; 861 goto retry;
@@ -919,7 +919,9 @@ retry:
919 919
920 /* create icq if missing */ 920 /* create icq if missing */
921 if ((rw_flags & REQ_ELVPRIV) && unlikely(et->icq_cache && !icq)) { 921 if ((rw_flags & REQ_ELVPRIV) && unlikely(et->icq_cache && !icq)) {
922 icq = ioc_create_icq(q, gfp_mask); 922 ioc = create_io_context(gfp_mask, q->node);
923 if (ioc)
924 icq = ioc_create_icq(ioc, q, gfp_mask);
923 if (!icq) 925 if (!icq)
924 goto fail_alloc; 926 goto fail_alloc;
925 } 927 }
@@ -1005,7 +1007,7 @@ static struct request *get_request_wait(struct request_queue *q, int rw_flags,
1005 * up to a big batch of them for a small period time. 1007 * up to a big batch of them for a small period time.
1006 * See ioc_batching, ioc_set_batching 1008 * See ioc_batching, ioc_set_batching
1007 */ 1009 */
1008 create_io_context(current, GFP_NOIO, q->node); 1010 create_io_context(GFP_NOIO, q->node);
1009 ioc_set_batching(q, current->io_context); 1011 ioc_set_batching(q, current->io_context);
1010 1012
1011 spin_lock_irq(q->queue_lock); 1013 spin_lock_irq(q->queue_lock);