5151#include "block-group.h"
5252
5353struct btrfs_iget_args {
54- struct btrfs_key * location ;
54+ u64 ino ;
5555 struct btrfs_root * root ;
5656};
5757
@@ -2978,7 +2978,7 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
29782978 found_key .objectid = found_key .offset ;
29792979 found_key .type = BTRFS_INODE_ITEM_KEY ;
29802980 found_key .offset = 0 ;
2981- inode = btrfs_iget (fs_info -> sb , & found_key , root );
2981+ inode = btrfs_iget (fs_info -> sb , last_objectid , root );
29822982 ret = PTR_ERR_OR_ZERO (inode );
29832983 if (ret && ret != - ENOENT )
29842984 goto out ;
@@ -5223,9 +5223,11 @@ static void inode_tree_del(struct inode *inode)
52235223static int btrfs_init_locked_inode (struct inode * inode , void * p )
52245224{
52255225 struct btrfs_iget_args * args = p ;
5226- inode -> i_ino = args -> location -> objectid ;
5227- memcpy (& BTRFS_I (inode )-> location , args -> location ,
5228- sizeof (* args -> location ));
5226+
5227+ inode -> i_ino = args -> ino ;
5228+ BTRFS_I (inode )-> location .objectid = args -> ino ;
5229+ BTRFS_I (inode )-> location .type = BTRFS_INODE_ITEM_KEY ;
5230+ BTRFS_I (inode )-> location .offset = 0 ;
52295231 BTRFS_I (inode )-> root = btrfs_grab_root (args -> root );
52305232 BUG_ON (args -> root && !BTRFS_I (inode )-> root );
52315233 return 0 ;
@@ -5234,19 +5236,19 @@ static int btrfs_init_locked_inode(struct inode *inode, void *p)
52345236static int btrfs_find_actor (struct inode * inode , void * opaque )
52355237{
52365238 struct btrfs_iget_args * args = opaque ;
5237- return args -> location -> objectid == BTRFS_I (inode )-> location .objectid &&
5239+
5240+ return args -> ino == BTRFS_I (inode )-> location .objectid &&
52385241 args -> root == BTRFS_I (inode )-> root ;
52395242}
52405243
5241- static struct inode * btrfs_iget_locked (struct super_block * s ,
5242- struct btrfs_key * location ,
5244+ static struct inode * btrfs_iget_locked (struct super_block * s , u64 ino ,
52435245 struct btrfs_root * root )
52445246{
52455247 struct inode * inode ;
52465248 struct btrfs_iget_args args ;
5247- unsigned long hashval = btrfs_inode_hash (location -> objectid , root );
5249+ unsigned long hashval = btrfs_inode_hash (ino , root );
52485250
5249- args .location = location ;
5251+ args .ino = ino ;
52505252 args .root = root ;
52515253
52525254 inode = iget5_locked (s , hashval , btrfs_find_actor ,
@@ -5256,17 +5258,17 @@ static struct inode *btrfs_iget_locked(struct super_block *s,
52565258}
52575259
52585260/*
5259- * Get an inode object given its location and corresponding root.
5261+ * Get an inode object given its inode number and corresponding root.
52605262 * Path can be preallocated to prevent recursing back to iget through
52615263 * allocator. NULL is also valid but may require an additional allocation
52625264 * later.
52635265 */
5264- struct inode * btrfs_iget_path (struct super_block * s , struct btrfs_key * location ,
5266+ struct inode * btrfs_iget_path (struct super_block * s , u64 ino ,
52655267 struct btrfs_root * root , struct btrfs_path * path )
52665268{
52675269 struct inode * inode ;
52685270
5269- inode = btrfs_iget_locked (s , location , root );
5271+ inode = btrfs_iget_locked (s , ino , root );
52705272 if (!inode )
52715273 return ERR_PTR (- ENOMEM );
52725274
@@ -5293,10 +5295,9 @@ struct inode *btrfs_iget_path(struct super_block *s, struct btrfs_key *location,
52935295 return inode ;
52945296}
52955297
5296- struct inode * btrfs_iget (struct super_block * s , struct btrfs_key * location ,
5297- struct btrfs_root * root )
5298+ struct inode * btrfs_iget (struct super_block * s , u64 ino , struct btrfs_root * root )
52985299{
5299- return btrfs_iget_path (s , location , root , NULL );
5300+ return btrfs_iget_path (s , ino , root , NULL );
53005301}
53015302
53025303static struct inode * new_simple_dir (struct super_block * s ,
@@ -5365,7 +5366,7 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
53655366 return ERR_PTR (ret );
53665367
53675368 if (location .type == BTRFS_INODE_ITEM_KEY ) {
5368- inode = btrfs_iget (dir -> i_sb , & location , root );
5369+ inode = btrfs_iget (dir -> i_sb , location . objectid , root );
53695370 if (IS_ERR (inode ))
53705371 return inode ;
53715372
@@ -5389,7 +5390,7 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
53895390 else
53905391 inode = new_simple_dir (dir -> i_sb , & location , sub_root );
53915392 } else {
5392- inode = btrfs_iget (dir -> i_sb , & location , sub_root );
5393+ inode = btrfs_iget (dir -> i_sb , location . objectid , sub_root );
53935394 }
53945395 if (root != sub_root )
53955396 btrfs_put_root (sub_root );
@@ -5770,7 +5771,8 @@ int btrfs_set_inode_index(struct btrfs_inode *dir, u64 *index)
57705771static int btrfs_insert_inode_locked (struct inode * inode )
57715772{
57725773 struct btrfs_iget_args args ;
5773- args .location = & BTRFS_I (inode )-> location ;
5774+
5775+ args .ino = BTRFS_I (inode )-> location .objectid ;
57745776 args .root = BTRFS_I (inode )-> root ;
57755777
57765778 return insert_inode_locked4 (inode ,
0 commit comments