From: Jeff Layton <jlayton@poochiereds.net>
To: trond.myklebust@primarydata.com
Cc: Anna Schumaker <Anna.Schumaker@netapp.com>, linux-nfs@vger.kernel.org
Subject: [PATCH v2 2/7] sunrpc: add rpc_lookup_generic_cred
Date: Thu, 21 Apr 2016 20:51:55 -0400 [thread overview]
Message-ID: <1461286320-24601-3-git-send-email-jeff.layton@primarydata.com> (raw)
In-Reply-To: <1461286320-24601-1-git-send-email-jeff.layton@primarydata.com>
From: Weston Andros Adamson <dros@primarydata.com>
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>
---
include/linux/sunrpc/auth.h | 1 +
net/sunrpc/auth_generic.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 3b616aa7e4d2..16bd8f8fef8c 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -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 *);
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c
index 6ed3e3df43e9..54dd3fdead54 100644
--- a/net/sunrpc/auth_generic.c
+++ b/net/sunrpc/auth_generic.c
@@ -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);
--
2.5.5
next prev parent reply other threads:[~2016-04-22 0:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 0:51 [PATCH v2 0/7] nfs/sunrpc: fix flexfiles credential handling Jeff Layton
2016-04-22 0:51 ` [PATCH v2 1/7] sunrpc: plumb gfp_t parm into crcreate operation Jeff Layton
2016-04-27 18:00 ` Anna Schumaker
2016-04-27 18:36 ` Jeff Layton
2016-04-22 0:51 ` Jeff Layton [this message]
2016-04-22 0:51 ` [PATCH v2 3/7] sunrpc: add a get_rpccred_rcu inline Jeff Layton
2016-04-22 0:51 ` [PATCH v2 4/7] nfs: don't call nfs4_ff_layout_prepare_ds from ff_layout_get_ds_cred Jeff Layton
2016-04-22 0:51 ` [PATCH v2 5/7] nfs: have ff_layout_get_ds_cred take a reference to the cred Jeff Layton
2016-04-22 0:51 ` [PATCH v2 6/7] nfs: get a reference to the credential in ff_layout_alloc_lseg Jeff Layton
2016-04-28 20:37 ` Anna Schumaker
2016-04-29 10:49 ` Jeff Layton
2016-04-29 12:58 ` Anna Schumaker
2016-04-22 0:52 ` [PATCH v2 7/7] nfs: have flexfiles mirror keep creds for both ro and rw layouts Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461286320-24601-3-git-send-email-jeff.layton@primarydata.com \
--to=jlayton@poochiereds.net \
--cc=Anna.Schumaker@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).