aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-11-02 15:48:34 -0400
committerChris Mason <chris.mason@oracle.com>2011-11-06 03:08:49 -0500
commit740c3d226cbba6cd6a32adfb66809c94938f3e57 (patch)
tree375a5d2ee3bdc66f29e69e99c3691c3200407820 /fs/btrfs/ioctl.c
parent806468f8bf76a3cb2b626dd282946a6c9c0a50f0 (diff)
Btrfs: fix the new inspection ioctls for 32 bit compat
The new ioctls to follow backrefs are not clean for 32/64 bit compat. This reworks them for u64s everywhere. They are brand new, so there are no problems with changing the interface now. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index cc9893990341..4a34c472f126 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2895,7 +2895,7 @@ static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg)
2895{ 2895{
2896 int ret = 0; 2896 int ret = 0;
2897 int i; 2897 int i;
2898 unsigned long rel_ptr; 2898 u64 rel_ptr;
2899 int size; 2899 int size;
2900 struct btrfs_ioctl_ino_path_args *ipa = NULL; 2900 struct btrfs_ioctl_ino_path_args *ipa = NULL;
2901 struct inode_fs_paths *ipath = NULL; 2901 struct inode_fs_paths *ipath = NULL;
@@ -2930,11 +2930,11 @@ static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg)
2930 goto out; 2930 goto out;
2931 2931
2932 for (i = 0; i < ipath->fspath->elem_cnt; ++i) { 2932 for (i = 0; i < ipath->fspath->elem_cnt; ++i) {
2933 rel_ptr = ipath->fspath->str[i] - (char *)ipath->fspath->str; 2933 rel_ptr = ipath->fspath->val[i] - (u64)ipath->fspath->val;
2934 ipath->fspath->str[i] = (void *)rel_ptr; 2934 ipath->fspath->val[i] = rel_ptr;
2935 } 2935 }
2936 2936
2937 ret = copy_to_user(ipa->fspath, ipath->fspath, size); 2937 ret = copy_to_user((void *)ipa->fspath, (void *)ipath->fspath, size);
2938 if (ret) { 2938 if (ret) {
2939 ret = -EFAULT; 2939 ret = -EFAULT;
2940 goto out; 2940 goto out;
@@ -3017,7 +3017,7 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_root *root,
3017 if (ret < 0) 3017 if (ret < 0)
3018 goto out; 3018 goto out;
3019 3019
3020 ret = copy_to_user(loi->inodes, inodes, size); 3020 ret = copy_to_user((void *)loi->inodes, (void *)inodes, size);
3021 if (ret) 3021 if (ret)
3022 ret = -EFAULT; 3022 ret = -EFAULT;
3023 3023