mm: introduce mm_populate() for populating new vmas
[deliverable/linux.git] / fs / aio.c
index 71f613cf4a85a36e08044840f65b36b0c9fc4579..82eec7c7b4bb25ff55230f1392fdb4467ff27d90 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -103,6 +103,7 @@ static int aio_setup_ring(struct kioctx *ctx)
        unsigned nr_events = ctx->max_reqs;
        unsigned long size;
        int nr_pages;
+       bool populate;
 
        /* Compensate for the ring buffer's head/tail overlap entry */
        nr_events += 2; /* 1 is required, 2 for good luck */
@@ -129,7 +130,8 @@ static int aio_setup_ring(struct kioctx *ctx)
        down_write(&ctx->mm->mmap_sem);
        info->mmap_base = do_mmap_pgoff(NULL, 0, info->mmap_size, 
                                        PROT_READ|PROT_WRITE,
-                                       MAP_ANONYMOUS|MAP_PRIVATE, 0);
+                                       MAP_ANONYMOUS|MAP_PRIVATE, 0,
+                                       &populate);
        if (IS_ERR((void *)info->mmap_base)) {
                up_write(&ctx->mm->mmap_sem);
                info->mmap_size = 0;
@@ -147,6 +149,8 @@ static int aio_setup_ring(struct kioctx *ctx)
                aio_free_ring(ctx);
                return -EAGAIN;
        }
+       if (populate)
+               mm_populate(info->mmap_base, info->mmap_size);
 
        ctx->user_id = info->mmap_base;
 
This page took 0.038018 seconds and 5 git commands to generate.