FreeBSD/sys/fs/nfsclient/nfs_clstate.c
/*
 * Relock byte ranges. Called for delegation recall and state expiry.
 */
Relock byte ranges. Called for delegation recall and state expiry.
Relock byte ranges . Called for delegation recall and state expiry .
static int
nfscl_relock(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp,
    struct nfscllockowner *lp, struct nfscllock *lop, struct ucred *cred,
    NFSPROC_T *p)
{
	struct nfscllockowner *nlp;
	struct nfsfh *nfhp;
	u_int64_t off, len;
	u_int32_t clidrev = 0;
	int error, newone, donelocally;
	off = lop->nfslo_first;
	len = lop->nfslo_end - lop->nfslo_first;
	error = nfscl_getbytelock(vp, off, len, lop->nfslo_type, cred, p,
	    clp, 1, NULL, lp->nfsl_lockflags, lp->nfsl_owner,
	    lp->nfsl_openowner, &nlp, &newone, &donelocally);
	if (error || donelocally)
		return (error);
	if (nmp->nm_clp != NULL)
		clidrev = nmp->nm_clp->nfsc_clientidrev;
	else
		clidrev = 0;
	nfhp = VTONFS(vp)->n_fhp;
	error = nfscl_trylock(nmp, vp, nfhp->nfh_fh,
	    nfhp->nfh_len, nlp, newone, 0, off,
	    len, lop->nfslo_type, cred, p);
	if (error)
		nfscl_freelockowner(nlp, 0);
	return (error);
}
static int nfscl_relock ( vnode_t vp , struct nfsclclient * clp , struct nfsmount * nmp , struct nfscllockowner * lp , struct nfscllock * lop , struct ucred * cred , NFSPROC_T * p ) { struct nfscllockowner * nlp ; struct nfsfh * nfhp ; u_int64_t off , len ; u_int32_t clidrev = 0 ; int error , newone , donelocally ; off = lop -> nfslo_first ; len = lop -> nfslo_end - lop -> nfslo_first ; error = nfscl_getbytelock ( vp , off , len , lop -> nfslo_type , cred , p , clp , 1 , NULL , lp -> nfsl_lockflags , lp -> nfsl_owner , lp -> nfsl_openowner , & nlp , & newone , & donelocally ) ; if ( error || donelocally ) return ( error ) ; if ( nmp -> nm_clp != NULL ) clidrev = nmp -> nm_clp -> nfsc_clientidrev ; else clidrev = 0 ; nfhp = VTONFS ( vp ) -> n_fhp ; error = nfscl_trylock ( nmp , vp , nfhp -> nfh_fh , nfhp -> nfh_len , nlp , newone , 0 , off , len , lop -> nfslo_type , cred , p ) ; if ( error ) nfscl_freelockowner ( nlp , 0 ) ; return ( error ) ; }
Relock byte ranges.
Relock byte ranges .