btrfs: Make btrfs_get_delayed_node take btrfs_inode
authorNikolay Borisov <n.borisov.lkml@gmail.com>
Tue, 10 Jan 2017 18:35:32 +0000 (20:35 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Feb 2017 14:50:51 +0000 (15:50 +0100)
This function is internal to btrfs and doesn't really deal with any
VFS members, as such it needn't take a struct inode refrence but
btrfs_inode.

Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-inode.c

index 40be1289134405e39b3a36d830db92f0bbc040ed..c97517f2a48eef0f975dab8eb1bf49eb73ef95a2 100644 (file)
@@ -72,9 +72,8 @@ static inline int btrfs_is_continuous_delayed_item(
        return 0;
 }
 
-static struct btrfs_delayed_node *btrfs_get_delayed_node(struct inode *inode)
+static struct btrfs_delayed_node *btrfs_get_delayed_node(struct btrfs_inode *btrfs_inode)
 {
-       struct btrfs_inode *btrfs_inode = BTRFS_I(inode);
        struct btrfs_root *root = btrfs_inode->root;
        u64 ino = btrfs_ino(btrfs_inode);
        struct btrfs_delayed_node *node;
@@ -116,7 +115,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
        int ret;
 
 again:
-       node = btrfs_get_delayed_node(inode);
+       node = btrfs_get_delayed_node(btrfs_inode);
        if (node)
                return node;
 
@@ -1198,7 +1197,7 @@ int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans,
 int btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans,
                                     struct inode *inode)
 {
-       struct btrfs_delayed_node *delayed_node = btrfs_get_delayed_node(inode);
+       struct btrfs_delayed_node *delayed_node = btrfs_get_delayed_node(BTRFS_I(inode));
        struct btrfs_path *path;
        struct btrfs_block_rsv *block_rsv;
        int ret;
@@ -1237,7 +1236,7 @@ int btrfs_commit_inode_delayed_inode(struct inode *inode)
 {
        struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
        struct btrfs_trans_handle *trans;
-       struct btrfs_delayed_node *delayed_node = btrfs_get_delayed_node(inode);
+       struct btrfs_delayed_node *delayed_node = btrfs_get_delayed_node(BTRFS_I(inode));
        struct btrfs_path *path;
        struct btrfs_block_rsv *block_rsv;
        int ret;
@@ -1560,7 +1559,7 @@ end:
 
 int btrfs_inode_delayed_dir_index_count(struct inode *inode)
 {
-       struct btrfs_delayed_node *delayed_node = btrfs_get_delayed_node(inode);
+       struct btrfs_delayed_node *delayed_node = btrfs_get_delayed_node(BTRFS_I(inode));
 
        if (!delayed_node)
                return -ENOENT;
@@ -1587,7 +1586,7 @@ bool btrfs_readdir_get_delayed_items(struct inode *inode,
        struct btrfs_delayed_node *delayed_node;
        struct btrfs_delayed_item *item;
 
-       delayed_node = btrfs_get_delayed_node(inode);
+       delayed_node = btrfs_get_delayed_node(BTRFS_I(inode));
        if (!delayed_node)
                return false;
 
@@ -1776,7 +1775,7 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev)
        struct btrfs_delayed_node *delayed_node;
        struct btrfs_inode_item *inode_item;
 
-       delayed_node = btrfs_get_delayed_node(inode);
+       delayed_node = btrfs_get_delayed_node(BTRFS_I(inode));
        if (!delayed_node)
                return -ENOENT;
 
@@ -1937,7 +1936,7 @@ void btrfs_kill_delayed_inode_items(struct inode *inode)
 {
        struct btrfs_delayed_node *delayed_node;
 
-       delayed_node = btrfs_get_delayed_node(inode);
+       delayed_node = btrfs_get_delayed_node(BTRFS_I(inode));
        if (!delayed_node)
                return;