aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 4deb280f8969..7d10d1ccb0fe 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2153,7 +2153,7 @@ void btrfs_orphan_cleanup(struct btrfs_root *root)
2153 found_key.objectid = found_key.offset; 2153 found_key.objectid = found_key.offset;
2154 found_key.type = BTRFS_INODE_ITEM_KEY; 2154 found_key.type = BTRFS_INODE_ITEM_KEY;
2155 found_key.offset = 0; 2155 found_key.offset = 0;
2156 inode = btrfs_iget(root->fs_info->sb, &found_key, root); 2156 inode = btrfs_iget(root->fs_info->sb, &found_key, root, NULL);
2157 if (IS_ERR(inode)) 2157 if (IS_ERR(inode))
2158 break; 2158 break;
2159 2159
@@ -3687,7 +3687,7 @@ static struct inode *btrfs_iget_locked(struct super_block *s,
3687 * Returns in *is_new if the inode was read from disk 3687 * Returns in *is_new if the inode was read from disk
3688 */ 3688 */
3689struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location, 3689struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location,
3690 struct btrfs_root *root) 3690 struct btrfs_root *root, int *new)
3691{ 3691{
3692 struct inode *inode; 3692 struct inode *inode;
3693 3693
@@ -3702,6 +3702,8 @@ struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location,
3702 3702
3703 inode_tree_add(inode); 3703 inode_tree_add(inode);
3704 unlock_new_inode(inode); 3704 unlock_new_inode(inode);
3705 if (new)
3706 *new = 1;
3705 } 3707 }
3706 3708
3707 return inode; 3709 return inode;
@@ -3754,7 +3756,7 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
3754 return NULL; 3756 return NULL;
3755 3757
3756 if (location.type == BTRFS_INODE_ITEM_KEY) { 3758 if (location.type == BTRFS_INODE_ITEM_KEY) {
3757 inode = btrfs_iget(dir->i_sb, &location, root); 3759 inode = btrfs_iget(dir->i_sb, &location, root, NULL);
3758 return inode; 3760 return inode;
3759 } 3761 }
3760 3762
@@ -3769,7 +3771,7 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
3769 else 3771 else
3770 inode = new_simple_dir(dir->i_sb, &location, sub_root); 3772 inode = new_simple_dir(dir->i_sb, &location, sub_root);
3771 } else { 3773 } else {
3772 inode = btrfs_iget(dir->i_sb, &location, sub_root); 3774 inode = btrfs_iget(dir->i_sb, &location, sub_root, NULL);
3773 } 3775 }
3774 srcu_read_unlock(&root->fs_info->subvol_srcu, index); 3776 srcu_read_unlock(&root->fs_info->subvol_srcu, index);
3775 3777