From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934849AbcLQAMv (ORCPT ); Fri, 16 Dec 2016 19:12:51 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:33612 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934152AbcLQAM2 (ORCPT ); Fri, 16 Dec 2016 19:12:28 -0500 From: Jens Axboe To: , , CC: , , Jens Axboe Subject: [PATCH 3/8] block: move rq_ioc() to blk.h Date: Fri, 16 Dec 2016 17:12:11 -0700 Message-ID: <1481933536-12844-4-git-send-email-axboe@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481933536-12844-1-git-send-email-axboe@fb.com> References: <1481933536-12844-1-git-send-email-axboe@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-16_15:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We want to use it outside of blk-core.c. Signed-off-by: Jens Axboe --- block/blk-core.c | 16 ---------------- block/blk.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 61ba08c58b64..92baea07acbc 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1040,22 +1040,6 @@ static bool blk_rq_should_init_elevator(struct bio *bio) } /** - * 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 * @op: operation and flags diff --git a/block/blk.h b/block/blk.h index f46c0ac8ae3d..9a716b5925a4 100644 --- a/block/blk.h +++ b/block/blk.h @@ -264,6 +264,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 * @node: allocation node -- 2.7.4