mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
block: move rq_ioc() to blk.h
We want to use it outside of blk-core.c. Signed-off-by: Jens Axboe <axboe@fb.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Omar Sandoval <osandov@fb.com>
This commit is contained in:
parent
c51ca6cf54
commit
c23ecb4260
2 changed files with 16 additions and 16 deletions
|
@ -1039,22 +1039,6 @@ static bool blk_rq_should_init_elevator(struct bio *bio)
|
||||||
return true;
|
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
|
* __get_request - get a free request
|
||||||
* @rl: request list to allocate from
|
* @rl: request list to allocate from
|
||||||
|
|
16
block/blk.h
16
block/blk.h
|
@ -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);
|
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
|
* create_io_context - try to create task->io_context
|
||||||
* @gfp_mask: allocation mask
|
* @gfp_mask: allocation mask
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue