aio: make nr_events a parameter for aio_setup_ring()
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.
Signed-off-by Mauricio Faria de Oliveira <[email protected]>
--- fs/aio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/aio.c +2 -3
@@ -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