Merge tag 'fbdev-v5.2' of git://github.com/bzolnier/linux
[sfrench/cifs-2.6.git] / fs / block_dev.c
index bb28e2ead679c10a21a3f12dff7bddefce990ee5..f80045048bb7c00686a4fc34bf8632735c672baf 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/log2.h>
 #include <linux/cleancache.h>
 #include <linux/dax.h>
-#include <linux/badblocks.h>
 #include <linux/task_io_accounting_ops.h>
 #include <linux/falloc.h>
 #include <linux/uaccess.h>
@@ -210,7 +209,6 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter,
        struct bio bio;
        ssize_t ret;
        blk_qc_t qc;
-       int i;
        struct bvec_iter_all iter_all;
 
        if ((pos | iov_iter_alignment(iter)) &
@@ -261,7 +259,7 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter,
        }
        __set_current_state(TASK_RUNNING);
 
-       bio_for_each_segment_all(bvec, &bio, i, iter_all) {
+       bio_for_each_segment_all(bvec, &bio, iter_all) {
                if (should_dirty && !PageCompound(bvec->bv_page))
                        set_page_dirty_lock(bvec->bv_page);
                if (!bio_flagged(&bio, BIO_NO_PAGE_REF))
@@ -340,9 +338,8 @@ static void blkdev_bio_end_io(struct bio *bio)
                if (!bio_flagged(bio, BIO_NO_PAGE_REF)) {
                        struct bvec_iter_all iter_all;
                        struct bio_vec *bvec;
-                       int i;
 
-                       bio_for_each_segment_all(bvec, bio, i, iter_all)
+                       bio_for_each_segment_all(bvec, bio, iter_all)
                                put_page(bvec->bv_page);
                }
                bio_put(bio);
@@ -790,17 +787,9 @@ static struct inode *bdev_alloc_inode(struct super_block *sb)
        return &ei->vfs_inode;
 }
 
-static void bdev_i_callback(struct rcu_head *head)
+static void bdev_free_inode(struct inode *inode)
 {
-       struct inode *inode = container_of(head, struct inode, i_rcu);
-       struct bdev_inode *bdi = BDEV_I(inode);
-
-       kmem_cache_free(bdev_cachep, bdi);
-}
-
-static void bdev_destroy_inode(struct inode *inode)
-{
-       call_rcu(&inode->i_rcu, bdev_i_callback);
+       kmem_cache_free(bdev_cachep, BDEV_I(inode));
 }
 
 static void init_once(void *foo)
@@ -840,7 +829,7 @@ static void bdev_evict_inode(struct inode *inode)
 static const struct super_operations bdev_sops = {
        .statfs = simple_statfs,
        .alloc_inode = bdev_alloc_inode,
-       .destroy_inode = bdev_destroy_inode,
+       .free_inode = bdev_free_inode,
        .drop_inode = generic_delete_inode,
        .evict_inode = bdev_evict_inode,
 };