]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
svcrpc: introduce init_svc_cred
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 14 May 2013 20:53:40 +0000 (16:53 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 1 Jul 2013 21:23:06 +0000 (17:23 -0400)
Common helper to zero out fields of the svc_cred.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/linux/sunrpc/svcauth.h
net/sunrpc/auth_gss/svcauth_gss.c

index ff374ab3083902a7052a07b2ca8bb40cf3136338..95c956613a9cb3e3576ace56294258b27c3e0f94 100644 (file)
@@ -25,6 +25,13 @@ struct svc_cred {
        char                    *cr_principal; /* for gss */
 };
 
+static inline void init_svc_cred(struct svc_cred *cred)
+{
+       cred->cr_group_info = NULL;
+       cred->cr_principal = NULL;
+       cred->cr_gss_mech = NULL;
+}
+
 static inline void free_svc_cred(struct svc_cred *cred)
 {
        if (cred->cr_group_info)
index 29b4ba93ab3cb795fb8dd307f6e248bfcc3a1495..8d7860ee23980e6e467392a340bacc60594b1702 100644 (file)
@@ -377,8 +377,7 @@ rsc_init(struct cache_head *cnew, struct cache_head *ctmp)
        new->handle.data = tmp->handle.data;
        tmp->handle.data = NULL;
        new->mechctx = NULL;
-       new->cred.cr_group_info = NULL;
-       new->cred.cr_principal = NULL;
+       init_svc_cred(&new->cred);
 }
 
 static void
@@ -392,9 +391,8 @@ update_rsc(struct cache_head *cnew, struct cache_head *ctmp)
        memset(&new->seqdata, 0, sizeof(new->seqdata));
        spin_lock_init(&new->seqdata.sd_lock);
        new->cred = tmp->cred;
-       tmp->cred.cr_group_info = NULL;
        new->cred.cr_principal = tmp->cred.cr_principal;
-       tmp->cred.cr_principal = NULL;
+       init_svc_cred(&tmp->cred);
 }
 
 static struct cache_head *