]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
block: move rq_ioc() to blk.h
authorJens Axboe <axboe@fb.com>
Wed, 14 Dec 2016 21:23:43 +0000 (14:23 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 17 Jan 2017 17:03:42 +0000 (10:03 -0700)
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>
block/blk-core.c
block/blk.h

index 61ba08c58b649b54fdfbc4e06c7e1b11b015512a..92baea07acbc662c3559f0f54360127f2ea7e2b3 100644 (file)
@@ -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
index f46c0ac8ae3d8e40b6f5d912dac97dc5676aaa48..9a716b5925a42ae72b019e887c29fb79d1a9cd59 100644 (file)
@@ -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