Lines Matching defs:stateid
79 #define ZERO_STATEID(stateid) (!memcmp((stateid), &zero_stateid, sizeof(stateid_t)))
80 #define ONE_STATEID(stateid) (!memcmp((stateid), &one_stateid, sizeof(stateid_t)))
81 #define CURRENT_STATEID(stateid) (!memcmp((stateid), ¤tstateid, sizeof(stateid_t)))
82 #define CLOSE_STATEID(stateid) (!memcmp((stateid), &close_stateid, sizeof(stateid_t)))
107 * the refcount on the open stateid to drop.
405 * st_{access,deny}_bmap field of the stateid, in order to track not
440 /* set share access for a given stateid */
450 /* clear share access for a given stateid */
460 /* test whether a given stateid has access */
469 /* set share deny for a given stateid */
479 /* clear share deny for a given stateid */
489 /* test whether a given stateid is denying specific access */
758 /* ignore lock stateid */
966 * It shouldn't be a problem to reuse an opaque stateid value.
1393 * A stateid that had a deny mode associated with it is being released
1426 /* release all access and file references for a given stateid */
1512 * Put the persistent reference to an already unhashed generic stateid, while
2677 * Note: a lock stateid isn't really the same thing as a lock,
2684 /* XXX: open stateid? */
4561 /* Lock the stateid st_mutex, and deal with races with CLOSE */
4689 * stateid. We can't put the sc_file reference until they are finished.
4789 * Called to check deny when READ with all zero stateid or
4790 * WRITE with all zero or all one stateid
5237 /* Set access bits in stateid */
5735 * Lookup file; if found, lookup stateid and check open request,
6315 /* For lock stateid's, we test the parent open, not the lock: */
6328 check_special_stateids(struct net *net, svc_fh *current_fh, stateid_t *stateid, int flags)
6330 if (ONE_STATEID(stateid) && (flags & RD_STATE))
6339 else /* (flags & RD_STATE) && ZERO_STATEID(stateid) */
6347 * When sessions are used the stateid generation number is ignored
6356 /* If the client sends us a stateid from the future, it's buggy: */
6360 * However, we could see a stateid from the past, even from a
6392 static __be32 nfsd4_validate_stateid(struct nfs4_client *cl, stateid_t *stateid)
6397 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
6398 CLOSE_STATEID(stateid))
6401 s = find_stateid_locked(cl, stateid);
6404 status = nfsd4_stid_check_stateid_generation(stateid, s, 1);
6419 printk("unknown stateid type %x\n", s->sc_type);
6432 stateid_t *stateid, unsigned char typemask,
6448 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
6449 CLOSE_STATEID(stateid))
6451 status = set_client(&stateid->si_opaque.so_clid, cstate, nn);
6459 stid = find_stateid_by_type(cstate->clp, stateid, typemask);
6546 * copy stateid. Look up the copy notify stateid from the
6620 * nfs4_preprocess_stateid_op - find and prep stateid for an operation
6623 * @fhp: filehandle associated with requested stateid
6624 * @stateid: stateid (provided by client)
6636 stateid_t *stateid, int flags, struct nfsd_file **nfp,
6647 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid)) {
6651 status = check_special_stateids(net, fhp, stateid,
6656 status = nfsd4_lookup_stateid(cstate, stateid,
6660 status = find_cpntf_state(nn, stateid, &s);
6663 status = nfsd4_stid_check_stateid_generation(stateid, s,
6698 * Test if the stateid is valid
6705 struct nfsd4_test_stateid_id *stateid;
6708 list_for_each_entry(stateid, &test_stateid->ts_stateid_list, ts_id_list)
6709 stateid->ts_id_status =
6710 nfsd4_validate_stateid(cl, &stateid->ts_id_stateid);
6716 nfsd4_free_lock_stateid(stateid_t *stateid, struct nfs4_stid *s)
6725 ret = check_stateid_generation(stateid, &s->sc_stateid, 1);
6749 stateid_t *stateid = &free_stateid->fr_stateid;
6756 s = find_stateid_locked(cl, stateid);
6765 ret = check_stateid_generation(stateid, &s->sc_stateid, 1);
6774 ret = nfsd4_free_lock_stateid(stateid, s);
6800 static __be32 nfs4_seqid_op_checks(struct nfsd4_compound_state *cstate, stateid_t *stateid, u32 seqid, struct nfs4_ol_stateid *stp)
6812 status = check_stateid_generation(stateid, &stp->st_stid.sc_stateid, nfsd4_has_session(cstate));
6824 * @stateid: stateid (provided by client)
6826 * @stpp: return pointer for the stateid found
6829 * Given a stateid+seqid from a client, look up an nfs4_ol_stateid and
6830 * return it in @stpp. On a nfs_ok return, the returned stateid will
6835 stateid_t *stateid, char typemask,
6843 trace_nfsd_preprocess(seqid, stateid);
6846 status = nfsd4_lookup_stateid(cstate, stateid, typemask, &s, nn);
6852 status = nfs4_seqid_op_checks(cstate, stateid, seqid, stp);
6861 stateid_t *stateid, struct nfs4_ol_stateid **stpp, struct nfsd_net *nn)
6867 status = nfs4_preprocess_seqid_op(cstate, seqid, stateid,
7054 /* v4.1+ suggests that we send a special stateid in here, since the
7075 stateid_t *stateid = &dr->dr_stateid;
7083 status = nfsd4_lookup_stateid(cstate, stateid, NFS4_DELEG_STID, &s, nn);
7087 status = nfsd4_stid_check_stateid_generation(stateid, &dp->dl_stid, nfsd4_has_session(cstate));
7091 trace_nfsd_deleg_return(stateid);
7518 /* validate and update open stateid and open seqid */
7689 * If this is a new, never-before-used stateid, and we are
7899 /* Any valid lock stateid should have some sort of access */
8292 get_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
8295 CURRENT_STATEID(stateid))
8296 memcpy(stateid, &cstate->current_stateid, sizeof(stateid_t));
8300 put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
8303 memcpy(&cstate->current_stateid, stateid, sizeof(stateid_t));