]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sunrpc/auth: allow lockless (rcu) lookup of credential cache.
authorNeilBrown <neilb@suse.de>
Mon, 14 Jul 2014 01:28:20 +0000 (11:28 +1000)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 3 Aug 2014 21:14:12 +0000 (17:14 -0400)
commitbd95608053b7f7813351b0defc0e3e7ef8cf2803
treefde08b1ecc2c4aedd30a68244ca502ce5f81f0fe
parentd51ac1a8e9b86b2d17d349bb256869cab6522787
sunrpc/auth: allow lockless (rcu) lookup of credential cache.

The new flag RPCAUTH_LOOKUP_RCU to credential lookup avoids locking,
does not take a reference on the returned credential, and returns
-ECHILD if a simple lookup was not possible.

The returned value can only be used within an rcu_read_lock protected
region.

The main user of this is the new rpc_lookup_cred_nonblock() which
returns a pointer to the current credential which is only rcu-safe (no
ref-count held), and might return -ECHILD if allocation was required.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
include/linux/sunrpc/auth.h
net/sunrpc/auth.c
net/sunrpc/auth_generic.c
net/sunrpc/auth_null.c