Lines Matching defs:lock
539 /* hash tables for lock and open owners */
877 * is used to manage concurrent access. Testing does not need the lock
2524 seq_printf(s, ": { type: lock, ");
2527 * Note: a lock stateid isn't really the same thing as a lock,
2529 * may be multiple (or no) lock ranges associated with it.
4266 /* ignore lock owners */
5486 * It's possible for a client to try and acquire an already held lock
5494 * indefinitely once the lock does become free.
5564 /* For lock stateid's, we test the parent open, not the lock: */
5620 * non-buggy client. For example, if the client sends a lock
5621 * while some IO is outstanding, the lock may bump si_generation
6348 * we can't properly handle lock requests that go beyond the (2^63 - 1)-th
6355 nfs4_transform_lock_offset(struct file_lock *lock)
6357 if (lock->fl_start < 0)
6358 lock->fl_start = OFFSET_MAX;
6359 if (lock->fl_end < 0)
6360 lock->fl_end = OFFSET_MAX;
6486 * Alloc a lock owner structure.
6495 struct nfsd4_lock *lock)
6499 lo = alloc_stateowner(lockowner_slab, &lock->lk_new_owner, clp);
6505 lo->lo_owner.so_seqid = lock->lk_new_lock_seqid;
6508 ret = find_lockowner_str_locked(clp, &lock->lk_new_owner);
6640 struct nfsd4_lock *lock,
6652 lo = find_lockowner_str(cl, &lock->lk_new_owner);
6654 strhashval = ownerstr_hashval(&lock->lk_new_owner);
6655 lo = alloc_init_lock_stateowner(strhashval, cl, ost, lock);
6662 lock->lk_new_lock_seqid != lo->lo_owner.so_seqid)
6686 struct nfsd4_lock *lock = &u->lock;
6706 (long long) lock->lk_offset,
6707 (long long) lock->lk_length);
6709 if (check_lock_length(lock->lk_offset, lock->lk_length))
6718 if (lock->lk_is_new) {
6721 memcpy(&lock->lk_new_clientid,
6726 if (STALE_CLIENTID(&lock->lk_new_clientid, nn))
6731 lock->lk_new_open_seqid,
6732 &lock->lk_new_open_stateid,
6740 &lock->lk_new_clientid))
6742 status = lookup_or_create_lock_state(cstate, open_stp, lock,
6746 lock->lk_old_lock_seqid,
6747 &lock->lk_old_lock_stateid,
6754 lkflg = setlkflg(lock->lk_type);
6760 if (locks_in_grace(net) && !lock->lk_reclaim)
6763 if (!locks_in_grace(net) && lock->lk_reclaim)
6767 switch (lock->lk_type) {
6816 file_lock->fl_start = lock->lk_offset;
6817 file_lock->fl_end = last_byte_offset(lock->lk_offset, lock->lk_length);
6822 dprintk("NFSD: %s: unable to allocate lock!\n", __func__);
6838 nfs4_inc_and_copy_stateid(&lock->lk_resp_stateid, &lock_stp->st_stid);
6840 if (lock->lk_reclaim)
6846 case -EAGAIN: /* conflock holds conflicting lock */
6848 dprintk("NFSD: nfsd4_lock: conflicting lock found!\n");
6849 nfs4_set_lock_denied(conflock, &lock->lk_denied);
6903 static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock)
6916 lock->fl_file = nf->nf_file;
6917 err = nfserrno(vfs_test_lock(nf->nf_file, lock));
6918 lock->fl_file = NULL;
6956 dprintk("NFSD: %s: unable to allocate lock!\n", __func__);
6971 dprintk("NFSD: nfs4_lockt: bad lock type!\n");
7034 dprintk("NFSD: %s: unable to allocate lock!\n", __func__);
7088 /* Any valid lock stateid should have some sort of access */
7135 /* Find the matching lock stateowner */
7527 put_stateid(cstate, &u->lock.lk_resp_stateid);