diff options
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -132,7 +132,7 @@ static int aio_setup_ring(struct kioctx *ctx) | |||
132 | dprintk("attempting mmap of %lu bytes\n", info->mmap_size); | 132 | dprintk("attempting mmap of %lu bytes\n", info->mmap_size); |
133 | down_write(&ctx->mm->mmap_sem); | 133 | down_write(&ctx->mm->mmap_sem); |
134 | info->mmap_base = do_mmap(NULL, 0, info->mmap_size, | 134 | info->mmap_base = do_mmap(NULL, 0, info->mmap_size, |
135 | PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, | 135 | PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, |
136 | 0); | 136 | 0); |
137 | if (IS_ERR((void *)info->mmap_base)) { | 137 | if (IS_ERR((void *)info->mmap_base)) { |
138 | up_write(&ctx->mm->mmap_sem); | 138 | up_write(&ctx->mm->mmap_sem); |
@@ -211,11 +211,10 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) | |||
211 | if ((unsigned long)nr_events > aio_max_nr) | 211 | if ((unsigned long)nr_events > aio_max_nr) |
212 | return ERR_PTR(-EAGAIN); | 212 | return ERR_PTR(-EAGAIN); |
213 | 213 | ||
214 | ctx = kmem_cache_alloc(kioctx_cachep, GFP_KERNEL); | 214 | ctx = kmem_cache_zalloc(kioctx_cachep, GFP_KERNEL); |
215 | if (!ctx) | 215 | if (!ctx) |
216 | return ERR_PTR(-ENOMEM); | 216 | return ERR_PTR(-ENOMEM); |
217 | 217 | ||
218 | memset(ctx, 0, sizeof(*ctx)); | ||
219 | ctx->max_reqs = nr_events; | 218 | ctx->max_reqs = nr_events; |
220 | mm = ctx->mm = current->mm; | 219 | mm = ctx->mm = current->mm; |
221 | atomic_inc(&mm->mm_count); | 220 | atomic_inc(&mm->mm_count); |