]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sunrpc: add rpc_lookup_generic_cred
authorWeston Andros Adamson <dros@primarydata.com>
Fri, 22 Apr 2016 00:51:55 +0000 (20:51 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 9 May 2016 13:05:40 +0000 (09:05 -0400)
Add function rpc_lookup_generic_cred, which allows lookups of a generic
credential that's not current_cred().

[jlayton: add gfp_t parm]

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
include/linux/sunrpc/auth.h
net/sunrpc/auth_generic.c

index 3b616aa7e4d2c93d60e406c1dad84c022486c942..16bd8f8fef8c4d829ca7ac46b14a5e00e448e3e1 100644 (file)
@@ -167,6 +167,7 @@ void                        rpc_destroy_authunix(void);
 
 struct rpc_cred *      rpc_lookup_cred(void);
 struct rpc_cred *      rpc_lookup_cred_nonblock(void);
+struct rpc_cred *      rpc_lookup_generic_cred(struct auth_cred *, int, gfp_t);
 struct rpc_cred *      rpc_lookup_machine_cred(const char *service_name);
 int                    rpcauth_register(const struct rpc_authops *);
 int                    rpcauth_unregister(const struct rpc_authops *);
index 6ed3e3df43e9834cf02b9ccae2e89580bd697dab..54dd3fdead54b8813bb6cbdf769f96a11d8f49ea 100644 (file)
@@ -38,6 +38,13 @@ struct rpc_cred *rpc_lookup_cred(void)
 }
 EXPORT_SYMBOL_GPL(rpc_lookup_cred);
 
+struct rpc_cred *
+rpc_lookup_generic_cred(struct auth_cred *acred, int flags, gfp_t gfp)
+{
+       return rpcauth_lookup_credcache(&generic_auth, acred, flags, gfp);
+}
+EXPORT_SYMBOL_GPL(rpc_lookup_generic_cred);
+
 struct rpc_cred *rpc_lookup_cred_nonblock(void)
 {
        return rpcauth_lookupcred(&generic_auth, RPCAUTH_LOOKUP_RCU);