aboutsummaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 71f613cf4a85..82eec7c7b4bb 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -103,6 +103,7 @@ static int aio_setup_ring(struct kioctx *ctx)
103 unsigned nr_events = ctx->max_reqs; 103 unsigned nr_events = ctx->max_reqs;
104 unsigned long size; 104 unsigned long size;
105 int nr_pages; 105 int nr_pages;
106 bool populate;
106 107
107 /* Compensate for the ring buffer's head/tail overlap entry */ 108 /* Compensate for the ring buffer's head/tail overlap entry */
108 nr_events += 2; /* 1 is required, 2 for good luck */ 109 nr_events += 2; /* 1 is required, 2 for good luck */
@@ -129,7 +130,8 @@ static int aio_setup_ring(struct kioctx *ctx)
129 down_write(&ctx->mm->mmap_sem); 130 down_write(&ctx->mm->mmap_sem);
130 info->mmap_base = do_mmap_pgoff(NULL, 0, info->mmap_size, 131 info->mmap_base = do_mmap_pgoff(NULL, 0, info->mmap_size,
131 PROT_READ|PROT_WRITE, 132 PROT_READ|PROT_WRITE,
132 MAP_ANONYMOUS|MAP_PRIVATE, 0); 133 MAP_ANONYMOUS|MAP_PRIVATE, 0,
134 &populate);
133 if (IS_ERR((void *)info->mmap_base)) { 135 if (IS_ERR((void *)info->mmap_base)) {
134 up_write(&ctx->mm->mmap_sem); 136 up_write(&ctx->mm->mmap_sem);
135 info->mmap_size = 0; 137 info->mmap_size = 0;
@@ -147,6 +149,8 @@ static int aio_setup_ring(struct kioctx *ctx)
147 aio_free_ring(ctx); 149 aio_free_ring(ctx);
148 return -EAGAIN; 150 return -EAGAIN;
149 } 151 }
152 if (populate)
153 mm_populate(info->mmap_base, info->mmap_size);
150 154
151 ctx->user_id = info->mmap_base; 155 ctx->user_id = info->mmap_base;
152 156