diff options
Diffstat (limited to 'include/linux/sunrpc/svcauth.h')
-rw-r--r-- | include/linux/sunrpc/svcauth.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index ff374ab30839..8d71d6577459 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <linux/sunrpc/msg_prot.h> | 15 | #include <linux/sunrpc/msg_prot.h> |
16 | #include <linux/sunrpc/cache.h> | 16 | #include <linux/sunrpc/cache.h> |
17 | #include <linux/sunrpc/gss_api.h> | ||
17 | #include <linux/hash.h> | 18 | #include <linux/hash.h> |
18 | #include <linux/cred.h> | 19 | #include <linux/cred.h> |
19 | 20 | ||
@@ -23,13 +24,23 @@ struct svc_cred { | |||
23 | struct group_info *cr_group_info; | 24 | struct group_info *cr_group_info; |
24 | u32 cr_flavor; /* pseudoflavor */ | 25 | u32 cr_flavor; /* pseudoflavor */ |
25 | char *cr_principal; /* for gss */ | 26 | char *cr_principal; /* for gss */ |
27 | struct gss_api_mech *cr_gss_mech; | ||
26 | }; | 28 | }; |
27 | 29 | ||
30 | static inline void init_svc_cred(struct svc_cred *cred) | ||
31 | { | ||
32 | cred->cr_group_info = NULL; | ||
33 | cred->cr_principal = NULL; | ||
34 | cred->cr_gss_mech = NULL; | ||
35 | } | ||
36 | |||
28 | static inline void free_svc_cred(struct svc_cred *cred) | 37 | static inline void free_svc_cred(struct svc_cred *cred) |
29 | { | 38 | { |
30 | if (cred->cr_group_info) | 39 | if (cred->cr_group_info) |
31 | put_group_info(cred->cr_group_info); | 40 | put_group_info(cred->cr_group_info); |
32 | kfree(cred->cr_principal); | 41 | kfree(cred->cr_principal); |
42 | gss_mech_put(cred->cr_gss_mech); | ||
43 | init_svc_cred(cred); | ||
33 | } | 44 | } |
34 | 45 | ||
35 | struct svc_rqst; /* forward decl */ | 46 | struct svc_rqst; /* forward decl */ |