summaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-20 21:57:00 +1100
committerDavid S. Miller <davem@davemloft.net>2015-03-20 16:16:24 -0400
commit02fd97c3d4a8a14e222b0021c366db7041d28743 (patch)
tree5bce8d1e7f57aefa89073934042d2907408fd403 /net/netlink
parent488fb86ee91d3b1182c2e30a9f9b45da14eda46f (diff)
downloadlinux-02fd97c3d4a8a14e222b0021c366db7041d28743.tar.bz2
rhashtable: Allow hash/comparison functions to be inlined
This patch deals with the complaint that we make indirect function calls on the fast paths unnecessarily in rhashtable. We resolve it by moving the fast paths into inline functions that take struct rhashtable_param (which obviously must be the same set of parameters supplied to rhashtable_init) as an argument. The only remaining indirect call is to obj_hashfn (or key_hashfn it obj_hashfn is unset) on the rehash as well as the insert-during- rehash slow path. This patch also extends the support of vairable-length keys to include those where the key is fixed but scattered in the object. For example, in netlink we want to key off the namespace and the portid but they're not next to each other. This patch does this by directly using the object hash function as the indicator of whether the key is accessible or not. It also adds a new function obj_cmpfn to compare a key against an object. This means that the caller no longer needs to supply explicit compare functions. All this is done in a backwards compatible manner so no existing users are affected until they convert to the new interface. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
0 files changed, 0 insertions, 0 deletions