diff options
author | David Sterba <dsterba@suse.cz> | 2014-06-04 12:41:45 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 16:37:12 -0400 |
commit | 962a298f35110edd8f326814ae41a3dd306ecb64 (patch) | |
tree | 87849276cdc00964137b4fb663eb54ef1a7eea1d /fs/btrfs/inode-item.c | |
parent | 3abdbd780e9d75f0648b8a502c3789857b1e92ce (diff) |
btrfs: kill the key type accessor helpers
btrfs_set_key_type and btrfs_key_type are used inconsistently along with
open coded variants. Other members of btrfs_key are accessed directly
without any helpers anyway.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/inode-item.c')
-rw-r--r-- | fs/btrfs/inode-item.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c index 2be38df703c9..8ffa4783cbf4 100644 --- a/fs/btrfs/inode-item.c +++ b/fs/btrfs/inode-item.c | |||
@@ -135,7 +135,7 @@ static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans, | |||
135 | u32 item_size; | 135 | u32 item_size; |
136 | 136 | ||
137 | key.objectid = inode_objectid; | 137 | key.objectid = inode_objectid; |
138 | btrfs_set_key_type(&key, BTRFS_INODE_EXTREF_KEY); | 138 | key.type = BTRFS_INODE_EXTREF_KEY; |
139 | key.offset = btrfs_extref_hash(ref_objectid, name, name_len); | 139 | key.offset = btrfs_extref_hash(ref_objectid, name, name_len); |
140 | 140 | ||
141 | path = btrfs_alloc_path(); | 141 | path = btrfs_alloc_path(); |
@@ -209,7 +209,7 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, | |||
209 | 209 | ||
210 | key.objectid = inode_objectid; | 210 | key.objectid = inode_objectid; |
211 | key.offset = ref_objectid; | 211 | key.offset = ref_objectid; |
212 | btrfs_set_key_type(&key, BTRFS_INODE_REF_KEY); | 212 | key.type = BTRFS_INODE_REF_KEY; |
213 | 213 | ||
214 | path = btrfs_alloc_path(); | 214 | path = btrfs_alloc_path(); |
215 | if (!path) | 215 | if (!path) |
@@ -337,7 +337,7 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans, | |||
337 | 337 | ||
338 | key.objectid = inode_objectid; | 338 | key.objectid = inode_objectid; |
339 | key.offset = ref_objectid; | 339 | key.offset = ref_objectid; |
340 | btrfs_set_key_type(&key, BTRFS_INODE_REF_KEY); | 340 | key.type = BTRFS_INODE_REF_KEY; |
341 | 341 | ||
342 | path = btrfs_alloc_path(); | 342 | path = btrfs_alloc_path(); |
343 | if (!path) | 343 | if (!path) |
@@ -400,7 +400,7 @@ int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans, | |||
400 | struct btrfs_key key; | 400 | struct btrfs_key key; |
401 | int ret; | 401 | int ret; |
402 | key.objectid = objectid; | 402 | key.objectid = objectid; |
403 | btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY); | 403 | key.type = BTRFS_INODE_ITEM_KEY; |
404 | key.offset = 0; | 404 | key.offset = 0; |
405 | 405 | ||
406 | ret = btrfs_insert_empty_item(trans, root, path, &key, | 406 | ret = btrfs_insert_empty_item(trans, root, path, &key, |
@@ -420,13 +420,13 @@ int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root | |||
420 | struct btrfs_key found_key; | 420 | struct btrfs_key found_key; |
421 | 421 | ||
422 | ret = btrfs_search_slot(trans, root, location, path, ins_len, cow); | 422 | ret = btrfs_search_slot(trans, root, location, path, ins_len, cow); |
423 | if (ret > 0 && btrfs_key_type(location) == BTRFS_ROOT_ITEM_KEY && | 423 | if (ret > 0 && location->type == BTRFS_ROOT_ITEM_KEY && |
424 | location->offset == (u64)-1 && path->slots[0] != 0) { | 424 | location->offset == (u64)-1 && path->slots[0] != 0) { |
425 | slot = path->slots[0] - 1; | 425 | slot = path->slots[0] - 1; |
426 | leaf = path->nodes[0]; | 426 | leaf = path->nodes[0]; |
427 | btrfs_item_key_to_cpu(leaf, &found_key, slot); | 427 | btrfs_item_key_to_cpu(leaf, &found_key, slot); |
428 | if (found_key.objectid == location->objectid && | 428 | if (found_key.objectid == location->objectid && |
429 | btrfs_key_type(&found_key) == btrfs_key_type(location)) { | 429 | found_key.type == location->type) { |
430 | path->slots[0]--; | 430 | path->slots[0]--; |
431 | return 0; | 431 | return 0; |
432 | } | 432 | } |