diff mbox

[RESEND,v2,1/2] aio: make nr_events a parameter for aio_setup_ring()

Message ID 1495654536-22474-1-git-send-email-mauricfo@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauricio Faria de Oliveira May 24, 2017, 7:35 p.m. UTC
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 <mauricfo@linux.vnet.ibm.com>
---
 fs/aio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

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;