Skip to content

Commit

Permalink
block: move rq_ioc() to blk.h
Browse files Browse the repository at this point in the history
We want to use it outside of blk-core.c.

Signed-off-by: Jens Axboe <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Omar Sandoval <[email protected]>
  • Loading branch information
axboe committed Jan 17, 2017
1 parent c51ca6c commit c23ecb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 0 additions & 16 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,22 +1039,6 @@ static bool blk_rq_should_init_elevator(struct bio *bio)
return true;
}

/**
* rq_ioc - determine io_context for request allocation
* @bio: request being allocated is for this bio (can be %NULL)
*
* Determine io_context to use for request allocation for @bio. May return
* %NULL if %current->io_context doesn't exist.
*/
static struct io_context *rq_ioc(struct bio *bio)
{
#ifdef CONFIG_BLK_CGROUP
if (bio && bio->bi_ioc)
return bio->bi_ioc;
#endif
return current->io_context;
}

/**
* __get_request - get a free request
* @rl: request list to allocate from
Expand Down
16 changes: 16 additions & 0 deletions block/blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,22 @@ void ioc_clear_queue(struct request_queue *q);

int create_task_io_context(struct task_struct *task, gfp_t gfp_mask, int node);

/**
* rq_ioc - determine io_context for request allocation
* @bio: request being allocated is for this bio (can be %NULL)
*
* Determine io_context to use for request allocation for @bio. May return
* %NULL if %current->io_context doesn't exist.
*/
static inline struct io_context *rq_ioc(struct bio *bio)
{
#ifdef CONFIG_BLK_CGROUP
if (bio && bio->bi_ioc)
return bio->bi_ioc;
#endif
return current->io_context;
}

/**
* create_io_context - try to create task->io_context
* @gfp_mask: allocation mask
Expand Down

0 comments on commit c23ecb4

Please sign in to comment.