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