Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfsserver/nfs_nfsdstate.c
Show First 20 Lines • Show All 3,246 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Open update. Does the confirm, downgrade and close. | * Open update. Does the confirm, downgrade and close. | ||||
*/ | */ | ||||
APPLESTATIC int | APPLESTATIC int | ||||
nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, | nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, | ||||
nfsv4stateid_t *stateidp, struct nfsrv_descript *nd, NFSPROC_T *p) | nfsv4stateid_t *stateidp, struct nfsrv_descript *nd, NFSPROC_T *p) | ||||
{ | { | ||||
struct nfsstate *stp, *ownerstp; | struct nfsstate *stp; | ||||
struct nfsclient *clp; | struct nfsclient *clp; | ||||
struct nfslockfile *lfp; | struct nfslockfile *lfp; | ||||
u_int32_t bits; | u_int32_t bits; | ||||
int error = 0, gotstate = 0, len = 0; | int error = 0, gotstate = 0, len = 0; | ||||
u_char *clidp = NULL; | u_char *clidp = NULL; | ||||
/* | /* | ||||
* Check for restart conditions (client and server). | * Check for restart conditions (client and server). | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | if (new_stp->ls_flags & NFSLCK_CONFIRM) { | ||||
if (!(clp->lc_flags & LCL_STAMPEDSTABLE)) { | if (!(clp->lc_flags & LCL_STAMPEDSTABLE)) { | ||||
clp->lc_flags |= LCL_STAMPEDSTABLE; | clp->lc_flags |= LCL_STAMPEDSTABLE; | ||||
len = clp->lc_idlen; | len = clp->lc_idlen; | ||||
NFSBCOPY(clp->lc_id, clidp, len); | NFSBCOPY(clp->lc_id, clidp, len); | ||||
gotstate = 1; | gotstate = 1; | ||||
} | } | ||||
NFSUNLOCKSTATE(); | NFSUNLOCKSTATE(); | ||||
} else if (new_stp->ls_flags & NFSLCK_CLOSE) { | } else if (new_stp->ls_flags & NFSLCK_CLOSE) { | ||||
ownerstp = stp->ls_openowner; | |||||
lfp = stp->ls_lfp; | lfp = stp->ls_lfp; | ||||
if (nfsrv_dolocallocks != 0 && !LIST_EMPTY(&stp->ls_open)) { | if (nfsrv_dolocallocks != 0 && !LIST_EMPTY(&stp->ls_open)) { | ||||
/* Get the lf lock */ | /* Get the lf lock */ | ||||
nfsrv_locklf(lfp); | nfsrv_locklf(lfp); | ||||
NFSUNLOCKSTATE(); | NFSUNLOCKSTATE(); | ||||
ASSERT_VOP_ELOCKED(vp, "nfsrv_openupdate"); | ASSERT_VOP_ELOCKED(vp, "nfsrv_openupdate"); | ||||
NFSVOPUNLOCK(vp, 0); | NFSVOPUNLOCK(vp, 0); | ||||
if (nfsrv_freeopen(stp, vp, 1, p) == 0) { | if (nfsrv_freeopen(stp, vp, 1, p) == 0) { | ||||
▲ Show 20 Lines • Show All 2,760 Lines • Show Last 20 Lines |