Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
[pandora-kernel.git] / fs / aio.c
index 5a28b69..e41e932 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -29,7 +29,6 @@
 #include <linux/highmem.h>
 #include <linux/workqueue.h>
 #include <linux/security.h>
-#include <linux/rcuref.h>
 
 #include <asm/kmap_types.h>
 #include <asm/uaccess.h>
@@ -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);