aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2010-03-18 12:17:05 -0400
committerChris Mason <chris.mason@oracle.com>2010-03-18 12:17:05 -0400
commit1b53ac4d1b75b23bdc2b54ace787b8f718a987ef (patch)
tree4ba3bf8dc5159d4b382b1e44306eef1875203c6a /fs/btrfs/ioctl.c
parent90fdde147fd32d18a20be5b498d5f26e56cca8a3 (diff)
Btrfs: allow treeid==0 in the inode lookup ioctl
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>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index fd757f576956..1e462de6556e 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1215,6 +1215,9 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,
1215 } 1215 }
1216 inode = fdentry(file)->d_inode; 1216 inode = fdentry(file)->d_inode;
1217 1217
1218 if (args->treeid == 0)
1219 args->treeid = BTRFS_I(inode)->root->root_key.objectid;
1220
1218 ret = btrfs_search_path_in_tree(BTRFS_I(inode)->root->fs_info, 1221 ret = btrfs_search_path_in_tree(BTRFS_I(inode)->root->fs_info,
1219 args->treeid, args->objectid, 1222 args->treeid, args->objectid,
1220 args->name); 1223 args->name);