Skip to content

Commit

Permalink
Btrfs: allow treeid==0 in the inode lookup ioctl
Browse files Browse the repository at this point in the history
When a root id of 0 is sent to the inode lookup ioctl, it will
use the root of the file we're ioctling and pass the root id
back to userland along with the results.

This allows userland to do searches based on that root later on.


Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
chrismason-xx committed Mar 18, 2010
1 parent 90fdde1 commit 1b53ac4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/btrfs/ioctl.c
Expand Up @@ -1215,6 +1215,9 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,
}
inode = fdentry(file)->d_inode;

if (args->treeid == 0)
args->treeid = BTRFS_I(inode)->root->root_key.objectid;

ret = btrfs_search_path_in_tree(BTRFS_I(inode)->root->fs_info,
args->treeid, args->objectid,
args->name);
Expand Down

0 comments on commit 1b53ac4

Please sign in to comment.