History

SUNRPC: Use struct xdr_stream when constructing RPC Call header

Modernize and harden the code path that constructs each RPC Call message.

Chuck Lever committed 7 years ago

Commit e8680a21 parent fe9a2708 files · +266 −181Browse files

Showing the changes to include/linux (2 of 8 files). Show all

Unified · Split

2 files
  1. include/linux/sunrpc/auth.h +10 −5
  2. include/linux/sunrpc/xdr.h +6 −0
include/linux/sunrpc/auth.h+10−5
@@ -131,11 +131,12 @@ struct rpc_credops { · 130 unmodified lines
131131 void (*crdestroy)(struct rpc_cred *);
132132
133133 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int);
134− __be32 * (*crmarshal)(struct rpc_task *, __be32 *);
134+ int (*crmarshal)(struct rpc_task *task,
135+ struct xdr_stream *xdr);
135136 int (*crrefresh)(struct rpc_task *);
136137 __be32 * (*crvalidate)(struct rpc_task *, __be32 *);
137− int (*crwrap_req)(struct rpc_task *, kxdreproc_t,
138− void *, __be32 *, void *);
138+ int (*crwrap_req)(struct rpc_task *task,
139+ struct xdr_stream *xdr);
139140 int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t,
140141 void *, __be32 *, void *);
141142 int (*crkey_timeout)(struct rpc_cred *);
@@ -165,9 +166,13 @@ struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred * · 23 unmodified lines
165166 void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
166167 struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
167168 void put_rpccred(struct rpc_cred *);
168−__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *);
169+int rpcauth_marshcred(struct rpc_task *task,
170+ struct xdr_stream *xdr);
169171 __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *);
170−int rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp, __be32 *data, void *obj);
172+int rpcauth_wrap_req_encode(struct rpc_task *task,
173+ struct xdr_stream *xdr);
174+int rpcauth_wrap_req(struct rpc_task *task,
175+ struct xdr_stream *xdr);
171176 int rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp, __be32 *data, void *obj);
172177 bool rpcauth_xmit_need_reencode(struct rpc_task *task);
173178 int rpcauth_refreshcred(struct rpc_task *);
include/linux/sunrpc/xdr.h+6−0
@@ -87,6 +87,12 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 86 unmodified lines
8787 #define xdr_one cpu_to_be32(1)
8888 #define xdr_two cpu_to_be32(2)
8989
90+#define rpc_auth_null cpu_to_be32(RPC_AUTH_NULL)
91+#define rpc_auth_unix cpu_to_be32(RPC_AUTH_UNIX)
92+#define rpc_auth_gss cpu_to_be32(RPC_AUTH_GSS)
93+
94+#define rpc_call cpu_to_be32(RPC_CALL)
95+
9096 #define rpc_success cpu_to_be32(RPC_SUCCESS)
9197 #define rpc_prog_unavail cpu_to_be32(RPC_PROG_UNAVAIL)
9298 #define rpc_prog_mismatch cpu_to_be32(RPC_PROG_MISMATCH)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t