diff options
author | Jeff Mahoney <jeffm@suse.com> | 2011-11-20 07:31:57 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-11-20 07:42:13 -0500 |
commit | 745c4d8e160afaf6c75e887c27ea4b75c8142b26 (patch) | |
tree | b1e5b3725654f4119f06346cef3a1c94d34accf8 | |
parent | 387125fc722a8ed432066b85a552917343bdafca (diff) |
btrfs: Fix up 32/64-bit compatibility for new ioctls
This patch casts to unsigned long before casting to a pointer and fixes
the following warnings:
fs/btrfs/extent_io.c:2289:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
fs/btrfs/ioctl.c:2933:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
fs/btrfs/ioctl.c:2937:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
fs/btrfs/ioctl.c:3020:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
fs/btrfs/scrub.c:275:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
fs/btrfs/backref.c:686:27: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r-- | fs/btrfs/backref.c | 2 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 2 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 9 | ||||
-rw-r--r-- | fs/btrfs/scrub.c | 2 |
4 files changed, 9 insertions, 6 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 8855aad3929c..22c64fff1bd5 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -683,7 +683,7 @@ static int inode_to_path(u64 inum, struct btrfs_inode_ref *iref, | |||
683 | return PTR_ERR(fspath); | 683 | return PTR_ERR(fspath); |
684 | 684 | ||
685 | if (fspath > fspath_min) { | 685 | if (fspath > fspath_min) { |
686 | ipath->fspath->val[i] = (u64)fspath; | 686 | ipath->fspath->val[i] = (u64)(unsigned long)fspath; |
687 | ++ipath->fspath->elem_cnt; | 687 | ++ipath->fspath->elem_cnt; |
688 | ipath->fspath->bytes_left = fspath - fspath_min; | 688 | ipath->fspath->bytes_left = fspath - fspath_min; |
689 | } else { | 689 | } else { |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 1f87c4d0e7a0..47fdba7853c3 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2286,7 +2286,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err) | |||
2286 | } | 2286 | } |
2287 | if (!uptodate) { | 2287 | if (!uptodate) { |
2288 | u64 failed_mirror; | 2288 | u64 failed_mirror; |
2289 | failed_mirror = (u64)bio->bi_bdev; | 2289 | failed_mirror = (unsigned long)bio->bi_bdev; |
2290 | if (tree->ops && tree->ops->readpage_io_failed_hook) | 2290 | if (tree->ops && tree->ops->readpage_io_failed_hook) |
2291 | ret = tree->ops->readpage_io_failed_hook( | 2291 | ret = tree->ops->readpage_io_failed_hook( |
2292 | bio, page, start, end, | 2292 | bio, page, start, end, |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4a34c472f126..bda53fcd1a09 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -2930,11 +2930,13 @@ 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->val[i] - (u64)ipath->fspath->val; | 2933 | rel_ptr = ipath->fspath->val[i] - |
2934 | (u64)(unsigned long)ipath->fspath->val; | ||
2934 | ipath->fspath->val[i] = rel_ptr; | 2935 | ipath->fspath->val[i] = rel_ptr; |
2935 | } | 2936 | } |
2936 | 2937 | ||
2937 | ret = copy_to_user((void *)ipa->fspath, (void *)ipath->fspath, size); | 2938 | ret = copy_to_user((void *)(unsigned long)ipa->fspath, |
2939 | (void *)(unsigned long)ipath->fspath, size); | ||
2938 | if (ret) { | 2940 | if (ret) { |
2939 | ret = -EFAULT; | 2941 | ret = -EFAULT; |
2940 | goto out; | 2942 | goto out; |
@@ -3017,7 +3019,8 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_root *root, | |||
3017 | if (ret < 0) | 3019 | if (ret < 0) |
3018 | goto out; | 3020 | goto out; |
3019 | 3021 | ||
3020 | ret = copy_to_user((void *)loi->inodes, (void *)inodes, size); | 3022 | ret = copy_to_user((void *)(unsigned long)loi->inodes, |
3023 | (void *)(unsigned long)inodes, size); | ||
3021 | if (ret) | 3024 | if (ret) |
3022 | ret = -EFAULT; | 3025 | ret = -EFAULT; |
3023 | 3026 | ||
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index f4190f22edfb..fab420db5121 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -272,7 +272,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root, void *ctx) | |||
272 | swarn->logical, swarn->dev->name, | 272 | swarn->logical, swarn->dev->name, |
273 | (unsigned long long)swarn->sector, root, inum, offset, | 273 | (unsigned long long)swarn->sector, root, inum, offset, |
274 | min(isize - offset, (u64)PAGE_SIZE), nlink, | 274 | min(isize - offset, (u64)PAGE_SIZE), nlink, |
275 | (char *)ipath->fspath->val[i]); | 275 | (char *)(unsigned long)ipath->fspath->val[i]); |
276 | 276 | ||
277 | free_ipath(ipath); | 277 | free_ipath(ipath); |
278 | return 0; | 278 | return 0; |