rcuja: allow non-power of 2 keys
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 29 Aug 2012 05:17:15 +0000 (22:17 -0700)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 14 May 2013 14:22:23 +0000 (16:22 +0200)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rcuja/rcuja.c

index 407c101be65eeaecb98a45b70dad90a360bb81d8..db5072a2133f469672c2010df73e2485e09f2a57 100644 (file)
@@ -1422,13 +1422,13 @@ struct cds_ja *_cds_ja_new(unsigned int key_bits,
 
        switch (key_bits) {
        case 8:
-               ja->key_max = UINT8_MAX;
-               break;
        case 16:
-               ja->key_max = UINT16_MAX;
-               break;
+       case 24:
        case 32:
-               ja->key_max = UINT32_MAX;
+       case 40:
+       case 48:
+       case 56:
+               ja->key_max = (1ULL << key_bits) - 1;
                break;
        case 64:
                ja->key_max = UINT64_MAX;
This page took 0.026681 seconds and 4 git commands to generate.