summaryrefslogtreecommitdiffstats
path: root/net/netlink/af_netlink.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-20 11:57:00 +0100
committerDavid S. Miller <davem@davemloft.net>2015-03-20 21:16:24 +0100
commit02fd97c3d4a8a14e222b0021c366db7041d28743 (patch)
tree5bce8d1e7f57aefa89073934042d2907408fd403 /net/netlink/af_netlink.c
parentrhashtable: Make rhashtable_init params argument const (diff)
downloadlinux-02fd97c3d4a8a14e222b0021c366db7041d28743.tar.xz
linux-02fd97c3d4a8a14e222b0021c366db7041d28743.zip
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/af_netlink.c')
0 files changed, 0 insertions, 0 deletions