]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
SUNRPC: Mark auth and cred operation tables as constant.
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 24 Jun 2007 00:17:58 +0000 (20:17 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 11 Jul 2007 03:40:34 +0000 (23:40 -0400)
Also do the same for gss_api operation tables.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
include/linux/sunrpc/auth.h
include/linux/sunrpc/gss_api.h
net/sunrpc/auth.c
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_gss/gss_krb5_mech.c
net/sunrpc/auth_gss/gss_spkm3_mech.c
net/sunrpc/auth_null.c
net/sunrpc/auth_unix.c

index bc77c730325ce7507fe836f4d30390c3fa615b5c..e606c28046857500e6d838225b31e415e3d575d8 100644 (file)
@@ -35,7 +35,7 @@ struct rpc_credops;
 struct rpc_cred {
        struct hlist_node       cr_hash;        /* hash chain */
        struct rpc_auth *       cr_auth;
-       struct rpc_credops *    cr_ops;
+       const struct rpc_credops *cr_ops;
        unsigned long           cr_expire;      /* when to gc */
        atomic_t                cr_count;       /* ref count */
        unsigned short          cr_flags;       /* various flags */
@@ -73,7 +73,7 @@ struct rpc_auth {
        unsigned int            au_verfsize;
 
        unsigned int            au_flags;       /* various flags */
-       struct rpc_authops *    au_ops;         /* operations */
+       const struct rpc_authops *au_ops;               /* operations */
        rpc_authflavor_t        au_flavor;      /* pseudoflavor (note may
                                                 * differ from the flavor in
                                                 * au_ops->au_flavor in gss
@@ -119,14 +119,11 @@ struct rpc_credops {
                                                void *, __be32 *, void *);
 };
 
-extern struct rpc_authops      authunix_ops;
-extern struct rpc_authops      authnull_ops;
-#ifdef CONFIG_SUNRPC_SECURE
-extern struct rpc_authops      authdes_ops;
-#endif
+extern const struct rpc_authops        authunix_ops;
+extern const struct rpc_authops        authnull_ops;
 
-int                    rpcauth_register(struct rpc_authops *);
-int                    rpcauth_unregister(struct rpc_authops *);
+int                    rpcauth_register(const struct rpc_authops *);
+int                    rpcauth_unregister(const struct rpc_authops *);
 struct rpc_auth *      rpcauth_create(rpc_authflavor_t, struct rpc_clnt *);
 void                   rpcauth_release(struct rpc_auth *);
 struct rpc_cred *      rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
index 5eca9e442051310525162222c9891776be778d9d..bbac101ac37278a518011a3962cb41a89222bdd3 100644 (file)
@@ -77,7 +77,7 @@ struct gss_api_mech {
        struct module           *gm_owner;
        struct xdr_netobj       gm_oid;
        char                    *gm_name;
-       struct gss_api_ops      *gm_ops;
+       const struct gss_api_ops *gm_ops;
        /* pseudoflavors supported by this mechanism: */
        int                     gm_pf_num;
        struct pf_desc *        gm_pfs;
index 1686dc74c6a9d2b0a4831f5eb430bb728d6fcff9..d3f0f944c0b5fbb4e1f6a368c73ab8b8d28bc3a1 100644 (file)
@@ -19,7 +19,7 @@
 #endif
 
 static DEFINE_SPINLOCK(rpc_authflavor_lock);
-static struct rpc_authops *    auth_flavors[RPC_AUTH_MAXFLAVOR] = {
+static const struct rpc_authops *auth_flavors[RPC_AUTH_MAXFLAVOR] = {
        &authnull_ops,          /* AUTH_NULL */
        &authunix_ops,          /* AUTH_UNIX */
        NULL,                   /* others can be loadable modules */
@@ -33,7 +33,7 @@ pseudoflavor_to_flavor(u32 flavor) {
 }
 
 int
-rpcauth_register(struct rpc_authops *ops)
+rpcauth_register(const struct rpc_authops *ops)
 {
        rpc_authflavor_t flavor;
        int ret = -EPERM;
@@ -50,7 +50,7 @@ rpcauth_register(struct rpc_authops *ops)
 }
 
 int
-rpcauth_unregister(struct rpc_authops *ops)
+rpcauth_unregister(const struct rpc_authops *ops)
 {
        rpc_authflavor_t flavor;
        int ret = -EPERM;
@@ -70,7 +70,7 @@ struct rpc_auth *
 rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt)
 {
        struct rpc_auth         *auth;
-       struct rpc_authops      *ops;
+       const struct rpc_authops *ops;
        u32                     flavor = pseudoflavor_to_flavor(pseudoflavor);
 
        auth = ERR_PTR(-EINVAL);
index 459dc9b1d1ad855b80591d7e298bc1f7d42b9afe..177a9e413c0a06a750b7327fc44fb9e9aab4fd02 100644 (file)
@@ -54,9 +54,9 @@
 #include <linux/sunrpc/gss_api.h>
 #include <asm/uaccess.h>
 
-static struct rpc_authops authgss_ops;
+static const struct rpc_authops authgss_ops;
 
-static struct rpc_credops gss_credops;
+static const struct rpc_credops gss_credops;
 
 #ifdef RPC_DEBUG
 # define RPCDBG_FACILITY       RPCDBG_AUTH
@@ -1193,7 +1193,7 @@ out:
        return status;
 }
 
-static struct rpc_authops authgss_ops = {
+static const struct rpc_authops authgss_ops = {
        .owner          = THIS_MODULE,
        .au_flavor      = RPC_AUTH_GSS,
 #ifdef RPC_DEBUG
@@ -1205,7 +1205,7 @@ static struct rpc_authops authgss_ops = {
        .crcreate       = gss_create_cred
 };
 
-static struct rpc_credops gss_credops = {
+static const struct rpc_credops gss_credops = {
        .cr_name        = "AUTH_GSS",
        .crdestroy      = gss_destroy_cred,
        .cr_init        = gss_cred_init,
index 7b194321705323441b28cb413632bcae23a3bc21..71b9daefdff3d046d9fcbd486af3eba60dc88e12 100644 (file)
@@ -201,7 +201,7 @@ gss_delete_sec_context_kerberos(void *internal_ctx) {
        kfree(kctx);
 }
 
-static struct gss_api_ops gss_kerberos_ops = {
+static const struct gss_api_ops gss_kerberos_ops = {
        .gss_import_sec_context = gss_import_sec_context_kerberos,
        .gss_get_mic            = gss_get_mic_kerberos,
        .gss_verify_mic         = gss_verify_mic_kerberos,
index 7e15aa68ae64c57800d4fef33f20bc1a9a80b33a..577d590e755f0cd292b73a971419bec77ecd2939 100644 (file)
@@ -202,7 +202,7 @@ gss_get_mic_spkm3(struct gss_ctx    *ctx,
        return err;
 }
 
-static struct gss_api_ops gss_spkm3_ops = {
+static const struct gss_api_ops gss_spkm3_ops = {
        .gss_import_sec_context = gss_import_sec_context_spkm3,
        .gss_get_mic            = gss_get_mic_spkm3,
        .gss_verify_mic         = gss_verify_mic_spkm3,
index 890bd9b3794bfedf47cd779f58dc197439762a0b..fe9b6aaf91ebfe345ee1db0e333a4cad87c8e1cb 100644 (file)
@@ -101,7 +101,7 @@ nul_validate(struct rpc_task *task, __be32 *p)
        return p;
 }
 
-struct rpc_authops authnull_ops = {
+const struct rpc_authops authnull_ops = {
        .owner          = THIS_MODULE,
        .au_flavor      = RPC_AUTH_NULL,
 #ifdef RPC_DEBUG
@@ -122,7 +122,7 @@ struct rpc_auth null_auth = {
 };
 
 static
-struct rpc_credops     null_credops = {
+const struct rpc_credops null_credops = {
        .cr_name        = "AUTH_NULL",
        .crdestroy      = nul_destroy_cred,
        .crmatch        = nul_match,
index e54782e75d59d8f09d50edaf0b899b69191b628d..6600c7ad72a98190c783e8d81c812b67c017489d 100644 (file)
@@ -34,7 +34,7 @@ struct unx_cred {
 
 static struct rpc_auth         unix_auth;
 static struct rpc_cred_cache   unix_cred_cache;
-static struct rpc_credops      unix_credops;
+static const struct rpc_credops        unix_credops;
 
 static struct rpc_auth *
 unx_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
@@ -205,7 +205,7 @@ unx_validate(struct rpc_task *task, __be32 *p)
        return p;
 }
 
-struct rpc_authops     authunix_ops = {
+const struct rpc_authops authunix_ops = {
        .owner          = THIS_MODULE,
        .au_flavor      = RPC_AUTH_UNIX,
 #ifdef RPC_DEBUG
@@ -233,7 +233,7 @@ struct rpc_auth             unix_auth = {
 };
 
 static
-struct rpc_credops     unix_credops = {
+const struct rpc_credops unix_credops = {
        .cr_name        = "AUTH_UNIX",
        .crdestroy      = unx_destroy_cred,
        .crmatch        = unx_match,