From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54629 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031324AbdEXTgi (ORCPT ); Wed, 24 May 2017 15:36:38 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4OJYNYq090521 for ; Wed, 24 May 2017 15:36:33 -0400 Received: from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 2anee0w986-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 24 May 2017 15:36:32 -0400 Received: from localhost by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 May 2017 16:36:29 -0300 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay04.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4OJaQ9s2228648 for ; Wed, 24 May 2017 16:36:26 -0300 Received: from d24av01.br.ibm.com (localhost [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v4OJaQPM004085 for ; Wed, 24 May 2017 16:36:27 -0300 From: Mauricio Faria de Oliveira To: bcrl@kvack.org, viro@zeniv.linux.org.uk Cc: jmoyer@redhat.com, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org Subject: [RESEND PATCH v2 1/2] aio: make nr_events a parameter for aio_setup_ring() Date: Wed, 24 May 2017 16:36:24 -0300 In-Reply-To: <1495654585-22790-1-git-send-email-mauricfo@linux.vnet.ibm.com> References: <1495654585-22790-1-git-send-email-mauricfo@linux.vnet.ibm.com> Message-Id: <1495654585-22790-2-git-send-email-mauricfo@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: In order to decouple ctx->max_reqs and ctx->nr_events, first remove the aio_setup_ring() dependency on ctx->max_reqs -- which currently is assigned the value of nr_events -- and make the function receive the value of nr_events directly. Signed-off-by: Mauricio Faria de Oliveira --- fs/aio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index f52d925ee259..7c3c01f352c1 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -441,10 +441,9 @@ static int aio_migratepage(struct address_space *mapping, struct page *new, #endif }; -static int aio_setup_ring(struct kioctx *ctx) +static int aio_setup_ring(struct kioctx *ctx, unsigned nr_events) { struct aio_ring *ring; - unsigned nr_events = ctx->max_reqs; struct mm_struct *mm = current->mm; unsigned long size, unused; int nr_pages; @@ -753,7 +752,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) if (!ctx->cpu) goto err; - err = aio_setup_ring(ctx); + err = aio_setup_ring(ctx, nr_events); if (err < 0) goto err; -- 1.8.3.1