Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/nfsclient/nfs_clstate.c
Show First 20 Lines • Show All 4,110 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
nfscl_relock(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp, | nfscl_relock(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp, | ||||
struct nfscllockowner *lp, struct nfscllock *lop, struct ucred *cred, | struct nfscllockowner *lp, struct nfscllock *lop, struct ucred *cred, | ||||
NFSPROC_T *p) | NFSPROC_T *p) | ||||
{ | { | ||||
struct nfscllockowner *nlp; | struct nfscllockowner *nlp; | ||||
struct nfsfh *nfhp; | struct nfsfh *nfhp; | ||||
u_int64_t off, len; | u_int64_t off, len; | ||||
u_int32_t clidrev = 0; | |||||
int error, newone, donelocally; | int error, newone, donelocally; | ||||
off = lop->nfslo_first; | off = lop->nfslo_first; | ||||
len = lop->nfslo_end - lop->nfslo_first; | len = lop->nfslo_end - lop->nfslo_first; | ||||
error = nfscl_getbytelock(vp, off, len, lop->nfslo_type, cred, p, | error = nfscl_getbytelock(vp, off, len, lop->nfslo_type, cred, p, | ||||
clp, 1, NULL, lp->nfsl_lockflags, lp->nfsl_owner, | clp, 1, NULL, lp->nfsl_lockflags, lp->nfsl_owner, | ||||
lp->nfsl_openowner, &nlp, &newone, &donelocally); | lp->nfsl_openowner, &nlp, &newone, &donelocally); | ||||
if (error || donelocally) | if (error || donelocally) | ||||
return (error); | return (error); | ||||
if (nmp->nm_clp != NULL) | |||||
clidrev = nmp->nm_clp->nfsc_clientidrev; | |||||
else | |||||
clidrev = 0; | |||||
nfhp = VTONFS(vp)->n_fhp; | nfhp = VTONFS(vp)->n_fhp; | ||||
error = nfscl_trylock(nmp, vp, nfhp->nfh_fh, | error = nfscl_trylock(nmp, vp, nfhp->nfh_fh, | ||||
nfhp->nfh_len, nlp, newone, 0, off, | nfhp->nfh_len, nlp, newone, 0, off, | ||||
len, lop->nfslo_type, cred, p); | len, lop->nfslo_type, cred, p); | ||||
if (error) | if (error) | ||||
nfscl_freelockowner(nlp, 0); | nfscl_freelockowner(nlp, 0); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,218 Lines • Show Last 20 Lines |