Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a17c2153 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

SUNRPC: Move the bound cred to struct rpc_rqst



This will allow us to save the original generic cred in rpc_message, so
that if we migrate from one server to another, we can generate a new bound
cred without having to punt back to the NFS layer.

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 8572b8e2
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ nfs_xdr_removeargs(struct rpc_rqst *req, __be32 *p, const struct nfs_removeargs
static int
nfs_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
{
	struct rpc_auth	*auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
	struct rpc_auth	*auth = req->rq_cred->cr_auth;
	unsigned int replen;
	u32 offset = (u32)args->offset;
	u32 count = args->count;
@@ -393,8 +393,7 @@ nfs_xdr_symlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs_symlinkargs *arg
static int
nfs_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs_readdirargs *args)
{
	struct rpc_task	*task = req->rq_task;
	struct rpc_auth	*auth = task->tk_msg.rpc_cred->cr_auth;
	struct rpc_auth	*auth = req->rq_cred->cr_auth;
	unsigned int replen;
	u32 count = args->count;

@@ -575,7 +574,7 @@ nfs_xdr_diropres(struct rpc_rqst *req, __be32 *p, struct nfs_diropok *res)
static int
nfs_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs_readlinkargs *args)
{
	struct rpc_auth	*auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
	struct rpc_auth	*auth = req->rq_cred->cr_auth;
	unsigned int replen;

	p = xdr_encode_fhandle(p, args->fh);
+4 −4
Original line number Diff line number Diff line
@@ -330,7 +330,7 @@ nfs3_xdr_accessargs(struct rpc_rqst *req, __be32 *p, struct nfs3_accessargs *arg
static int
nfs3_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
{
	struct rpc_auth	*auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
	struct rpc_auth	*auth = req->rq_cred->cr_auth;
	unsigned int replen;
	u32 count = args->count;

@@ -471,7 +471,7 @@ nfs3_xdr_linkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_linkargs *args)
static int
nfs3_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirargs *args)
{
	struct rpc_auth	*auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
	struct rpc_auth	*auth = req->rq_cred->cr_auth;
	unsigned int replen;
	u32 count = args->count;

@@ -675,7 +675,7 @@ static int
nfs3_xdr_getaclargs(struct rpc_rqst *req, __be32 *p,
		    struct nfs3_getaclargs *args)
{
	struct rpc_auth	*auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
	struct rpc_auth	*auth = req->rq_cred->cr_auth;
	unsigned int replen;

	p = xdr_encode_fhandle(p, args->fh);
@@ -802,7 +802,7 @@ nfs3_xdr_accessres(struct rpc_rqst *req, __be32 *p, struct nfs3_accessres *res)
static int
nfs3_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readlinkargs *args)
{
	struct rpc_auth	*auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
	struct rpc_auth	*auth = req->rq_cred->cr_auth;
	unsigned int replen;

	p = xdr_encode_fhandle(p, args->fh);
+1 −1
Original line number Diff line number Diff line
@@ -758,7 +758,7 @@ static void encode_compound_hdr(struct xdr_stream *xdr,
				struct compound_hdr *hdr)
{
	__be32 *p;
	struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
	struct rpc_auth *auth = req->rq_cred->cr_auth;

	/* initialize running count of expected bytes in reply.
	 * NOTE: the replied tag SHOULD be the same is the one sent,
+0 −2
Original line number Diff line number Diff line
@@ -135,10 +135,8 @@ void rpcauth_release(struct rpc_auth *);
struct rpc_cred *	rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
void			rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
struct rpc_cred *	rpcauth_lookupcred(struct rpc_auth *, int);
int			rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int);
struct rpc_cred *	rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int);
void			put_rpccred(struct rpc_cred *);
void			rpcauth_unbindcred(struct rpc_task *);
__be32 *		rpcauth_marshcred(struct rpc_task *, __be32 *);
__be32 *		rpcauth_checkverf(struct rpc_task *, __be32 *);
int			rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj);
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ struct rpc_rqst {
	 * This is the private part
	 */
	struct rpc_task *	rq_task;	/* RPC task data */
	struct rpc_cred *	rq_cred;	/* Bound cred */
	__be32			rq_xid;		/* request XID */
	int			rq_cong;	/* has incremented xprt->cong */
	u32			rq_seqno;	/* gss seq no. used on req. */
Loading