btrfs: Make btrfs_orphan_release_metadata take btrfs_inode
authorNikolay Borisov <n.borisov.lkml@gmail.com>
Mon, 20 Feb 2017 11:50:40 +0000 (13:50 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 28 Feb 2017 10:30:07 +0000 (11:30 +0100)
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c

index 52af63e1d9a0a414165ac76ddf8f1454ca35c557..8eb07a9dfa6a0b430843bb8cb948ef9849beba2a 100644 (file)
@@ -2696,7 +2696,7 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
 void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans);
 int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans,
                                  struct btrfs_inode *inode);
-void btrfs_orphan_release_metadata(struct inode *inode);
+void btrfs_orphan_release_metadata(struct btrfs_inode *inode);
 int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
                                     struct btrfs_block_rsv *rsv,
                                     int nitems,
index 8156964abc10e79f8dcd84613c14094d0a1be966..2aa665674329cc8b2d06338eb1bbc70f858909bd 100644 (file)
@@ -5767,14 +5767,14 @@ int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans,
        return btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes, 1);
 }
 
-void btrfs_orphan_release_metadata(struct inode *inode)
+void btrfs_orphan_release_metadata(struct btrfs_inode *inode)
 {
-       struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
-       struct btrfs_root *root = BTRFS_I(inode)->root;
+       struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
+       struct btrfs_root *root = inode->root;
        u64 num_bytes = btrfs_calc_trans_metadata_size(fs_info, 1);
 
-       trace_btrfs_space_reservation(fs_info, "orphan",
-                                     btrfs_ino(BTRFS_I(inode)), num_bytes, 0);
+       trace_btrfs_space_reservation(fs_info, "orphan", btrfs_ino(inode),
+                       num_bytes, 0);
        btrfs_block_rsv_release(fs_info, root->orphan_block_rsv, num_bytes);
 }
 
index 12345d4f25a53a4f404405120f4d8e4fc04d565b..8a14b47b4dc07eea7b50853507bbc1b61f4efd61 100644 (file)
@@ -3237,7 +3237,7 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode)
                        if (reserve) {
                                clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED,
                                          &BTRFS_I(inode)->runtime_flags);
-                               btrfs_orphan_release_metadata(inode);
+                               btrfs_orphan_release_metadata(BTRFS_I(inode));
                        }
                        if (ret != -EEXIST) {
                                clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
@@ -3291,7 +3291,7 @@ static int btrfs_orphan_del(struct btrfs_trans_handle *trans,
        }
 
        if (release_rsv)
-               btrfs_orphan_release_metadata(inode);
+               btrfs_orphan_release_metadata(BTRFS_I(inode));
 
        return ret;
 }