Commit 3e82c348 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: remove create_io_context

create_io_context just has a single caller, which also happens to not
even use the return value.  Just open code it there.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 28d65729
...@@ -963,12 +963,13 @@ generic_make_request_checks(struct bio *bio) ...@@ -963,12 +963,13 @@ generic_make_request_checks(struct bio *bio)
} }
/* /*
* Various block parts want %current->io_context and lazy ioc * Various block parts want %current->io_context, so allocate it up
* allocation ends up trading a lot of pain for a small amount of * front rather than dealing with lots of pain to allocate it only
* memory. Just allocate it upfront. This may fail and block * where needed. This may fail and the block layer knows how to live
* layer knows how to live with it. * with it.
*/ */
create_io_context(GFP_ATOMIC, q->node); if (unlikely(!current->io_context))
create_task_io_context(current, GFP_ATOMIC, q->node);
if (!blkcg_bio_issue_check(q, bio)) if (!blkcg_bio_issue_check(q, bio))
return false; return false;
......
...@@ -303,26 +303,6 @@ void ioc_clear_queue(struct request_queue *q); ...@@ -303,26 +303,6 @@ void ioc_clear_queue(struct request_queue *q);
int create_task_io_context(struct task_struct *task, gfp_t gfp_mask, int node); int create_task_io_context(struct task_struct *task, gfp_t gfp_mask, int node);
/**
* create_io_context - try to create task->io_context
* @gfp_mask: allocation mask
* @node: allocation node
*
* If %current->io_context is %NULL, allocate a new io_context and install
* it. Returns the current %current->io_context which may be %NULL if
* allocation failed.
*
* Note that this function can't be called with IRQ disabled because
* task_lock which protects %current->io_context is IRQ-unsafe.
*/
static inline struct io_context *create_io_context(gfp_t gfp_mask, int node)
{
WARN_ON_ONCE(irqs_disabled());
if (unlikely(!current->io_context))
create_task_io_context(current, gfp_mask, node);
return current->io_context;
}
/* /*
* Internal throttling interface * Internal throttling interface
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment