diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-05-22 07:11:22 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-05-22 07:11:22 -0400 |
commit | 0d0ca30f180906224be6279788f2b202cfd959d8 (patch) | |
tree | a0e35c968410f3f08f2a215ed5b4d6449d8bd11f | |
parent | dcc6d073225b6b732a52477c91bd4edc9b4d5502 (diff) |
Btrfs: update the delayed inode code to use the btrfs_ino helper.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r-- | fs/btrfs/delayed-inode.c | 11 | ||||
-rw-r--r-- | fs/btrfs/dir-item.c | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 95485318f00..c25405f6936 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 | ||
93 | again: | 94 | again: |
@@ -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 | ||
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index f53fb3847c9..e757202a014 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c | |||
@@ -138,7 +138,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root | |||
138 | struct btrfs_disk_key disk_key; | 138 | struct btrfs_disk_key disk_key; |
139 | u32 data_size; | 139 | u32 data_size; |
140 | 140 | ||
141 | key.objectid = dir->i_ino; | 141 | key.objectid = btrfs_ino(dir); |
142 | btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); | 142 | btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); |
143 | key.offset = btrfs_name_hash(name, name_len); | 143 | key.offset = btrfs_name_hash(name, name_len); |
144 | 144 | ||