Skip to contentSkip to conversation

aio: make nr_events a parameter for aio_setup_ring()

PATCH RESEND Superseded Mauricio Faria de Oliveira 1 participant 1 message May 24, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/2 aio: make nr_events a parameter for aio_setup_ring()

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.

---
 fs/aio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/aio.c +2 -3
index f52d925ee259..7c3c01f352c1 100644
@@ -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;
 
Signature · 1 line
1.8.3.1