]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - fs/btrfs/inode.c
Merge tag 'for-5.2-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[thirdparty/kernel/linux.git] / fs / btrfs / inode.c
index 6bebc0ca751db92633519ed39908636c30512dc7..a2aabdb85226d7c11eba224d6acf40d4948f307b 100644 (file)
@@ -6829,7 +6829,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
        u64 extent_start = 0;
        u64 extent_end = 0;
        u64 objectid = btrfs_ino(inode);
-       u8 extent_type;
+       int extent_type = -1;
        struct btrfs_path *path = NULL;
        struct btrfs_root *root = inode->root;
        struct btrfs_file_extent_item *item;
@@ -7882,7 +7882,6 @@ static void btrfs_retry_endio_nocsum(struct bio *bio)
        struct inode *inode = done->inode;
        struct bio_vec *bvec;
        struct extent_io_tree *io_tree, *failure_tree;
-       int i;
        struct bvec_iter_all iter_all;
 
        if (bio->bi_status)
@@ -7895,7 +7894,7 @@ static void btrfs_retry_endio_nocsum(struct bio *bio)
 
        done->uptodate = 1;
        ASSERT(!bio_flagged(bio, BIO_CLONED));
-       bio_for_each_segment_all(bvec, bio, i, iter_all)
+       bio_for_each_segment_all(bvec, bio, iter_all)
                clean_io_failure(BTRFS_I(inode)->root->fs_info, failure_tree,
                                 io_tree, done->start, bvec->bv_page,
                                 btrfs_ino(BTRFS_I(inode)), 0);
@@ -7973,7 +7972,7 @@ static void btrfs_retry_endio(struct bio *bio)
        struct bio_vec *bvec;
        int uptodate;
        int ret;
-       int i;
+       int i = 0;
        struct bvec_iter_all iter_all;
 
        if (bio->bi_status)
@@ -7988,7 +7987,7 @@ static void btrfs_retry_endio(struct bio *bio)
        failure_tree = &BTRFS_I(inode)->io_failure_tree;
 
        ASSERT(!bio_flagged(bio, BIO_CLONED));
-       bio_for_each_segment_all(bvec, bio, i, iter_all) {
+       bio_for_each_segment_all(bvec, bio, iter_all) {
                ret = __readpage_endio_check(inode, io_bio, i, bvec->bv_page,
                                             bvec->bv_offset, done->start,
                                             bvec->bv_len);
@@ -8000,6 +7999,7 @@ static void btrfs_retry_endio(struct bio *bio)
                                         bvec->bv_offset);
                else
                        uptodate = 0;
+               i++;
        }
 
        done->uptodate = uptodate;
@@ -9260,9 +9260,8 @@ void btrfs_test_destroy_inode(struct inode *inode)
 }
 #endif
 
-static void btrfs_i_callback(struct rcu_head *head)
+void btrfs_free_inode(struct inode *inode)
 {
-       struct inode *inode = container_of(head, struct inode, i_rcu);
        kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode));
 }
 
@@ -9288,7 +9287,7 @@ void btrfs_destroy_inode(struct inode *inode)
         * created.
         */
        if (!root)
-               goto free;
+               return;
 
        while (1) {
                ordered = btrfs_lookup_first_ordered_extent(inode, (u64)-1);
@@ -9306,8 +9305,6 @@ void btrfs_destroy_inode(struct inode *inode)
        btrfs_qgroup_check_reserved_leak(inode);
        inode_tree_del(inode);
        btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0);
-free:
-       call_rcu(&inode->i_rcu, btrfs_i_callback);
 }
 
 int btrfs_drop_inode(struct inode *inode)