diff options
-rw-r--r-- | include/linux/rhashtable.h | 6 | ||||
-rw-r--r-- | lib/rhashtable.c | 2 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index 99f2e49a8a07..e23d242d1230 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h | |||
@@ -88,7 +88,7 @@ struct rhashtable_compare_arg { | |||
88 | }; | 88 | }; |
89 | 89 | ||
90 | typedef u32 (*rht_hashfn_t)(const void *data, u32 len, u32 seed); | 90 | typedef u32 (*rht_hashfn_t)(const void *data, u32 len, u32 seed); |
91 | typedef u32 (*rht_obj_hashfn_t)(const void *data, u32 seed); | 91 | typedef u32 (*rht_obj_hashfn_t)(const void *data, u32 len, u32 seed); |
92 | typedef int (*rht_obj_cmpfn_t)(struct rhashtable_compare_arg *arg, | 92 | typedef int (*rht_obj_cmpfn_t)(struct rhashtable_compare_arg *arg, |
93 | const void *obj); | 93 | const void *obj); |
94 | 94 | ||
@@ -242,7 +242,9 @@ static inline unsigned int rht_head_hashfn( | |||
242 | const char *ptr = rht_obj(ht, he); | 242 | const char *ptr = rht_obj(ht, he); |
243 | 243 | ||
244 | return likely(params.obj_hashfn) ? | 244 | return likely(params.obj_hashfn) ? |
245 | rht_bucket_index(tbl, params.obj_hashfn(ptr, tbl->hash_rnd)) : | 245 | rht_bucket_index(tbl, params.obj_hashfn(ptr, params.key_len ?: |
246 | ht->p.key_len, | ||
247 | tbl->hash_rnd)) : | ||
246 | rht_key_hashfn(ht, tbl, ptr + params.key_offset, params); | 248 | rht_key_hashfn(ht, tbl, ptr + params.key_offset, params); |
247 | } | 249 | } |
248 | 250 | ||
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 4b7b7e672b93..4898442b837f 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
@@ -691,7 +691,7 @@ static u32 rhashtable_jhash2(const void *key, u32 length, u32 seed) | |||
691 | * struct rhash_head node; | 691 | * struct rhash_head node; |
692 | * }; | 692 | * }; |
693 | * | 693 | * |
694 | * u32 my_hash_fn(const void *data, u32 seed) | 694 | * u32 my_hash_fn(const void *data, u32 len, u32 seed) |
695 | * { | 695 | * { |
696 | * struct test_obj *obj = data; | 696 | * struct test_obj *obj = data; |
697 | * | 697 | * |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 4caa809dbbe0..19909d0786a2 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -3127,7 +3127,7 @@ static struct pernet_operations __net_initdata netlink_net_ops = { | |||
3127 | .exit = netlink_net_exit, | 3127 | .exit = netlink_net_exit, |
3128 | }; | 3128 | }; |
3129 | 3129 | ||
3130 | static inline u32 netlink_hash(const void *data, u32 seed) | 3130 | static inline u32 netlink_hash(const void *data, u32 len, u32 seed) |
3131 | { | 3131 | { |
3132 | const struct netlink_sock *nlk = data; | 3132 | const struct netlink_sock *nlk = data; |
3133 | struct netlink_compare_arg arg; | 3133 | struct netlink_compare_arg arg; |