btrfs: Make btrfs_delete_delayed_dir_index take btrfs_inode
authorNikolay Borisov <n.borisov.lkml@gmail.com>
Tue, 10 Jan 2017 18:35:36 +0000 (20:35 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Feb 2017 14:50:52 +0000 (15:50 +0100)
Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-inode.c
fs/btrfs/delayed-inode.h
fs/btrfs/inode.c

index a944b6c01053d4684ec26fd836181d700669fe2c..e4364c1ba99beb1c0be98feb6da5d92c961fe0d5 100644 (file)
@@ -1508,18 +1508,18 @@ static int btrfs_delete_delayed_insertion_item(struct btrfs_fs_info *fs_info,
 
 int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
                                   struct btrfs_fs_info *fs_info,
-                                  struct inode *dir, u64 index)
+                                  struct btrfs_inode *dir, u64 index)
 {
        struct btrfs_delayed_node *node;
        struct btrfs_delayed_item *item;
        struct btrfs_key item_key;
        int ret;
 
-       node = btrfs_get_or_create_delayed_node(BTRFS_I(dir));
+       node = btrfs_get_or_create_delayed_node(dir);
        if (IS_ERR(node))
                return PTR_ERR(node);
 
-       item_key.objectid = btrfs_ino(BTRFS_I(dir));
+       item_key.objectid = btrfs_ino(dir);
        item_key.type = BTRFS_DIR_INDEX_KEY;
        item_key.offset = index;
 
index 3cbd9bb79713c7dbfe52b7396670120dca9cdcf4..adf6a8a0b23a05fb99fd52a66eb4cb286060ca70 100644 (file)
@@ -107,7 +107,7 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
 
 int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
                                   struct btrfs_fs_info *fs_info,
-                                  struct inode *dir, u64 index);
+                                  struct btrfs_inode *dir, u64 index);
 
 int btrfs_inode_delayed_dir_index_count(struct inode *inode);
 
index 893ea924e4405334c5021c2422aa815d3c9d2880..31917f9c1a9bbedc923176302240fc8a5cb440a6 100644 (file)
@@ -4046,7 +4046,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
                goto err;
        }
 skip_backref:
-       ret = btrfs_delete_delayed_dir_index(trans, fs_info, dir, index);
+       ret = btrfs_delete_delayed_dir_index(trans, fs_info, BTRFS_I(dir), index);
        if (ret) {
                btrfs_abort_transaction(trans, ret);
                goto err;
@@ -4210,7 +4210,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
        }
        btrfs_release_path(path);
 
-       ret = btrfs_delete_delayed_dir_index(trans, fs_info, dir, index);
+       ret = btrfs_delete_delayed_dir_index(trans, fs_info, BTRFS_I(dir), index);
        if (ret) {
                btrfs_abort_transaction(trans, ret);
                goto out;