btrfs: simplify iget helpers
[linux-2.6-block.git] / fs / btrfs / relocation.c
index 018f830e31b581a2d1c04f49612732a914c499ab..3bbae80c752fc302d83e22526c4c98175d253375 100644 (file)
@@ -2970,7 +2970,6 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info,
                                    struct inode *inode,
                                    u64 ino)
 {
-       struct btrfs_key key;
        struct btrfs_root *root = fs_info->tree_root;
        struct btrfs_trans_handle *trans;
        int ret = 0;
@@ -2978,11 +2977,7 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info,
        if (inode)
                goto truncate;
 
-       key.objectid = ino;
-       key.type = BTRFS_INODE_ITEM_KEY;
-       key.offset = 0;
-
-       inode = btrfs_iget(fs_info->sb, &key, root);
+       inode = btrfs_iget(fs_info->sb, ino, root);
        if (IS_ERR(inode))
                return -ENOENT;
 
@@ -3470,7 +3465,6 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info,
        struct inode *inode = NULL;
        struct btrfs_trans_handle *trans;
        struct btrfs_root *root;
-       struct btrfs_key key;
        u64 objectid;
        int err = 0;
 
@@ -3488,10 +3482,7 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info,
        err = __insert_orphan_inode(trans, root, objectid);
        BUG_ON(err);
 
-       key.objectid = objectid;
-       key.type = BTRFS_INODE_ITEM_KEY;
-       key.offset = 0;
-       inode = btrfs_iget(fs_info->sb, &key, root);
+       inode = btrfs_iget(fs_info->sb, objectid, root);
        BUG_ON(IS_ERR(inode));
        BTRFS_I(inode)->index_cnt = group->start;