nfs4_vfsops.c (1705:7743062e0880) | nfs4_vfsops.c (1849:28aa19cf533d) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 2408 unchanged lines hidden (view full) --- 2417 */ 2418void 2419nfs4setclientid(mntinfo4_t *mi, cred_t *cr, bool_t recovery, nfs4_error_t *n4ep) 2420{ 2421 struct nfs4_server *np; 2422 struct servinfo4 *svp = mi->mi_curr_serv; 2423 nfs4_recov_state_t recov_state; 2424 int num_retries = 0; | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 2408 unchanged lines hidden (view full) --- 2417 */ 2418void 2419nfs4setclientid(mntinfo4_t *mi, cred_t *cr, bool_t recovery, nfs4_error_t *n4ep) 2420{ 2421 struct nfs4_server *np; 2422 struct servinfo4 *svp = mi->mi_curr_serv; 2423 nfs4_recov_state_t recov_state; 2424 int num_retries = 0; |
2425 bool_t retry = FALSE; | 2425 bool_t retry; |
2426 cred_t *lcr = NULL; 2427 int retry_inuse = 1; /* only retry once on NFS4ERR_CLID_INUSE */ 2428 time_t lease_time = 0; 2429 2430 recov_state.rs_flags = 0; 2431 recov_state.rs_num_retry_despite_err = 0; 2432 ASSERT(n4ep != NULL); 2433 2434recov_retry: | 2426 cred_t *lcr = NULL; 2427 int retry_inuse = 1; /* only retry once on NFS4ERR_CLID_INUSE */ 2428 time_t lease_time = 0; 2429 2430 recov_state.rs_flags = 0; 2431 recov_state.rs_num_retry_despite_err = 0; 2432 ASSERT(n4ep != NULL); 2433 2434recov_retry: |
2435 retry = FALSE; |
|
2435 nfs4_error_zinit(n4ep); 2436 if (!recovery) 2437 (void) nfs_rw_enter_sig(&mi->mi_recovlock, RW_READER, 0); 2438 2439 mutex_enter(&nfs4_server_lst_lock); 2440 np = servinfo4_to_nfs4_server(svp); /* This locks np if it is found */ 2441 mutex_exit(&nfs4_server_lst_lock); 2442 if (!np) { --- 148 unchanged lines hidden (view full) --- 2591 n4ep->error == ECONNRESET) 2592 num_retries = 0; 2593 } else if (retry_inuse && n4ep->error == 0 && 2594 n4ep->stat == NFS4ERR_CLID_INUSE) { 2595 retry = TRUE; 2596 num_retries = 0; 2597 } 2598 } else { | 2436 nfs4_error_zinit(n4ep); 2437 if (!recovery) 2438 (void) nfs_rw_enter_sig(&mi->mi_recovlock, RW_READER, 0); 2439 2440 mutex_enter(&nfs4_server_lst_lock); 2441 np = servinfo4_to_nfs4_server(svp); /* This locks np if it is found */ 2442 mutex_exit(&nfs4_server_lst_lock); 2443 if (!np) { --- 148 unchanged lines hidden (view full) --- 2592 n4ep->error == ECONNRESET) 2593 num_retries = 0; 2594 } else if (retry_inuse && n4ep->error == 0 && 2595 n4ep->stat == NFS4ERR_CLID_INUSE) { 2596 retry = TRUE; 2597 num_retries = 0; 2598 } 2599 } else { |
2599 /* Since everything succeeded give the list a reference count */ | 2600 /* 2601 * Since everything succeeded give the list a reference count if 2602 * it hasn't been given one by add_new_nfs4_server() or if this 2603 * is not a recovery situation in which case it is already on 2604 * the list. 2605 */ |
2600 mutex_enter(&np->s_lock); | 2606 mutex_enter(&np->s_lock); |
2601 np->s_refcnt++; | 2607 if ((np->s_flags & N4S_INSERTED) == 0) { 2608 np->s_refcnt++; 2609 np->s_flags |= N4S_INSERTED; 2610 } |
2602 mutex_exit(&np->s_lock); 2603 } 2604 2605 if (!recovery) 2606 nfs4_end_op(mi, NULL, NULL, &recov_state, recovery); 2607 2608 2609 if (retry && num_retries++ < nfs4_num_sclid_retries) { --- 572 unchanged lines hidden (view full) --- 3182{ 3183 nfs4_server_t *sp; 3184 3185 ASSERT(MUTEX_HELD(&nfs4_server_lst_lock)); 3186 sp = new_nfs4_server(svp, cr); 3187 mutex_enter(&sp->s_lock); 3188 insque(sp, &nfs4_server_lst); 3189 sp->s_refcnt++; /* list gets a reference */ | 2611 mutex_exit(&np->s_lock); 2612 } 2613 2614 if (!recovery) 2615 nfs4_end_op(mi, NULL, NULL, &recov_state, recovery); 2616 2617 2618 if (retry && num_retries++ < nfs4_num_sclid_retries) { --- 572 unchanged lines hidden (view full) --- 3191{ 3192 nfs4_server_t *sp; 3193 3194 ASSERT(MUTEX_HELD(&nfs4_server_lst_lock)); 3195 sp = new_nfs4_server(svp, cr); 3196 mutex_enter(&sp->s_lock); 3197 insque(sp, &nfs4_server_lst); 3198 sp->s_refcnt++; /* list gets a reference */ |
3199 sp->s_flags |= N4S_INSERTED; |
|
3190 sp->clientid = 0; 3191 return (sp); 3192} 3193 3194int nfs4_server_t_debug = 0; 3195 3196#ifdef lint 3197extern void --- 459 unchanged lines hidden --- | 3200 sp->clientid = 0; 3201 return (sp); 3202} 3203 3204int nfs4_server_t_debug = 0; 3205 3206#ifdef lint 3207extern void --- 459 unchanged lines hidden --- |