aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-05-22 07:11:22 -0400
committerChris Mason <chris.mason@oracle.com>2011-05-22 07:11:22 -0400
commit0d0ca30f180906224be6279788f2b202cfd959d8 (patch)
treea0e35c968410f3f08f2a215ed5b4d6449d8bd11f /fs/btrfs/delayed-inode.c
parentdcc6d073225b6b732a52477c91bd4edc9b4d5502 (diff)
Btrfs: update the delayed inode code to use the btrfs_ino helper.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r--fs/btrfs/delayed-inode.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index 95485318f001..c25405f69360 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -88,6 +88,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
88 struct btrfs_delayed_node *node; 88 struct btrfs_delayed_node *node;
89 struct btrfs_inode *btrfs_inode = BTRFS_I(inode); 89 struct btrfs_inode *btrfs_inode = BTRFS_I(inode);
90 struct btrfs_root *root = btrfs_inode->root; 90 struct btrfs_root *root = btrfs_inode->root;
91 u64 ino = btrfs_ino(inode);
91 int ret; 92 int ret;
92 93
93again: 94again:
@@ -98,7 +99,7 @@ again:
98 } 99 }
99 100
100 spin_lock(&root->inode_lock); 101 spin_lock(&root->inode_lock);
101 node = radix_tree_lookup(&root->delayed_nodes_tree, inode->i_ino); 102 node = radix_tree_lookup(&root->delayed_nodes_tree, ino);
102 if (node) { 103 if (node) {
103 if (btrfs_inode->delayed_node) { 104 if (btrfs_inode->delayed_node) {
104 spin_unlock(&root->inode_lock); 105 spin_unlock(&root->inode_lock);
@@ -115,7 +116,7 @@ again:
115 node = kmem_cache_alloc(delayed_node_cache, GFP_NOFS); 116 node = kmem_cache_alloc(delayed_node_cache, GFP_NOFS);
116 if (!node) 117 if (!node)
117 return ERR_PTR(-ENOMEM); 118 return ERR_PTR(-ENOMEM);
118 btrfs_init_delayed_node(node, root, inode->i_ino); 119 btrfs_init_delayed_node(node, root, ino);
119 120
120 atomic_inc(&node->refs); /* cached in the btrfs inode */ 121 atomic_inc(&node->refs); /* cached in the btrfs inode */
121 atomic_inc(&node->refs); /* can be accessed */ 122 atomic_inc(&node->refs); /* can be accessed */
@@ -127,7 +128,7 @@ again:
127 } 128 }
128 129
129 spin_lock(&root->inode_lock); 130 spin_lock(&root->inode_lock);
130 ret = radix_tree_insert(&root->delayed_nodes_tree, inode->i_ino, node); 131 ret = radix_tree_insert(&root->delayed_nodes_tree, ino, node);
131 if (ret == -EEXIST) { 132 if (ret == -EEXIST) {
132 kmem_cache_free(delayed_node_cache, node); 133 kmem_cache_free(delayed_node_cache, node);
133 spin_unlock(&root->inode_lock); 134 spin_unlock(&root->inode_lock);
@@ -1274,7 +1275,7 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
1274 */ 1275 */
1275 BUG_ON(ret); 1276 BUG_ON(ret);
1276 1277
1277 delayed_item->key.objectid = dir->i_ino; 1278 delayed_item->key.objectid = btrfs_ino(dir);
1278 btrfs_set_key_type(&delayed_item->key, BTRFS_DIR_INDEX_KEY); 1279 btrfs_set_key_type(&delayed_item->key, BTRFS_DIR_INDEX_KEY);
1279 delayed_item->key.offset = index; 1280 delayed_item->key.offset = index;
1280 1281
@@ -1337,7 +1338,7 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
1337 if (IS_ERR(node)) 1338 if (IS_ERR(node))
1338 return PTR_ERR(node); 1339 return PTR_ERR(node);
1339 1340
1340 item_key.objectid = dir->i_ino; 1341 item_key.objectid = btrfs_ino(dir);
1341 btrfs_set_key_type(&item_key, BTRFS_DIR_INDEX_KEY); 1342 btrfs_set_key_type(&item_key, BTRFS_DIR_INDEX_KEY);
1342 item_key.offset = index; 1343 item_key.offset = index;
1343 1344