SUNRPC: Mark auth and cred operation tables as constant.
[pandora-kernel.git] / include / linux / sunrpc / auth.h
index 534cdc7..e606c28 100644 (file)
@@ -30,9 +30,12 @@ struct auth_cred {
 /*
  * Client user credentials
  */
+struct rpc_auth;
+struct rpc_credops;
 struct rpc_cred {
        struct hlist_node       cr_hash;        /* hash chain */
-       struct rpc_credops *    cr_ops;
+       struct rpc_auth *       cr_auth;
+       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 */
@@ -60,6 +63,7 @@ struct rpc_cred_cache {
        unsigned long           expire;         /* cache expiry interval */
 };
 
+struct rpc_authops;
 struct rpc_auth {
        unsigned int            au_cslack;      /* call cred size estimate */
                                /* guess at number of u32's auth adds before
@@ -69,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
@@ -115,16 +119,13 @@ 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_destroy(struct rpc_auth *);
+void                   rpcauth_release(struct rpc_auth *);
 struct rpc_cred *      rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
 struct rpc_cred *      rpcauth_lookupcred(struct rpc_auth *, int);
 struct rpc_cred *      rpcauth_bindcred(struct rpc_task *);
@@ -139,7 +140,8 @@ int                 rpcauth_refreshcred(struct rpc_task *);
 void                   rpcauth_invalcred(struct rpc_task *);
 int                    rpcauth_uptodatecred(struct rpc_task *);
 int                    rpcauth_init_credcache(struct rpc_auth *, unsigned long);
-void                   rpcauth_free_credcache(struct rpc_auth *);
+void                   rpcauth_destroy_credcache(struct rpc_auth *);
+void                   rpcauth_clear_credcache(struct rpc_cred_cache *);
 
 static inline
 struct rpc_cred *      get_rpccred(struct rpc_cred *cred)