From 62afb8af5c67bf212cdcf9fce90dbda4bad044e5 Mon Sep 17 00:00:00 2001 From: Liu Bo Date: Fri, 7 Sep 2012 20:01:29 -0600 Subject: [PATCH] --- yaml --- r: 332557 b: refs/heads/master c: df031f0752d50f2061df2847d57ea52a79f7977c h: refs/heads/master i: 332555: 8a149ac897717c225b3cfb41798c5dce5a818d80 v: v3 --- [refs] | 2 +- trunk/fs/btrfs/ioctl.c | 19 +++---------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 20801c447cc5..92e70483e9bc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 69917e431210f8712fe050f47b7561e7dae89521 +refs/heads/master: df031f0752d50f2061df2847d57ea52a79f7977c diff --git a/trunk/fs/btrfs/ioctl.c b/trunk/fs/btrfs/ioctl.c index 48ff3f7317b0..fa1284d596ea 100644 --- a/trunk/fs/btrfs/ioctl.c +++ b/trunk/fs/btrfs/ioctl.c @@ -3210,12 +3210,9 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_root *root, { int ret = 0; int size; - u64 extent_item_pos; - u64 flags = 0; struct btrfs_ioctl_logical_ino_args *loi; struct btrfs_data_container *inodes = NULL; struct btrfs_path *path = NULL; - struct btrfs_key key; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -3241,23 +3238,13 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_root *root, goto out; } - ret = extent_from_logical(root->fs_info, loi->logical, path, &key, - &flags); - btrfs_release_path(path); - - if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) + ret = iterate_inodes_from_logical(loi->logical, root->fs_info, path, + build_ino_list, inodes); + if (ret == -EINVAL) ret = -ENOENT; if (ret < 0) goto out; - extent_item_pos = loi->logical - key.objectid; - ret = iterate_extent_inodes(root->fs_info, key.objectid, - extent_item_pos, 0, build_ino_list, - inodes); - - if (ret < 0) - goto out; - ret = copy_to_user((void *)(unsigned long)loi->inodes, (void *)(unsigned long)inodes, size); if (ret)