Lines Matching refs:new_stp

158 static void nfsrv_getowner(struct nfsstatehead *hp, struct nfsstate *new_stp,
251 struct nfsstate *new_stp, struct nfslockfile *lfp, uint32_t *rflagsp,
1790 nfsrv_getowner(struct nfsstatehead *hp, struct nfsstate *new_stp, in nfsrv_getowner() argument
1797 if (new_stp->ls_ownerlen == stp->ls_ownerlen && in nfsrv_getowner()
1798 !NFSBCMP(new_stp->ls_owner,stp->ls_owner,stp->ls_ownerlen)) { in nfsrv_getowner()
1824 struct nfsstate *new_stp = *new_stpp; in nfsrv_lockctrl() local
1839 if (new_stp->ls_flags & (NFSLCK_CHECK | NFSLCK_SETATTR)) { in nfsrv_lockctrl()
1844 if (new_stp->ls_stateid.seqid == 0x0 && in nfsrv_lockctrl()
1845 new_stp->ls_stateid.other[0] == 0x0 && in nfsrv_lockctrl()
1846 new_stp->ls_stateid.other[1] == 0x0 && in nfsrv_lockctrl()
1847 new_stp->ls_stateid.other[2] == 0x0) in nfsrv_lockctrl()
1849 else if (new_stp->ls_stateid.seqid == 0xffffffff && in nfsrv_lockctrl()
1850 new_stp->ls_stateid.other[0] == 0xffffffff && in nfsrv_lockctrl()
1851 new_stp->ls_stateid.other[1] == 0xffffffff && in nfsrv_lockctrl()
1852 new_stp->ls_stateid.other[2] == 0xffffffff) in nfsrv_lockctrl()
1859 error = nfsrv_checkrestart(clientid, new_stp->ls_flags, in nfsrv_lockctrl()
1860 &new_stp->ls_stateid, specialid); in nfsrv_lockctrl()
1867 if ((new_stp->ls_flags & NFSLCK_LOCK) && in nfsrv_lockctrl()
1880 if (new_stp->ls_flags & NFSLCK_LOCK) in nfsrv_lockctrl()
1897 getlckret = nfsrv_getlockfh(vp, new_stp->ls_flags, NULL, &nfh, p); in nfsrv_lockctrl()
1900 if ((new_stp->ls_flags & (NFSLCK_LOCK | NFSLCK_UNLOCK)) != 0 && in nfsrv_lockctrl()
1902 getlckret = nfsrv_getlockfile(new_stp->ls_flags, NULL, in nfsrv_lockctrl()
1907 getlckret = nfsrv_getlockfile(new_stp->ls_flags, NULL, in nfsrv_lockctrl()
1915 if ((new_stp->ls_flags & NFSLCK_LOCK)) { in nfsrv_lockctrl()
1937 if (new_stp->ls_flags & NFSLCK_TEST) { in nfsrv_lockctrl()
1954 lckstp = new_stp; in nfsrv_lockctrl()
1962 error = nfsrv_getstate(clp, &new_stp->ls_stateid, in nfsrv_lockctrl()
1963 new_stp->ls_flags, &stp); in nfsrv_lockctrl()
1975 if ((new_stp->ls_flags & in nfsrv_lockctrl()
2005 if (new_stp->ls_flags & NFSLCK_OPENTOLOCK) { in nfsrv_lockctrl()
2011 error = nfsrv_checkseqid(nd, new_stp->ls_seq, in nfsrv_lockctrl()
2012 stp->ls_openowner, new_stp->ls_op); in nfsrv_lockctrl()
2017 nfsrv_getowner(&stp->ls_open, new_stp, &lckstp); in nfsrv_lockctrl()
2028 new_stp->ls_flags &= ~NFSLCK_OPENTOLOCK; in nfsrv_lockctrl()
2032 lckstp = new_stp; in nfsrv_lockctrl()
2033 } else if (new_stp->ls_flags&(NFSLCK_LOCK|NFSLCK_UNLOCK)) { in nfsrv_lockctrl()
2041 error = nfsrv_checkseqid(nd, new_stp->ls_seq, in nfsrv_lockctrl()
2042 stp, new_stp->ls_op); in nfsrv_lockctrl()
2059 if (!error && stp->ls_stateid.seqid!=new_stp->ls_stateid.seqid && in nfsrv_lockctrl()
2061 (!(new_stp->ls_flags & NFSLCK_CHECK) || in nfsrv_lockctrl()
2064 new_stp->ls_stateid.seqid != 0))) in nfsrv_lockctrl()
2073 error = nfsrv_checkgrace(nd, clp, new_stp->ls_flags); in nfsrv_lockctrl()
2074 if ((new_stp->ls_flags & NFSLCK_RECLAIM) && !error && in nfsrv_lockctrl()
2080 if ((new_stp->ls_flags & NFSLCK_RECLAIM) && !error) in nfsrv_lockctrl()
2126 if (new_stp->ls_flags & NFSLCK_TEST) { in nfsrv_lockctrl()
2128 } else if (new_stp->ls_flags & in nfsrv_lockctrl()
2152 if (new_stp->ls_flags & (NFSLCK_CHECK | NFSLCK_LOCK)) { in nfsrv_lockctrl()
2174 if (((new_stp->ls_flags & NFSLCK_LOCK) && in nfsrv_lockctrl()
2177 ((new_stp->ls_flags & (NFSLCK_CHECK|NFSLCK_READACCESS)) == in nfsrv_lockctrl()
2181 ((new_stp->ls_flags & (NFSLCK_CHECK|NFSLCK_WRITEACCESS)) == in nfsrv_lockctrl()
2203 if ((new_stp->ls_flags & NFSLCK_CHECK) && !delegation) { in nfsrv_lockctrl()
2211 if (new_stp->ls_flags & bits & NFSLCK_ACCESSBITS) { in nfsrv_lockctrl()
2244 if (new_stp->ls_flags & NFSLCK_SETATTR) { in nfsrv_lockctrl()
2260 if (!(new_stp->ls_flags & NFSLCK_CHECK) || in nfsrv_lockctrl()
2288 if ((((new_stp->ls_flags&(NFSLCK_LOCK|NFSLCK_UNLOCK|NFSLCK_TEST))|| in nfsrv_lockctrl()
2289 ((new_stp->ls_flags & NFSLCK_CHECK) && in nfsrv_lockctrl()
2293 ((new_stp->ls_flags & NFSLCK_CHECK) && in nfsrv_lockctrl()
2343 if (new_stp->ls_flags & NFSLCK_UNLOCK) { in nfsrv_lockctrl()
2437 else if (new_stp->ls_flags & NFSLCK_RECLAIM) in nfsrv_lockctrl()
2439 else if (new_stp->ls_flags & NFSLCK_CHECK) in nfsrv_lockctrl()
2465 if (new_stp->ls_flags & (NFSLCK_TEST | NFSLCK_CHECK)) { in nfsrv_lockctrl()
2479 if (!(new_stp->ls_flags & NFSLCK_OPENTOLOCK)) { in nfsrv_lockctrl()
2492 new_stp->ls_seq = new_stp->ls_opentolockseq; in nfsrv_lockctrl()
2493 nfsrvd_refcache(new_stp->ls_op); in nfsrv_lockctrl()
2494 stateidp->seqid = new_stp->ls_stateid.seqid = 1; in nfsrv_lockctrl()
2495 stateidp->other[0] = new_stp->ls_stateid.other[0] = in nfsrv_lockctrl()
2497 stateidp->other[1] = new_stp->ls_stateid.other[1] = in nfsrv_lockctrl()
2499 stateidp->other[2] = new_stp->ls_stateid.other[2] = in nfsrv_lockctrl()
2501 new_stp->ls_clp = clp; in nfsrv_lockctrl()
2502 LIST_INIT(&new_stp->ls_lock); in nfsrv_lockctrl()
2503 new_stp->ls_openstp = stp; in nfsrv_lockctrl()
2504 new_stp->ls_lfp = lfp; in nfsrv_lockctrl()
2505 nfsrv_insertlock(new_lop, (struct nfslock *)new_stp, new_stp, in nfsrv_lockctrl()
2507 LIST_INSERT_HEAD(NFSSTATEHASH(clp, new_stp->ls_stateid), in nfsrv_lockctrl()
2508 new_stp, ls_hash); in nfsrv_lockctrl()
2509 LIST_INSERT_HEAD(&stp->ls_open, new_stp, ls_list); in nfsrv_lockctrl()
2547 struct nfsstate *new_stp, vnode_t vp, struct nfsrv_descript *nd, in nfsrv_opencheck() argument
2556 if ((new_stp->ls_flags & NFSLCK_SHAREBITS) == NFSLCK_READACCESS) in nfsrv_opencheck()
2561 error = nfsrv_checkrestart(clientid, new_stp->ls_flags, in nfsrv_opencheck()
2562 &new_stp->ls_stateid, 0); in nfsrv_opencheck()
2582 getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, new_lfp, in nfsrv_opencheck()
2596 nfsrv_getowner(&clp->lc_open, new_stp, &ownerstp); in nfsrv_opencheck()
2599 error = nfsrv_checkseqid(nd, new_stp->ls_seq, ownerstp, in nfsrv_opencheck()
2600 new_stp->ls_op); in nfsrv_opencheck()
2615 error = nfsrv_checkgrace(nd, clp, new_stp->ls_flags); in nfsrv_opencheck()
2616 if ((new_stp->ls_flags & NFSLCK_RECLAIM) && !error && in nfsrv_opencheck()
2653 error = nfsrv_getlockfile(new_stp->ls_flags, &new_lfp, &lfp, in nfsrv_opencheck()
2670 if (new_stp->ls_flags & NFSLCK_DELEGCUR) { in nfsrv_opencheck()
2689 ((new_stp->ls_flags & NFSLCK_WRITEACCESS) && in nfsrv_opencheck()
2707 if (!(new_stp->ls_flags & NFSLCK_DELEGCUR) && in nfsrv_opencheck()
2708 (((new_stp->ls_flags & NFSLCK_ACCESSBITS) & in nfsrv_opencheck()
2711 ((new_stp->ls_flags>>NFSLCK_SHIFT)&NFSLCK_ACCESSBITS)))){ in nfsrv_opencheck()
2722 else if (new_stp->ls_flags & NFSLCK_RECLAIM) in nfsrv_opencheck()
2759 if (!(new_stp->ls_flags & in nfsrv_opencheck()
2768 (new_stp->ls_flags & NFSLCK_WANTWDELEG) == 0)))) { in nfsrv_opencheck()
2805 struct nfsstate *new_stp = *new_stpp; in nfsrv_openctrl() local
2815 if ((new_stp->ls_flags & NFSLCK_SHAREBITS) == NFSLCK_READACCESS) in nfsrv_openctrl()
2823 error = nfsrv_checkrestart(clientid, new_stp->ls_flags, in nfsrv_openctrl()
2824 &new_stp->ls_stateid, 0); in nfsrv_openctrl()
2840 getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, new_lfp, in nfsrv_openctrl()
2887 nfsrv_getowner(&clp->lc_open, new_stp, &ownerstp); in nfsrv_openctrl()
2905 if (new_stp->ls_flags & NFSLCK_RECLAIM) in nfsrv_openctrl()
2914 error = nfsrv_getlockfile(new_stp->ls_flags, &new_lfp, &lfp, in nfsrv_openctrl()
2935 if (new_stp->ls_flags & NFSLCK_DELEGCUR) { in nfsrv_openctrl()
2954 ((new_stp->ls_flags & NFSLCK_WRITEACCESS) && in nfsrv_openctrl()
2987 if (!(new_stp->ls_flags & NFSLCK_DELEGCUR)) { in nfsrv_openctrl()
3000 if(((new_stp->ls_flags & NFSLCK_ACCESSBITS) & in nfsrv_openctrl()
3003 ((new_stp->ls_flags>>NFSLCK_SHIFT)&NFSLCK_ACCESSBITS))){ in nfsrv_openctrl()
3017 else if (new_stp->ls_flags & NFSLCK_RECLAIM) in nfsrv_openctrl()
3056 if (!(new_stp->ls_flags & (NFSLCK_DELEGPREV | NFSLCK_DELEGCUR))) { in nfsrv_openctrl()
3064 (new_stp->ls_flags & NFSLCK_WANTWDELEG) == 0) in nfsrv_openctrl()
3070 (new_stp->ls_flags & NFSLCK_WANTWDELEG) == 0)))) { in nfsrv_openctrl()
3071 if (new_stp->ls_flags & NFSLCK_RECLAIM) { in nfsrv_openctrl()
3103 if (new_stp->ls_flags & NFSLCK_DELEGPREV) { in nfsrv_openctrl()
3143 new_open->ls_flags = (new_stp->ls_flags&NFSLCK_DENYBITS)| in nfsrv_openctrl()
3150 new_open->ls_uid = new_stp->ls_uid; in nfsrv_openctrl()
3164 new_open->ls_openowner = new_stp; in nfsrv_openctrl()
3165 new_stp->ls_flags = 0; in nfsrv_openctrl()
3166 nfsrvd_refcache(new_stp->ls_op); in nfsrv_openctrl()
3167 new_stp->ls_noopens = 0; in nfsrv_openctrl()
3168 LIST_INIT(&new_stp->ls_open); in nfsrv_openctrl()
3169 LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); in nfsrv_openctrl()
3170 LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); in nfsrv_openctrl()
3184 } else if (new_stp->ls_flags & (NFSLCK_DELEGREAD | NFSLCK_DELEGWRITE)) { in nfsrv_openctrl()
3211 if (new_stp->ls_flags & NFSLCK_DELEGWRITE) { in nfsrv_openctrl()
3221 new_deleg->ls_uid = new_stp->ls_uid; in nfsrv_openctrl()
3249 new_open->ls_flags = (new_stp->ls_flags & NFSLCK_DENYBITS) | in nfsrv_openctrl()
3251 if (new_stp->ls_flags & NFSLCK_DELEGWRITE) in nfsrv_openctrl()
3256 new_open->ls_uid = new_stp->ls_uid; in nfsrv_openctrl()
3270 new_open->ls_openowner = new_stp; in nfsrv_openctrl()
3271 new_stp->ls_flags = 0; in nfsrv_openctrl()
3272 nfsrvd_refcache(new_stp->ls_op); in nfsrv_openctrl()
3273 new_stp->ls_noopens = 0; in nfsrv_openctrl()
3274 LIST_INIT(&new_stp->ls_open); in nfsrv_openctrl()
3275 LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); in nfsrv_openctrl()
3276 LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); in nfsrv_openctrl()
3293 ownerstp->ls_op = new_stp->ls_op; in nfsrv_openctrl()
3295 ownerstp->ls_seq = new_stp->ls_seq; in nfsrv_openctrl()
3298 stp->ls_flags = (new_stp->ls_flags & NFSLCK_SHAREBITS) | in nfsrv_openctrl()
3301 stp->ls_uid = new_stp->ls_uid; in nfsrv_openctrl()
3309 openstp->ls_flags |= (new_stp->ls_flags & NFSLCK_SHAREBITS); in nfsrv_openctrl()
3320 new_stp, lfp, rflagsp, delegstateidp); in nfsrv_openctrl()
3326 new_open->ls_flags = (new_stp->ls_flags & NFSLCK_SHAREBITS)| in nfsrv_openctrl()
3328 new_open->ls_uid = new_stp->ls_uid; in nfsrv_openctrl()
3347 new_stp, lfp, rflagsp, delegstateidp); in nfsrv_openctrl()
3359 new_open->ls_flags = (new_stp->ls_flags & NFSLCK_SHAREBITS) | in nfsrv_openctrl()
3361 new_open->ls_uid = new_stp->ls_uid; in nfsrv_openctrl()
3363 new_open->ls_openowner = new_stp; in nfsrv_openctrl()
3367 if (new_stp->ls_flags & NFSLCK_RECLAIM) { in nfsrv_openctrl()
3368 new_stp->ls_flags = 0; in nfsrv_openctrl()
3375 new_stp, lfp, rflagsp, delegstateidp); in nfsrv_openctrl()
3377 new_stp->ls_flags = 0; in nfsrv_openctrl()
3391 new_stp->ls_flags = NFSLCK_NEEDSCONFIRM; in nfsrv_openctrl()
3393 nfsrvd_refcache(new_stp->ls_op); in nfsrv_openctrl()
3394 new_stp->ls_noopens = 0; in nfsrv_openctrl()
3395 LIST_INIT(&new_stp->ls_open); in nfsrv_openctrl()
3396 LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); in nfsrv_openctrl()
3397 LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); in nfsrv_openctrl()
3444 nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, in nfsrv_openupdate() argument
3457 error = nfsrv_checkrestart(clientid, new_stp->ls_flags, in nfsrv_openupdate()
3458 &new_stp->ls_stateid, 0); in nfsrv_openupdate()
3470 error = nfsrv_getstate(clp, &new_stp->ls_stateid, in nfsrv_openupdate()
3471 new_stp->ls_flags, &stp); in nfsrv_openupdate()
3477 (!(new_stp->ls_flags & NFSLCK_CONFIRM) && in nfsrv_openupdate()
3479 ((new_stp->ls_flags & NFSLCK_CONFIRM) && in nfsrv_openupdate()
3484 error = nfsrv_checkseqid(nd, new_stp->ls_seq, in nfsrv_openupdate()
3485 stp->ls_openowner, new_stp->ls_op); in nfsrv_openupdate()
3486 if (!error && stp->ls_stateid.seqid != new_stp->ls_stateid.seqid && in nfsrv_openupdate()
3488 !(new_stp->ls_flags & NFSLCK_CONFIRM)) || in nfsrv_openupdate()
3490 new_stp->ls_stateid.seqid != 0))) in nfsrv_openupdate()
3507 (new_stp->ls_flags & NFSLCK_CONFIRM) && in nfsrv_openupdate()
3526 if (new_stp->ls_flags & NFSLCK_CONFIRM) { in nfsrv_openupdate()
3544 } else if (new_stp->ls_flags & NFSLCK_CLOSE) { in nfsrv_openupdate()
3562 bits = (new_stp->ls_flags & NFSLCK_SHAREBITS); in nfsrv_openupdate()
3684 nfsrv_releaselckown(struct nfsstate *new_stp, nfsquad_t clientid, in nfsrv_releaselckown() argument
3694 error = nfsrv_checkrestart(clientid, new_stp->ls_flags, in nfsrv_releaselckown()
3695 &new_stp->ls_stateid, 0); in nfsrv_releaselckown()
3718 if (stp->ls_ownerlen == new_stp->ls_ownerlen && in nfsrv_releaselckown()
3719 !NFSBCMP(stp->ls_owner, new_stp->ls_owner, in nfsrv_releaselckown()
8937 struct nfsstate *new_stp, struct nfslockfile *lfp, uint32_t *rflagsp, in nfsrv_issuedelegation() argument
8944 if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0) in nfsrv_issuedelegation()
8952 (new_stp->ls_flags & NFSLCK_WANTWDELEG) != 0)) || in nfsrv_issuedelegation()
8958 (new_stp->ls_flags & NFSLCK_WANTRDELEG) != 0) in nfsrv_issuedelegation()
8964 (new_stp->ls_flags & NFSLCK_WANTWDELEG) != 0) { in nfsrv_issuedelegation()
8985 (new_stp->ls_flags & (NFSLCK_WANTRDELEG | in nfsrv_issuedelegation()
8996 new_deleg->ls_uid = new_stp->ls_uid; in nfsrv_issuedelegation()