FreeBSD/sys/fs/nfsclient/nfs_clstate.c
/*
 * Called for an Open when NFSERR_EXPIRED is received from the server.
 * If there are no byte range locks nor a Share Deny lost, try to do a
 * fresh Open. Otherwise, free the open.
 */
Called for an Open when NFSERR_EXPIRED is received from the server.
If there are no byte range locks nor a Share Deny lost, try to do a
fresh Open. Otherwise, free the open.
Called for an Open when NFSERR_EXPIRED is received from the server . If there are no byte range locks nor a Share Deny lost try to do a fresh Open . Otherwise free the open .
static int
nfscl_expireopen(struct nfsclclient *clp, struct nfsclopen *op,
    struct nfsmount *nmp, struct ucred *cred, NFSPROC_T *p)
{
	struct nfscllockowner *lp;
	struct nfscldeleg *dp;
	int mustdelete = 0, error;
	LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) {
		if (!LIST_EMPTY(&lp->nfsl_lock)) {
			mustdelete = 1;
			break;
		}
	}
	if (!mustdelete && (op->nfso_mode & NFSLCK_DENYBITS) == 0) {
		newnfs_copycred(&op->nfso_cred, cred);
		dp = NULL;
		error = nfsrpc_reopen(nmp, op->nfso_fh,
		    op->nfso_fhlen, op->nfso_mode, op, &dp, cred, p);
		if (error) {
			mustdelete = 1;
			if (dp != NULL) {
				FREE((caddr_t)dp, M_NFSCLDELEG);
				dp = NULL;
			}
		}
		if (dp != NULL)
			nfscl_deleg(nmp->nm_mountp, clp, op->nfso_fh,
			    op->nfso_fhlen, cred, p, &dp);
	}
	if (mustdelete)
		nfscl_freeopen(op, 0);
	return (mustdelete);
}
static int nfscl_expireopen ( struct nfsclclient * clp , struct nfsclopen * op , struct nfsmount * nmp , struct ucred * cred , NFSPROC_T * p ) { struct nfscllockowner * lp ; struct nfscldeleg * dp ; int mustdelete = 0 , error ; LIST_FOREACH ( lp , & op -> nfso_lock , nfsl_list ) { if ( ! LIST_EMPTY ( & lp -> nfsl_lock ) ) { mustdelete = 1 ; break ; } } if ( ! mustdelete && ( op -> nfso_mode & NFSLCK_DENYBITS ) == 0 ) { newnfs_copycred ( & op -> nfso_cred , cred ) ; dp = NULL ; error = nfsrpc_reopen ( nmp , op -> nfso_fh , op -> nfso_fhlen , op -> nfso_mode , op , & dp , cred , p ) ; if ( error ) { mustdelete = 1 ; if ( dp != NULL ) { FREE ( ( caddr_t ) dp , M_NFSCLDELEG ) ; dp = NULL ; } } if ( dp != NULL ) nfscl_deleg ( nmp -> nm_mountp , clp , op -> nfso_fh , op -> nfso_fhlen , cred , p , & dp ) ; } if ( mustdelete ) nfscl_freeopen ( op , 0 ) ; return ( mustdelete ) ; }
Called for an Open when NFSERR_EXPIRED is received from the server.
Called for an Open when NFSERR_EXPIRED is received from the server .
/*
	 * Look for any byte range lock(s).
	 */ /*
	 * If no byte range lock(s) nor a Share deny, try to re-open.
	 */ /*
	 * If a byte range lock or Share deny or couldn't re-open, free it.
	 */