소스 검색

nfsd: allow mach_creds_match to be used more broadly

Rename mach_creds_match() to nfsd4_mach_creds_match() and un-staticify

Signed-off-by: Andrew Elble <aweits@rit.edu>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Andrew Elble 9 년 전
부모
커밋
dedeb13f9e
2개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. 7 7
      fs/nfsd/nfs4state.c
  2. 2 0
      fs/nfsd/xdr4.h

+ 7 - 7
fs/nfsd/nfs4state.c

@@ -1972,7 +1972,7 @@ static bool svc_rqst_integrity_protected(struct svc_rqst *rqstp)
 	       service == RPC_GSS_SVC_PRIVACY;
 	       service == RPC_GSS_SVC_PRIVACY;
 }
 }
 
 
-static bool mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp)
+bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp)
 {
 {
 	struct svc_cred *cr = &rqstp->rq_cred;
 	struct svc_cred *cr = &rqstp->rq_cred;
 
 
@@ -2424,7 +2424,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
 				status = nfserr_inval;
 				status = nfserr_inval;
 				goto out;
 				goto out;
 			}
 			}
-			if (!mach_creds_match(conf, rqstp)) {
+			if (!nfsd4_mach_creds_match(conf, rqstp)) {
 				status = nfserr_wrong_cred;
 				status = nfserr_wrong_cred;
 				goto out;
 				goto out;
 			}
 			}
@@ -2676,7 +2676,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
 
 
 	if (conf) {
 	if (conf) {
 		status = nfserr_wrong_cred;
 		status = nfserr_wrong_cred;
-		if (!mach_creds_match(conf, rqstp))
+		if (!nfsd4_mach_creds_match(conf, rqstp))
 			goto out_free_conn;
 			goto out_free_conn;
 		cs_slot = &conf->cl_cs_slot;
 		cs_slot = &conf->cl_cs_slot;
 		status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0);
 		status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0);
@@ -2692,7 +2692,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
 			goto out_free_conn;
 			goto out_free_conn;
 		}
 		}
 		status = nfserr_wrong_cred;
 		status = nfserr_wrong_cred;
-		if (!mach_creds_match(unconf, rqstp))
+		if (!nfsd4_mach_creds_match(unconf, rqstp))
 			goto out_free_conn;
 			goto out_free_conn;
 		cs_slot = &unconf->cl_cs_slot;
 		cs_slot = &unconf->cl_cs_slot;
 		status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0);
 		status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0);
@@ -2801,7 +2801,7 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
 	if (!session)
 	if (!session)
 		goto out_no_session;
 		goto out_no_session;
 	status = nfserr_wrong_cred;
 	status = nfserr_wrong_cred;
-	if (!mach_creds_match(session->se_client, rqstp))
+	if (!nfsd4_mach_creds_match(session->se_client, rqstp))
 		goto out;
 		goto out;
 	status = nfsd4_map_bcts_dir(&bcts->dir);
 	status = nfsd4_map_bcts_dir(&bcts->dir);
 	if (status)
 	if (status)
@@ -2848,7 +2848,7 @@ nfsd4_destroy_session(struct svc_rqst *r,
 	if (!ses)
 	if (!ses)
 		goto out_client_lock;
 		goto out_client_lock;
 	status = nfserr_wrong_cred;
 	status = nfserr_wrong_cred;
-	if (!mach_creds_match(ses->se_client, r))
+	if (!nfsd4_mach_creds_match(ses->se_client, r))
 		goto out_put_session;
 		goto out_put_session;
 	status = mark_session_dead_locked(ses, 1 + ref_held_by_me);
 	status = mark_session_dead_locked(ses, 1 + ref_held_by_me);
 	if (status)
 	if (status)
@@ -3087,7 +3087,7 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta
 		status = nfserr_stale_clientid;
 		status = nfserr_stale_clientid;
 		goto out;
 		goto out;
 	}
 	}
-	if (!mach_creds_match(clp, rqstp)) {
+	if (!nfsd4_mach_creds_match(clp, rqstp)) {
 		clp = NULL;
 		clp = NULL;
 		status = nfserr_wrong_cred;
 		status = nfserr_wrong_cred;
 		goto out;
 		goto out;

+ 2 - 0
fs/nfsd/xdr4.h

@@ -654,6 +654,8 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
 
 
 }
 }
 
 
+
+bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp);
 int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
 int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
 int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
 int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
 		struct nfsd4_compoundargs *);
 		struct nfsd4_compoundargs *);