aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/spa.c
diff options
context:
space:
mode:
authorYing Zhu <[email protected]>2013-06-27 19:41:30 +0800
committerBrian Behlendorf <[email protected]>2013-06-27 10:01:25 -0700
commitc12936b141e7479a1402561e9e528731d763747e (patch)
tree136f8631b9c65657db8a66c2720b5d46766be233 /module/zfs/spa.c
parent88c283952f0bfeab54612f9ce666601d83c4244f (diff)
Fix module probe failure on 32-bit systems
Previous commit 7ef5e54e2e28884a04dc800657967b891239e933 caused module probe failure on 32-bit systems, dmesg showed Unknown symbol __moddi3 This was caused by the modulo operation 'gethrtime() % tqs->stqs_count' in the committed code. Instead of implementing __moddi3 for all 32-bit systems, Behlendorf advised we can just cast the return value of gethrtime() into a uint64_t, since gethrtime does not return negative value on all circumstances we need not care about the potential overflow. Signed-off-by: Ying Zhu <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1551
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r--module/zfs/spa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index ba376fb58..c885e3e41 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -920,7 +920,7 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
if (tqs->stqs_count == 1) {
tq = tqs->stqs_taskq[0];
} else {
- tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count];
+ tq = tqs->stqs_taskq[((uint64_t)gethrtime()) % tqs->stqs_count];
}
taskq_dispatch_ent(tq, func, arg, flags, ent);
@@ -943,7 +943,7 @@ spa_taskq_dispatch_sync(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
if (tqs->stqs_count == 1) {
tq = tqs->stqs_taskq[0];
} else {
- tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count];
+ tq = tqs->stqs_taskq[((uint64_t)gethrtime()) % tqs->stqs_count];
}
id = taskq_dispatch(tq, func, arg, flags);