* [PATCH] Btrfs: use do_div to avoid compile errors on 32bit box
@ 2011-08-19 9:48 Liu Bo
2011-08-19 13:22 ` Josef Bacik
0 siblings, 1 reply; 5+ messages in thread
From: Liu Bo @ 2011-08-19 9:48 UTC (permalink / raw)
To: linux-btrfs; +Cc: chris.mason, dave
When doing div operation of u64 type, we need to be careful and use do_div
to avoid compile ERROR on 32bit box:
"ERROR: "__udivdi3" [fs/btrfs/btrfs.ko] undefined!
make[1]: *** [__modpost] Error 1
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
---
fs/btrfs/extent-tree.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 80d6148..9b495ce 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6796,14 +6796,14 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
index = get_block_group_index(block_group);
if (index == 0) {
dev_min = 4;
- min_free /= 2;
+ do_div(min_free, 2);
} else if (index == 1) {
dev_min = 2;
} else if (index == 2) {
min_free *= 2;
} else if (index == 3) {
dev_min = fs_devices->rw_devices;
- min_free /= dev_min;
+ do_div(min_free, dev_min);
}
mutex_lock(&root->fs_info->chunk_mutex);
--
1.6.5.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Btrfs: use do_div to avoid compile errors on 32bit box
2011-08-19 9:48 Liu Bo
@ 2011-08-19 13:22 ` Josef Bacik
2011-08-20 1:35 ` liubo
0 siblings, 1 reply; 5+ messages in thread
From: Josef Bacik @ 2011-08-19 13:22 UTC (permalink / raw)
To: Liu Bo; +Cc: linux-btrfs, chris.mason, dave
On Fri, Aug 19, 2011 at 05:48:44PM +0800, Liu Bo wrote:
> When doing div operation of u64 type, we need to be careful and use do_div
> to avoid compile ERROR on 32bit box:
>
> "ERROR: "__udivdi3" [fs/btrfs/btrfs.ko] undefined!
> make[1]: *** [__modpost] Error 1
>
> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Chris just left for vacation, can you send this to Linus/lkml so it gets pulled
in. Thanks,
Josef
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Btrfs: use do_div to avoid compile errors on 32bit box
@ 2011-08-20 1:34 Liu Bo
2011-08-20 1:46 ` liubo
0 siblings, 1 reply; 5+ messages in thread
From: Liu Bo @ 2011-08-20 1:34 UTC (permalink / raw)
To: linux-kernel, torvalds; +Cc: linux-btrfs, chris.mason, dave
When doing div operation of u64 type, we need to be careful and use do_div
to avoid compile ERROR on 32bit box:
"ERROR: "__udivdi3" [fs/btrfs/btrfs.ko] undefined!
make[1]: *** [__modpost] Error 1
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
---
fs/btrfs/extent-tree.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 80d6148..9b495ce 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6796,14 +6796,14 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
index = get_block_group_index(block_group);
if (index == 0) {
dev_min = 4;
- min_free /= 2;
+ do_div(min_free, 2);
} else if (index == 1) {
dev_min = 2;
} else if (index == 2) {
min_free *= 2;
} else if (index == 3) {
dev_min = fs_devices->rw_devices;
- min_free /= dev_min;
+ do_div(min_free, dev_min);
}
mutex_lock(&root->fs_info->chunk_mutex);
--
1.6.5.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Btrfs: use do_div to avoid compile errors on 32bit box
2011-08-19 13:22 ` Josef Bacik
@ 2011-08-20 1:35 ` liubo
0 siblings, 0 replies; 5+ messages in thread
From: liubo @ 2011-08-20 1:35 UTC (permalink / raw)
To: Josef Bacik; +Cc: linux-btrfs, chris.mason, dave
On 08/19/2011 09:22 PM, Josef Bacik wrote:
> On Fri, Aug 19, 2011 at 05:48:44PM +0800, Liu Bo wrote:
>> When doing div operation of u64 type, we need to be careful and use do_div
>> to avoid compile ERROR on 32bit box:
>>
>> "ERROR: "__udivdi3" [fs/btrfs/btrfs.ko] undefined!
>> make[1]: *** [__modpost] Error 1
>>
>> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
>
> Chris just left for vacation, can you send this to Linus/lkml so it gets pulled
> in. Thanks,
>
Already done.
thanks,
liubo
> Josef
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Btrfs: use do_div to avoid compile errors on 32bit box
2011-08-20 1:34 [PATCH] Btrfs: use do_div to avoid compile errors on 32bit box Liu Bo
@ 2011-08-20 1:46 ` liubo
0 siblings, 0 replies; 5+ messages in thread
From: liubo @ 2011-08-20 1:46 UTC (permalink / raw)
To: linux-kernel, torvalds; +Cc: linux-btrfs, chris.mason, dave
On 08/20/2011 09:34 AM, Liu Bo wrote:
> When doing div operation of u64 type, we need to be careful and use do_div
> to avoid compile ERROR on 32bit box:
>
> "ERROR: "__udivdi3" [fs/btrfs/btrfs.ko] undefined!
> make[1]: *** [__modpost] Error 1
>
Sorry, guys, I just sent a wrong version.
Plz ignore this one. I'm sorry.
thanks,
liubo
> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
> ---
> fs/btrfs/extent-tree.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 80d6148..9b495ce 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -6796,14 +6796,14 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
> index = get_block_group_index(block_group);
> if (index == 0) {
> dev_min = 4;
> - min_free /= 2;
> + do_div(min_free, 2);
> } else if (index == 1) {
> dev_min = 2;
> } else if (index == 2) {
> min_free *= 2;
> } else if (index == 3) {
> dev_min = fs_devices->rw_devices;
> - min_free /= dev_min;
> + do_div(min_free, dev_min);
> }
>
> mutex_lock(&root->fs_info->chunk_mutex);
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-20 1:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-20 1:34 [PATCH] Btrfs: use do_div to avoid compile errors on 32bit box Liu Bo
2011-08-20 1:46 ` liubo
-- strict thread matches above, loose matches on Subject: below --
2011-08-19 9:48 Liu Bo
2011-08-19 13:22 ` Josef Bacik
2011-08-20 1:35 ` liubo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.