X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Faio.c;h=e41e932ba489ff040fe9ed43385fc164a8dd6515;hb=29e350944fdc2dfca102500790d8ad6d6ff4f69d;hp=5a28b69ad223b243121c8eb65495f9a519891d33;hpb=7ae8c5ec122e4e909193dbbdb2ad2de349e307c9;p=powerpc.git diff --git a/fs/aio.c b/fs/aio.c index 5a28b69ad2..e41e932ba4 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -123,10 +122,9 @@ static int aio_setup_ring(struct kioctx *ctx) info->nr = 0; info->ring_pages = info->internal_pages; if (nr_pages > AIO_RING_PAGES) { - info->ring_pages = kmalloc(sizeof(struct page *) * nr_pages, GFP_KERNEL); + info->ring_pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); if (!info->ring_pages) return -ENOMEM; - memset(info->ring_pages, 0, sizeof(struct page *) * nr_pages); } info->mmap_size = nr_pages * PAGE_SIZE; @@ -514,7 +512,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) /* Must be done under the lock to serialise against cancellation. * Call this aio_fput as it duplicates fput via the fput_work. */ - if (unlikely(rcuref_dec_and_test(&req->ki_filp->f_count))) { + if (unlikely(atomic_dec_and_test(&req->ki_filp->f_count))) { get_ioctx(ctx); spin_lock(&fput_lock); list_add(&req->ki_list, &fput_head);