Lines Matching defs:stateid
75 #define ZERO_STATEID(stateid) (!memcmp((stateid), &zero_stateid, sizeof(stateid_t)))
76 #define ONE_STATEID(stateid) (!memcmp((stateid), &one_stateid, sizeof(stateid_t)))
77 #define CURRENT_STATEID(stateid) (!memcmp((stateid), ¤tstateid, sizeof(stateid_t)))
78 #define CLOSE_STATEID(stateid) (!memcmp((stateid), &close_stateid, sizeof(stateid_t)))
102 * the refcount on the open stateid to drop.
753 * It shouldn't be a problem to reuse an opaque stateid value.
1173 * st_{access,deny}_bmap field of the stateid, in order to track not
1201 /* set share access for a given stateid */
1211 /* clear share access for a given stateid */
1221 /* test whether a given stateid has access */
1230 /* set share deny for a given stateid */
1240 /* clear share deny for a given stateid */
1250 /* test whether a given stateid is denying specific access */
1274 * A stateid that had a deny mode associated with it is being released
1307 /* release all access and file references for a given stateid */
1393 * Put the persistent reference to an already unhashed generic stateid, while
2527 * Note: a lock stateid isn't really the same thing as a lock,
2534 /* XXX: open stateid? */
4299 /* Lock the stateid st_mutex, and deal with races with CLOSE */
4427 * stateid. We can't put the sc_file reference until they are finished.
4502 * Called to check deny when READ with all zero stateid or
4503 * WRITE with all zero or all one stateid
4895 /* Set access bits in stateid */
5201 * Lookup file; if found, lookup stateid and check open request,
5564 /* For lock stateid's, we test the parent open, not the lock: */
5577 check_special_stateids(struct net *net, svc_fh *current_fh, stateid_t *stateid, int flags)
5579 if (ONE_STATEID(stateid) && (flags & RD_STATE))
5588 else /* (flags & RD_STATE) && ZERO_STATEID(stateid) */
5606 * When sessions are used the stateid generation number is ignored
5615 /* If the client sends us a stateid from the future, it's buggy: */
5619 * However, we could see a stateid from the past, even from a
5651 static __be32 nfsd4_validate_stateid(struct nfs4_client *cl, stateid_t *stateid)
5656 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
5657 CLOSE_STATEID(stateid))
5660 s = find_stateid_locked(cl, stateid);
5663 status = nfsd4_stid_check_stateid_generation(stateid, s, 1);
5678 printk("unknown stateid type %x\n", s->sc_type);
5691 stateid_t *stateid, unsigned char typemask,
5706 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
5707 CLOSE_STATEID(stateid))
5709 status = lookup_clientid(&stateid->si_opaque.so_clid, cstate, nn,
5718 *s = find_stateid_by_type(cstate->clp, stateid, typemask);
5801 * copy stateid. Look up the copy notify stateid from the
5869 * Checks for stateid operations
5874 stateid_t *stateid, int flags, struct nfsd_file **nfp,
5889 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid)) {
5890 status = check_special_stateids(net, fhp, stateid, flags);
5894 status = nfsd4_lookup_stateid(cstate, stateid,
5898 status = find_cpntf_state(nn, stateid, &s);
5901 status = nfsd4_stid_check_stateid_generation(stateid, s,
5936 * Test if the stateid is valid
5943 struct nfsd4_test_stateid_id *stateid;
5946 list_for_each_entry(stateid, &test_stateid->ts_stateid_list, ts_id_list)
5947 stateid->ts_id_status =
5948 nfsd4_validate_stateid(cl, &stateid->ts_id_stateid);
5954 nfsd4_free_lock_stateid(stateid_t *stateid, struct nfs4_stid *s)
5963 ret = check_stateid_generation(stateid, &s->sc_stateid, 1);
5987 stateid_t *stateid = &free_stateid->fr_stateid;
5994 s = find_stateid_locked(cl, stateid);
6003 ret = check_stateid_generation(stateid, &s->sc_stateid, 1);
6012 ret = nfsd4_free_lock_stateid(stateid, s);
6038 static __be32 nfs4_seqid_op_checks(struct nfsd4_compound_state *cstate, stateid_t *stateid, u32 seqid, struct nfs4_ol_stateid *stp)
6050 status = check_stateid_generation(stateid, &stp->st_stid.sc_stateid, nfsd4_has_session(cstate));
6063 stateid_t *stateid, char typemask,
6071 trace_nfsd_preprocess(seqid, stateid);
6074 status = nfsd4_lookup_stateid(cstate, stateid, typemask, &s, nn);
6080 status = nfs4_seqid_op_checks(cstate, stateid, seqid, stp);
6089 stateid_t *stateid, struct nfs4_ol_stateid **stpp, struct nfsd_net *nn)
6095 status = nfs4_preprocess_seqid_op(cstate, seqid, stateid,
6282 /* v4.1+ suggests that we send a special stateid in here, since the
6303 stateid_t *stateid = &dr->dr_stateid;
6311 status = nfsd4_lookup_stateid(cstate, stateid, NFS4_DELEG_STID, &s, nn);
6315 status = nfsd4_stid_check_stateid_generation(stateid, &dp->dl_stid, nfsd4_has_session(cstate));
6729 /* validate and update open stateid and open seqid */
6880 * If this is a new, never-before-used stateid, and we are
7088 /* Any valid lock stateid should have some sort of access */
7477 get_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
7480 CURRENT_STATEID(stateid))
7481 memcpy(stateid, &cstate->current_stateid, sizeof(stateid_t));
7485 put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
7488 memcpy(&cstate->current_stateid, stateid, sizeof(stateid_t));