Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128915
b: refs/heads/master
c: 2d4d9fb
h: refs/heads/master
i:
  128913: abe3321
  128911: 7d03e93
v: v3
  • Loading branch information
David Woodhouse authored and Chris Mason committed Sep 25, 2008
1 parent 68faa31 commit 10fbf93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 615f996fb8185a0bc02812ebd72cb77ded5645f1
refs/heads/master: 2d4d9fbd6efa858dfa009518fca1ab85a73fd848
13 changes: 12 additions & 1 deletion trunk/fs/btrfs/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,18 @@ static struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid,
struct dentry *result;
struct btrfs_key key;

key.objectid = root_objectid;
btrfs_set_key_type(&key, BTRFS_ROOT_ITEM_KEY);
key.offset = (u64)-1;

root = btrfs_read_fs_root_no_name(btrfs_sb(sb)->fs_info, &key);
if (IS_ERR(root))
return ERR_CAST(root);

key.objectid = objectid;
btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY);
key.offset = 0;

root = btrfs_lookup_fs_root(btrfs_sb(sb)->fs_info, root_objectid);
inode = btrfs_iget(sb, &key, root, NULL);
if (IS_ERR(inode))
return (void *)inode;
Expand Down Expand Up @@ -178,6 +185,10 @@ static struct dentry *btrfs_get_parent(struct dentry *child)

objectid = key.offset;

/* If we are already at the root of a subvol, return the real root */
if (objectid == dir->i_ino)
return dget(dir->i_sb->s_root);

/* Build a new key for the inode item */
key.objectid = objectid;
btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY);
Expand Down

0 comments on commit 10fbf93

Please sign in to comment.