rpc: Make function tables const

No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2021-07-09 10:56:13 -04:00
parent 58b1a126b9
commit 20d728b559
15 changed files with 24 additions and 24 deletions

View File

@ -189,7 +189,7 @@ typedef struct __auth {
struct opaque_auth ah_cred;
struct opaque_auth ah_verf;
union des_block ah_key;
struct auth_ops {
const struct auth_ops {
void (*ah_nextverf) (struct __auth *);
/* nextverf & serialize */
int (*ah_marshal) (struct __auth *, uint32_t, XDR *,

View File

@ -70,7 +70,7 @@ static bool_t authnone_validate (AUTH *, uint32_t, struct opaque_auth *,
static bool_t authnone_refresh (AUTH *, void *);
static void authnone_destroy (AUTH *);
static struct auth_ops authnone_ops = {
static const struct auth_ops authnone_ops = {
.ah_nextverf = authnone_verf,
.ah_marshal = authnone_marshal,
.ah_validate = authnone_validate,

View File

@ -76,7 +76,7 @@ static bool_t authunix_refresh (AUTH *, void *);
static void authunix_destroy (AUTH *);
static void marshal_new_auth (AUTH *);
static struct auth_ops authunix_ops = {
static const struct auth_ops authunix_ops = {
.ah_nextverf = authunix_nextverf,
.ah_marshal = authunix_marshal,
.ah_validate = authunix_validate,

View File

@ -132,7 +132,7 @@ typedef struct __rpc_client {
#ifdef _KERNEL
volatile u_int cl_refs; /* reference count */
AUTH *cl_auth; /* authenticator */
struct clnt_ops {
const struct clnt_ops {
/* call remote procedure */
enum clnt_stat (*cl_call)(struct __rpc_client *,
struct rpc_callextra *, rpcproc_t,

View File

@ -101,7 +101,7 @@ static bool_t clnt_bck_control(CLIENT *, u_int, void *);
static void clnt_bck_close(CLIENT *);
static void clnt_bck_destroy(CLIENT *);
static struct clnt_ops clnt_bck_ops = {
static const struct clnt_ops clnt_bck_ops = {
.cl_abort = clnt_bck_abort,
.cl_geterr = clnt_bck_geterr,
.cl_freeres = clnt_bck_freeres,

View File

@ -84,7 +84,7 @@ static void clnt_dg_close(CLIENT *);
static void clnt_dg_destroy(CLIENT *);
static int clnt_dg_soupcall(struct socket *so, void *arg, int waitflag);
static struct clnt_ops clnt_dg_ops = {
static const struct clnt_ops clnt_dg_ops = {
.cl_call = clnt_dg_call,
.cl_abort = clnt_dg_abort,
.cl_geterr = clnt_dg_geterr,

View File

@ -59,7 +59,7 @@ static bool_t clnt_reconnect_control(CLIENT *, u_int, void *);
static void clnt_reconnect_close(CLIENT *);
static void clnt_reconnect_destroy(CLIENT *);
static struct clnt_ops clnt_reconnect_ops = {
static const struct clnt_ops clnt_reconnect_ops = {
.cl_call = clnt_reconnect_call,
.cl_abort = clnt_reconnect_abort,
.cl_geterr = clnt_reconnect_geterr,

View File

@ -104,7 +104,7 @@ static bool_t time_not_ok(struct timeval *);
static int clnt_vc_soupcall(struct socket *so, void *arg, int waitflag);
static void clnt_vc_dotlsupcall(void *data);
static struct clnt_ops clnt_vc_ops = {
static const struct clnt_ops clnt_vc_ops = {
.cl_call = clnt_vc_call,
.cl_abort = clnt_vc_abort,
.cl_geterr = clnt_vc_geterr,

View File

@ -97,7 +97,7 @@ static bool_t rpc_gss_validate(AUTH *, uint32_t, struct opaque_auth *,
static void rpc_gss_destroy(AUTH *);
static void rpc_gss_destroy_context(AUTH *, bool_t);
static struct auth_ops rpc_gss_ops = {
static const struct auth_ops rpc_gss_ops = {
.ah_nextverf = rpc_gss_nextverf,
.ah_marshal = rpc_gss_marshal,
.ah_validate = rpc_gss_validate,

View File

@ -90,10 +90,10 @@ static void svc_rpc_gss_release(SVCAUTH *);
static enum auth_stat svc_rpc_gss(struct svc_req *, struct rpc_msg *);
static int rpc_gss_svc_getcred(struct svc_req *, struct ucred **, int *);
static struct svc_auth_ops svc_auth_gss_ops = {
svc_rpc_gss_wrap,
svc_rpc_gss_unwrap,
svc_rpc_gss_release,
static const struct svc_auth_ops svc_auth_gss_ops = {
.svc_ah_wrap = svc_rpc_gss_wrap,
.svc_ah_unwrap = svc_rpc_gss_unwrap,
.svc_ah_release = svc_rpc_gss_release,
};
struct sx svc_rpc_gss_lock;

View File

@ -70,7 +70,7 @@ static bool_t authtls_validate (AUTH *, uint32_t, struct opaque_auth *,
static bool_t authtls_refresh (AUTH *, void *);
static void authtls_destroy (AUTH *);
static struct auth_ops authtls_ops = {
static const struct auth_ops authtls_ops = {
.ah_nextverf = authtls_verf,
.ah_marshal = authtls_marshal,
.ah_validate = authtls_validate,

View File

@ -212,7 +212,7 @@ typedef struct __rpc_svcxprt {
* Interface to server-side authentication flavors.
*/
typedef struct __rpc_svcauth {
struct svc_auth_ops {
const struct svc_auth_ops {
#ifdef _KERNEL
int (*svc_ah_wrap)(struct __rpc_svcauth *, struct mbuf **);
int (*svc_ah_unwrap)(struct __rpc_svcauth *, struct mbuf **);

View File

@ -60,7 +60,7 @@ static enum auth_stat (*_svcauth_rpcsec_gss)(struct svc_req *,
static int (*_svcauth_rpcsec_gss_getcred)(struct svc_req *,
struct ucred **, int *);
static struct svc_auth_ops svc_auth_null_ops;
static const struct svc_auth_ops svc_auth_null_ops;
/*
* The call rpc message, msg has been obtained from the wire. The msg contains
@ -145,10 +145,10 @@ svcauth_null_release(SVCAUTH *auth)
}
static struct svc_auth_ops svc_auth_null_ops = {
svcauth_null_wrap,
svcauth_null_unwrap,
svcauth_null_release,
static const struct svc_auth_ops svc_auth_null_ops = {
.svc_ah_wrap = svcauth_null_wrap,
.svc_ah_unwrap = svcauth_null_unwrap,
.svc_ah_release = svcauth_null_release,
};
/*ARGSUSED*/

View File

@ -73,7 +73,7 @@ static void svc_dg_destroy(SVCXPRT *);
static bool_t svc_dg_control(SVCXPRT *, const u_int, void *);
static int svc_dg_soupcall(struct socket *so, void *arg, int waitflag);
static struct xp_ops svc_dg_ops = {
static const struct xp_ops svc_dg_ops = {
.xp_recv = svc_dg_recv,
.xp_stat = svc_dg_stat,
.xp_reply = svc_dg_reply,

View File

@ -105,7 +105,7 @@ static int svc_vc_accept(struct socket *head, struct socket **sop);
static int svc_vc_soupcall(struct socket *so, void *arg, int waitflag);
static int svc_vc_rendezvous_soupcall(struct socket *, void *, int);
static struct xp_ops svc_vc_rendezvous_ops = {
static const struct xp_ops svc_vc_rendezvous_ops = {
.xp_recv = svc_vc_rendezvous_recv,
.xp_stat = svc_vc_rendezvous_stat,
.xp_reply = (bool_t (*)(SVCXPRT *, struct rpc_msg *,
@ -114,7 +114,7 @@ static struct xp_ops svc_vc_rendezvous_ops = {
.xp_control = svc_vc_rendezvous_control
};
static struct xp_ops svc_vc_ops = {
static const struct xp_ops svc_vc_ops = {
.xp_recv = svc_vc_recv,
.xp_stat = svc_vc_stat,
.xp_ack = svc_vc_ack,
@ -123,7 +123,7 @@ static struct xp_ops svc_vc_ops = {
.xp_control = svc_vc_control
};
static struct xp_ops svc_vc_backchannel_ops = {
static const struct xp_ops svc_vc_backchannel_ops = {
.xp_recv = svc_vc_backchannel_recv,
.xp_stat = svc_vc_backchannel_stat,
.xp_reply = svc_vc_backchannel_reply,