FreeBSD/sys/fs/nfsclient/nfs_clstate.c
/*
 * This function must be called after the process represented by "own" has
 * exited. Must be called with CLSTATE lock held.
 */
This function must be called after the process represented by "own" has
exited. Must be called with CLSTATE lock held.
This function must be called after the process represented by " own " has exited . Must be called with CLSTATE lock held .
static void
nfscl_cleanup_common(struct nfsclclient *clp, u_int8_t *own)
{
	struct nfsclowner *owp, *nowp;
	struct nfscllockowner *lp, *nlp;
	struct nfscldeleg *dp;
	TAILQ_FOREACH(dp, &clp->nfsc_deleg, nfsdl_list) {
		LIST_FOREACH_SAFE(lp, &dp->nfsdl_lock, nfsl_list, nlp) {
		    if (!NFSBCMP(lp->nfsl_owner, own, NFSV4CL_LOCKNAMELEN)) {
			if ((lp->nfsl_rwlock.nfslock_lock & NFSV4LOCK_WANTED))
			    panic("nfscllckw");
			nfscl_freelockowner(lp, 1);
		    }
		}
	}
	owp = LIST_FIRST(&clp->nfsc_owner);
	while (owp != NULL) {
		nowp = LIST_NEXT(owp, nfsow_list);
		if (!NFSBCMP(owp->nfsow_owner, own,
		    NFSV4CL_LOCKNAMELEN)) {
			if (LIST_EMPTY(&owp->nfsow_open))
				nfscl_freeopenowner(owp, 0);
			else
				owp->nfsow_defunct = 1;
		}
		owp = nowp;
	}
}
static void nfscl_cleanup_common ( struct nfsclclient * clp , u_int8_t * own ) { struct nfsclowner * owp , * nowp ; struct nfscllockowner * lp , * nlp ; struct nfscldeleg * dp ; TAILQ_FOREACH ( dp , & clp -> nfsc_deleg , nfsdl_list ) { LIST_FOREACH_SAFE ( lp , & dp -> nfsdl_lock , nfsl_list , nlp ) { if ( ! NFSBCMP ( lp -> nfsl_owner , own , NFSV4CL_LOCKNAMELEN ) ) { if ( ( lp -> nfsl_rwlock . nfslock_lock & NFSV4LOCK_WANTED ) ) panic ( " " ) ; nfscl_freelockowner ( lp , 1 ) ; } } } owp = LIST_FIRST ( & clp -> nfsc_owner ) ; while ( owp != NULL ) { nowp = LIST_NEXT ( owp , nfsow_list ) ; if ( ! NFSBCMP ( owp -> nfsow_owner , own , NFSV4CL_LOCKNAMELEN ) ) { if ( LIST_EMPTY ( & owp -> nfsow_open ) ) nfscl_freeopenowner ( owp , 0 ) ; else owp -> nfsow_defunct = 1 ; } owp = nowp ; } }
This function must be called after the process represented by "own" has
 exited.
This function must be called after the process represented by " own " has exited .
/* First, get rid of local locks on delegations. */ /*
			 * If there are children that haven't closed the
			 * file descriptors yet, the opens will still be
			 * here. For that case, let the renew thread clear
			 * out the OpenOwner later.
			 */