summaryrefslogtreecommitdiffstats
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
parent90fdde147fd32d18a20be5b498d5f26e56cca8a3 (diff)
downloadtalos-op-linux-1b53ac4d1b75b23bdc2b54ace787b8f718a987ef.tar.gz
talos-op-linux-1b53ac4d1b75b23bdc2b54ace787b8f718a987ef.zip
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>
-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,
}
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);
OpenPOWER on IntegriCloud