Lines Matching refs:stp

102 static void nfsrv_freeopenowner(struct nfsstate *stp, int cansleep,
104 static int nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep,
106 static void nfsrv_freelockowner(struct nfsstate *stp, vnode_t vp, int cansleep,
108 static void nfsrv_freeallnfslocks(struct nfsstate *stp, vnode_t vp,
122 struct nfslock *insert_lop, struct nfsstate *stp, struct nfslockfile *lfp);
123 static void nfsrv_updatelock(struct nfsstate *stp, struct nfslock **new_lopp,
142 static int nfsrv_delegconflict(struct nfsstate *stp, int *haslockp,
149 static void nfsrv_delaydelegtimeout(struct nfsstate *stp);
151 struct nfsstate *stp, struct nfsrvcache *op);
152 static int nfsrv_nootherstate(struct nfsstate *stp);
184 struct nfsstate *stp, *tstp;
330 LIST_FOREACH(stp, &clp->lc_open, ls_list) {
331 if (!LIST_EMPTY(&stp->ls_open)) {
525 struct nfsstate *stp;
634 LIST_FOREACH(stp, &clp->lc_deleg, ls_list)
635 stp->ls_flags |= NFSLCK_OLDDELEG;
691 LIST_FOREACH(stp, &clp->lc_stateid[i], ls_hash) {
692 if ((stp->ls_flags & NFSLCK_OPEN) &&
693 stp->ls_uid == nd->nd_cred->cr_uid) {
904 struct nfsstate *stp, *openstp, *lckownstp;
940 LIST_FOREACH(stp, &clp->lc_open, ls_list) {
942 LIST_FOREACH(openstp, &stp->ls_open, ls_list) {
956 LIST_FOREACH(stp, &clp->lc_deleg, ls_list) {
959 LIST_FOREACH(stp, &clp->lc_olddeleg, ls_list) {
971 struct nfsstate *stp;
1008 stp = LIST_FIRST(&lfp->lf_open);
1009 while (stp != LIST_END(&lfp->lf_open) && cnt < maxcnt) {
1010 ldumpp[cnt].ndlck_flags = stp->ls_flags;
1011 ldumpp[cnt].ndlck_stateid.seqid = stp->ls_stateid.seqid;
1012 ldumpp[cnt].ndlck_stateid.other[0] = stp->ls_stateid.other[0];
1013 ldumpp[cnt].ndlck_stateid.other[1] = stp->ls_stateid.other[1];
1014 ldumpp[cnt].ndlck_stateid.other[2] = stp->ls_stateid.other[2];
1016 stp->ls_openowner->ls_ownerlen;
1017 NFSBCOPY(stp->ls_openowner->ls_owner,
1019 stp->ls_openowner->ls_ownerlen);
1020 ldumpp[cnt].ndlck_clid.nclid_idlen = stp->ls_clp->lc_idlen;
1021 NFSBCOPY(stp->ls_clp->lc_id, ldumpp[cnt].ndlck_clid.nclid_id,
1022 stp->ls_clp->lc_idlen);
1023 af = stp->ls_clp->lc_req.nr_nam->sa_family;
1028 rin = (struct sockaddr_in *)stp->ls_clp->lc_req.nr_nam;
1035 stp->ls_clp->lc_req.nr_nam;
1040 stp = LIST_NEXT(stp, ls_file);
1049 stp = lop->lo_stp;
1053 ldumpp[cnt].ndlck_stateid.seqid = stp->ls_stateid.seqid;
1054 ldumpp[cnt].ndlck_stateid.other[0] = stp->ls_stateid.other[0];
1055 ldumpp[cnt].ndlck_stateid.other[1] = stp->ls_stateid.other[1];
1056 ldumpp[cnt].ndlck_stateid.other[2] = stp->ls_stateid.other[2];
1057 ldumpp[cnt].ndlck_owner.nclid_idlen = stp->ls_ownerlen;
1058 NFSBCOPY(stp->ls_owner, ldumpp[cnt].ndlck_owner.nclid_id,
1059 stp->ls_ownerlen);
1060 ldumpp[cnt].ndlck_clid.nclid_idlen = stp->ls_clp->lc_idlen;
1061 NFSBCOPY(stp->ls_clp->lc_id, ldumpp[cnt].ndlck_clid.nclid_id,
1062 stp->ls_clp->lc_idlen);
1063 af = stp->ls_clp->lc_req.nr_nam->sa_family;
1068 rin = (struct sockaddr_in *)stp->ls_clp->lc_req.nr_nam;
1075 stp->ls_clp->lc_req.nr_nam;
1087 stp = LIST_FIRST(&lfp->lf_deleg);
1088 while (stp != LIST_END(&lfp->lf_deleg) && cnt < maxcnt) {
1089 ldumpp[cnt].ndlck_flags = stp->ls_flags;
1090 ldumpp[cnt].ndlck_stateid.seqid = stp->ls_stateid.seqid;
1091 ldumpp[cnt].ndlck_stateid.other[0] = stp->ls_stateid.other[0];
1092 ldumpp[cnt].ndlck_stateid.other[1] = stp->ls_stateid.other[1];
1093 ldumpp[cnt].ndlck_stateid.other[2] = stp->ls_stateid.other[2];
1095 ldumpp[cnt].ndlck_clid.nclid_idlen = stp->ls_clp->lc_idlen;
1096 NFSBCOPY(stp->ls_clp->lc_id, ldumpp[cnt].ndlck_clid.nclid_id,
1097 stp->ls_clp->lc_idlen);
1098 af = stp->ls_clp->lc_req.nr_nam->sa_family;
1103 rin = (struct sockaddr_in *)stp->ls_clp->lc_req.nr_nam;
1110 stp->ls_clp->lc_req.nr_nam;
1115 stp = LIST_NEXT(stp, ls_file);
1144 struct nfsstate *stp, *nstp;
1231 stp = LIST_FIRST(&clp->lc_open);
1232 while (stp != LIST_END(&clp->lc_open)) {
1233 nstp = LIST_NEXT(stp, ls_list);
1234 if (LIST_EMPTY(&stp->ls_open)) {
1235 stp->ls_noopens++;
1236 if (stp->ls_noopens > NFSNOOPEN ||
1242 stp->ls_noopens = 0;
1244 stp = nstp;
1268 struct nfsstate *stp, *nstp;
1271 LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp)
1272 nfsrv_freeopenowner(stp, 1, p);
1319 struct nfsstate *stp, *nstp;
1321 LIST_FOREACH_SAFE(stp, sthp, ls_list, nstp) {
1322 nfsrv_freedeleg(stp);
1331 nfsrv_freedeleg(struct nfsstate *stp)
1335 LIST_REMOVE(stp, ls_hash);
1336 LIST_REMOVE(stp, ls_list);
1337 LIST_REMOVE(stp, ls_file);
1338 if ((stp->ls_flags & NFSLCK_DELEGWRITE) != 0)
1340 lfp = stp->ls_lfp;
1347 FREE((caddr_t)stp, M_NFSDSTATE);
1357 nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p)
1361 LIST_REMOVE(stp, ls_list);
1365 nstp = LIST_FIRST(&stp->ls_open);
1366 while (nstp != LIST_END(&stp->ls_open)) {
1371 if (stp->ls_op)
1372 nfsrvd_derefcache(stp->ls_op);
1373 FREE((caddr_t)stp, M_NFSDSTATE);
1385 nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p)
1391 LIST_REMOVE(stp, ls_hash);
1392 LIST_REMOVE(stp, ls_list);
1393 LIST_REMOVE(stp, ls_file);
1395 lfp = stp->ls_lfp;
1399 LIST_FOREACH_SAFE(tstp, &stp->ls_open, ls_list, nstp)
1423 FREE((caddr_t)stp, M_NFSDSTATE);
1433 nfsrv_freelockowner(struct nfsstate *stp, vnode_t vp, int cansleep,
1437 LIST_REMOVE(stp, ls_hash);
1438 LIST_REMOVE(stp, ls_list);
1439 nfsrv_freeallnfslocks(stp, vp, cansleep, p);
1440 if (stp->ls_op)
1441 nfsrvd_derefcache(stp->ls_op);
1442 FREE((caddr_t)stp, M_NFSDSTATE);
1451 nfsrv_freeallnfslocks(struct nfsstate *stp, vnode_t vp, int cansleep,
1463 lop = LIST_FIRST(&stp->ls_lock);
1464 while (lop != LIST_END(&stp->ls_lock)) {
1544 struct nfsstate *stp;
1550 LIST_FOREACH(stp, hp, ls_hash) {
1551 if (!NFSBCMP(stp->ls_stateid.other, stateidp->other,
1559 if (stp == LIST_END(hp)) {
1563 *stpp = stp;
1577 struct nfsstate *stp;
1580 LIST_FOREACH(stp, hp, ls_list) {
1581 if (new_stp->ls_ownerlen == stp->ls_ownerlen &&
1582 !NFSBCMP(new_stp->ls_owner,stp->ls_owner,stp->ls_ownerlen)) {
1583 *stpp = stp;
1614 struct nfsstate *stp, *lckstp = NULL;
1747 new_stp->ls_flags, &stp);
1752 if (error == 0 && (stp->ls_flags & NFSLCK_OPEN) &&
1753 ((stp->ls_openowner->ls_flags & NFSLCK_NEEDSCONFIRM) ||
1754 (getlckret == 0 && stp->ls_lfp != lfp))){
1765 (stp->ls_flags & (NFSLCK_DELEGREAD | NFSLCK_DELEGWRITE)) &&
1766 getlckret == 0 && stp->ls_lfp != lfp)
1777 if (error == 0 && (stp->ls_flags &
1779 getlckret == 0 && stp->ls_lfp != lfp) {
1794 if (stp->ls_flags & NFSLCK_OPEN)
1796 stp->ls_openowner, new_stp->ls_op);
1801 nfsrv_getowner(&stp->ls_open, new_stp, &lckstp);
1822 if (stp->ls_flags & NFSLCK_OPEN)
1826 stp, new_stp->ls_op);
1828 lckstp = stp;
1830 lckstp = stp;
1843 if (!error && stp->ls_stateid.seqid!=new_stp->ls_stateid.seqid &&
1945 if (stp->ls_flags & (NFSLCK_DELEGREAD | NFSLCK_DELEGWRITE)) {
1947 mystp = stp;
1948 nfsrv_delaydelegtimeout(stp);
1949 } else if (stp->ls_flags & NFSLCK_OPEN) {
1950 mystp = stp;
1952 mystp = stp->ls_openstp;
2130 nfsrv_updatelock(stp, new_lopp, &other_lop, lfp);
2131 stateidp->seqid = ++(stp->ls_stateid.seqid);
2133 stateidp->seqid = stp->ls_stateid.seqid = 1;
2134 stateidp->other[0] = stp->ls_stateid.other[0];
2135 stateidp->other[1] = stp->ls_stateid.other[1];
2136 stateidp->other[2] = stp->ls_stateid.other[2];
2287 new_stp->ls_openstp = stp;
2293 LIST_INSERT_HEAD(&stp->ls_open, new_stp, ls_list);
2334 struct nfsstate *stp, *nstp;
2463 LIST_FOREACH(stp, &lfp->lf_deleg, ls_file) {
2464 if (!(stp->ls_flags & NFSLCK_OLDDELEG) &&
2467 stateidp->seqid == stp->ls_stateid.seqid) &&
2468 !NFSBCMP(stateidp->other, stp->ls_stateid.other,
2472 if (stp == LIST_END(&lfp->lf_deleg) ||
2474 (stp->ls_flags & NFSLCK_DELEGREAD))) {
2490 LIST_FOREACH(stp, &lfp->lf_open, ls_file) {
2493 ((stp->ls_flags>>NFSLCK_SHIFT) & NFSLCK_ACCESSBITS))||
2494 ((stp->ls_flags & NFSLCK_ACCESSBITS) &
2496 ret = nfsrv_clientconflict(stp->ls_clp,&haslock,vp,p);
2543 stp = LIST_FIRST(&lfp->lf_deleg);
2544 while (stp != LIST_END(&lfp->lf_deleg)) {
2545 nstp = LIST_NEXT(stp, ls_file);
2546 if ((readonly && stp->ls_clp != clp &&
2547 (stp->ls_flags & NFSLCK_DELEGWRITE)) ||
2548 (!readonly && (stp->ls_clp != clp ||
2549 (stp->ls_flags & NFSLCK_DELEGREAD)))) {
2550 ret = nfsrv_delegconflict(stp, &haslock, p, vp);
2562 stp = nstp;
2587 struct nfsstate *stp, *nstp;
2725 LIST_FOREACH(stp, &lfp->lf_deleg, ls_file) {
2726 if (!(stp->ls_flags & NFSLCK_OLDDELEG) &&
2729 stateidp->seqid == stp->ls_stateid.seqid) &&
2730 !NFSBCMP(stateidp->other, stp->ls_stateid.other,
2734 if (stp == LIST_END(&lfp->lf_deleg) ||
2736 (stp->ls_flags & NFSLCK_DELEGREAD))) {
2755 nfsrv_delaydelegtimeout(stp);
2765 LIST_FOREACH(stp, &lfp->lf_open, ls_file) {
2766 if (ownerstp && stp->ls_openowner == ownerstp)
2767 openstp = stp;
2774 if (clp != stp->ls_clp) {
2775 if ((stp->ls_flags & NFSLCK_SHAREBITS) ==
2782 ((stp->ls_flags>>NFSLCK_SHIFT) & NFSLCK_ACCESSBITS))||
2783 ((stp->ls_flags & NFSLCK_ACCESSBITS) &
2785 ret = nfsrv_clientconflict(stp->ls_clp,&haslock,vp,p);
2836 stp = LIST_FIRST(&lfp->lf_deleg);
2837 while (stp != LIST_END(&lfp->lf_deleg)) {
2838 nstp = LIST_NEXT(stp, ls_file);
2839 if (stp->ls_clp != clp && (stp->ls_flags & NFSLCK_DELEGREAD))
2843 if ((readonly && stp->ls_clp != clp &&
2844 (stp->ls_flags & NFSLCK_DELEGWRITE)) ||
2845 (!readonly && (stp->ls_clp != clp ||
2846 (stp->ls_flags & NFSLCK_DELEGREAD)))) {
2850 ret = nfsrv_delegconflict(stp, &haslock, p, vp);
2868 stp = nstp;
2886 LIST_FOREACH(stp, &clp->lc_olddeleg, ls_list) {
2887 if (stp->ls_lfp == lfp) {
2889 if (stp->ls_clp != clp)
2891 LIST_REMOVE(stp, ls_list);
2892 LIST_REMOVE(stp, ls_hash);
2893 stp->ls_flags &= ~NFSLCK_OLDDELEG;
2894 stp->ls_stateid.seqid = delegstateidp->seqid = 1;
2895 stp->ls_stateid.other[0] = delegstateidp->other[0] =
2897 stp->ls_stateid.other[1] = delegstateidp->other[1] =
2899 stp->ls_stateid.other[2] = delegstateidp->other[2] =
2901 stp->ls_compref = nd->nd_compref;
2902 LIST_INSERT_HEAD(&clp->lc_deleg, stp, ls_list);
2904 stp->ls_stateid), stp, ls_hash);
2905 if (stp->ls_flags & NFSLCK_DELEGWRITE)
2921 if (stp->ls_flags & NFSLCK_DELEGWRITE)
2958 if (stp == LIST_END(&clp->lc_olddeleg))
2967 LIST_FOREACH(stp, &lfp->lf_deleg, ls_file) {
2968 if (stp->ls_clp == clp)
2971 if (stp == LIST_END(&lfp->lf_deleg) && openstp == NULL) {
3072 stp = LIST_FIRST(&ownerstp->ls_open);
3073 stp->ls_flags = (new_stp->ls_flags & NFSLCK_SHAREBITS) |
3075 stp->ls_stateid.seqid = 1;
3076 stp->ls_uid = new_stp->ls_uid;
3077 if (lfp != stp->ls_lfp) {
3078 LIST_REMOVE(stp, ls_file);
3079 LIST_INSERT_HEAD(&lfp->lf_open, stp, ls_file);
3080 stp->ls_lfp = lfp;
3082 openstp = stp;
3350 struct nfsstate *stp, *ownerstp;
3374 new_stp->ls_flags, &stp);
3379 if (!error && (!(stp->ls_flags & NFSLCK_OPEN) ||
3381 (stp->ls_openowner->ls_flags & NFSLCK_NEEDSCONFIRM)) ||
3383 (!(stp->ls_openowner->ls_flags & NFSLCK_NEEDSCONFIRM)))))
3388 stp->ls_openowner, new_stp->ls_op);
3389 if (!error && stp->ls_stateid.seqid != new_stp->ls_stateid.seqid &&
3411 nfsrv_nootherstate(stp))
3412 nfsrv_freeopenowner(stp->ls_openowner, 0, p);
3420 stateidp->seqid = stp->ls_stateid.seqid + 1;
3423 stateidp->other[0] = stp->ls_stateid.other[0];
3424 stateidp->other[1] = stp->ls_stateid.other[1];
3425 stateidp->other[2] = stp->ls_stateid.other[2];
3434 if (!(stp->ls_openowner->ls_flags & NFSLCK_NEEDSCONFIRM))
3436 stp->ls_openowner->ls_flags = 0;
3437 stp->ls_stateid.seqid++;
3439 stp->ls_stateid.seqid == 0)
3440 stp->ls_stateid.seqid = 1;
3449 ownerstp = stp->ls_openowner;
3450 lfp = stp->ls_lfp;
3451 if (nfsrv_dolocallocks != 0 && !LIST_EMPTY(&stp->ls_open)) {
3457 if (nfsrv_freeopen(stp, vp, 1, p) == 0) {
3464 (void) nfsrv_freeopen(stp, NULL, 0, p);
3473 if (~(stp->ls_flags) & bits) {
3478 stp->ls_flags = (bits | NFSLCK_OPEN);
3479 stp->ls_stateid.seqid++;
3481 stp->ls_stateid.seqid == 0)
3482 stp->ls_stateid.seqid = 1;
3509 struct nfsstate *stp;
3546 error = nfsrv_getstate(clp, stateidp, NFSLCK_DELEGRETURN, &stp);
3547 if (!error && stp->ls_stateid.seqid != stateidp->seqid &&
3566 if (NFSBCMP((caddr_t)&fh, (caddr_t)&stp->ls_lfp->lf_fh,
3572 nfsrv_freedeleg(stp);
3591 struct nfsstate *stp, *nstp, *openstp, *ownstp;
3615 stp = LIST_FIRST(&openstp->ls_open);
3616 while (stp != LIST_END(&openstp->ls_open)) {
3617 nstp = LIST_NEXT(stp, ls_list);
3622 if (stp->ls_ownerlen == new_stp->ls_ownerlen &&
3623 !NFSBCMP(stp->ls_owner, new_stp->ls_owner,
3624 stp->ls_ownerlen)){
3625 if (LIST_EMPTY(&stp->ls_lock)) {
3626 nfsrv_freelockowner(stp, NULL, 0, p);
3633 stp = nstp;
3735 struct nfsstate *stp, struct nfslockfile *lfp)
3739 new_lop->lo_stp = stp;
3742 if (stp != NULL) {
3762 * Insert after insert_lop, which is overloaded as stp or lfp for
3765 if (stp == NULL && (struct nfslockfile *)insert_lop == lfp)
3767 else if ((struct nfsstate *)insert_lop == stp)
3768 LIST_INSERT_HEAD(&stp->ls_lock, new_lop, lo_lckowner);
3771 if (stp != NULL) {
3785 nfsrv_updatelock(struct nfsstate *stp, struct nfslock **new_lopp,
3799 if (stp != NULL) {
3800 ilop = (struct nfslock *)stp;
3801 lop = LIST_FIRST(&stp->ls_lock);
3891 other_lop->lo_stp = stp;
3894 nfsrv_insertlock(other_lop, lop, stp, lfp);
3910 nfsrv_insertlock(new_lop, ilop, stp, lfp);
3921 struct nfsstate *stp, struct nfsrvcache *op)
3932 if (stp->ls_op && stp->ls_op->rc_refcnt <= 0) {
3933 printf("refcnt=%d\n", stp->ls_op->rc_refcnt);
3936 if ((stp->ls_seq + 1) == seqid) {
3937 if (stp->ls_op)
3938 nfsrvd_derefcache(stp->ls_op);
3939 stp->ls_op = op;
3941 stp->ls_seq = seqid;
3943 } else if (stp->ls_seq == seqid && stp->ls_op &&
3944 op->rc_xid == stp->ls_op->rc_xid &&
3946 op->rc_reqlen == stp->ls_op->rc_reqlen &&
3947 op->rc_cksum == stp->ls_op->rc_cksum) {
3948 if (stp->ls_op->rc_flag & RC_INPROG) {
3952 nd->nd_rp = stp->ls_op;
4588 struct nfsstate *stp;
4605 LIST_FOREACH(stp, &clp->lc_stateid[i], ls_hash) {
4606 if (stp->ls_stateid.other[2] > 0x80000000) {
4607 if (stp->ls_stateid.other[2] < max_index)
4608 max_index = stp->ls_stateid.other[2];
4610 if (stp->ls_stateid.other[2] > min_index)
4611 min_index = stp->ls_stateid.other[2];
4629 LIST_FOREACH(stp, &clp->lc_stateid[i], ls_hash) {
4630 if (stp->ls_stateid.other[2] == canuse) {
5091 nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p,
5094 struct nfsclient *clp = stp->ls_clp;
5102 if (stp->ls_flags & NFSLCK_OLDDELEG) {
5107 nfsrv_freedeleg(stp);
5134 if (!(stp->ls_flags & NFSLCK_DELEGRECALL)) {
5149 stp->ls_delegtime = NFSD_MONOSEC + (2 * nfsrv_lease) +
5151 stp->ls_delegtimelimit = NFSD_MONOSEC + (6 * nfsrv_lease) +
5153 stp->ls_flags |= NFSLCK_DELEGRECALL;
5161 * Since nfsrv_docallback will sleep, don't use stp after
5164 NFSBCOPY((caddr_t)&stp->ls_stateid, (caddr_t)&tstateid,
5166 NFSBCOPY((caddr_t)&stp->ls_lfp->lf_fh, (caddr_t)&tfh,
5187 stp->ls_delegtime >= NFSD_MONOSEC) {
5256 nfsrv_freedeleg(stp);
5275 struct nfsstate *stp;
5329 LIST_FOREACH(stp, &lfp->lf_open, ls_file) {
5330 if (stp->ls_flags & NFSLCK_WRITEDENY) {
5362 struct nfsstate *stp, *nstp;
5365 stp = LIST_FIRST(&lfp->lf_deleg);
5366 while (stp != LIST_END(&lfp->lf_deleg)) {
5367 nstp = LIST_NEXT(stp, ls_file);
5368 if (stp->ls_clp != clp) {
5369 ret = nfsrv_delegconflict(stp, haslockp, p, vp);
5378 stp = nstp;
5492 struct nfsstate st, *stp = &st;
5498 stp->ls_flags = (NFSLCK_CHECK | NFSLCK_WRITEACCESS);
5501 stp->ls_flags = 0;
5508 stp->ls_flags |= NFSLCK_SETATTR;
5509 if (stp->ls_flags == 0)
5513 stp->ls_ownerlen = 0;
5514 stp->ls_op = NULL;
5515 stp->ls_uid = nd->nd_cred->cr_uid;
5516 stp->ls_stateid.seqid = stateidp->seqid;
5517 clientid.lval[0] = stp->ls_stateid.other[0] = stateidp->other[0];
5518 clientid.lval[1] = stp->ls_stateid.other[1] = stateidp->other[1];
5519 stp->ls_stateid.other[2] = stateidp->other[2];
5520 error = nfsrv_lockctrl(vp, &stp, &lop, NULL, clientid,
5539 struct nfsstate *stp;
5572 LIST_FOREACH(stp, &lfp->lf_deleg, ls_file) {
5573 if (stp->ls_flags & NFSLCK_DELEGWRITE)
5576 if (stp == LIST_END(&lfp->lf_deleg)) {
5580 clp = stp->ls_clp;
5588 delegfilerev = stp->ls_filerev;
5599 if (nd->nd_compref == stp->ls_compref ||
5651 struct nfsstate *stp, *nstp;
5661 LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) {
5662 if (LIST_EMPTY(&stp->ls_open) &&
5663 (stp->ls_noopens > NFSNOOPEN ||
5666 nfsrv_freeopenowner(stp, 0, p);
5725 nfsrv_delaydelegtimeout(struct nfsstate *stp)
5728 if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0)
5731 if ((stp->ls_delegtime + 15) > NFSD_MONOSEC &&
5732 stp->ls_delegtime < stp->ls_delegtimelimit) {
5733 stp->ls_delegtime += nfsrv_lease;
5734 if (stp->ls_delegtime > stp->ls_delegtimelimit)
5735 stp->ls_delegtime = stp->ls_delegtimelimit;
5745 nfsrv_nootherstate(struct nfsstate *stp)
5749 LIST_FOREACH(tstp, &stp->ls_openowner->ls_open, ls_list) {
5750 if (tstp != stp || !LIST_EMPTY(&tstp->ls_lock))
6403 struct nfsstate *stp;
6414 LIST_FOREACH(stp, &clp->lc_deleg, ls_list) {
6415 if (!NFSBCMP(stp->ls_stateid.other, stateidp->other,
6419 if (stp != NULL) {
6420 nfsrv_freedeleg(stp);
6427 error = nfsrv_getstate(clp, stateidp, 0, &stp);
6428 if (error == 0 && ((stp->ls_flags & (NFSLCK_OPEN | NFSLCK_DELEGREAD |
6429 NFSLCK_DELEGWRITE)) != 0 || (stp->ls_flags & NFSLCK_LOCK) == 0))
6432 if (error == 0 && !LIST_EMPTY(&stp->ls_lock))
6435 nfsrv_freelockowner(stp, NULL, 0, p);
6448 struct nfsstate *stp;
6458 error = nfsrv_getstate(clp, stateidp, 0, &stp);
6460 SEQ_LT(stateidp->seqid, stp->ls_stateid.seqid))