Lines Matching full:stp
445 set_access(u32 access, struct nfs4_ol_stateid *stp) in set_access() argument
450 stp->st_access_bmap |= mask; in set_access()
455 clear_access(u32 access, struct nfs4_ol_stateid *stp) in clear_access() argument
460 stp->st_access_bmap &= ~mask; in clear_access()
465 test_access(u32 access, struct nfs4_ol_stateid *stp) in test_access() argument
469 return (bool)(stp->st_access_bmap & mask); in test_access()
474 set_deny(u32 deny, struct nfs4_ol_stateid *stp) in set_deny() argument
479 stp->st_deny_bmap |= mask; in set_deny()
484 clear_deny(u32 deny, struct nfs4_ol_stateid *stp) in clear_deny() argument
489 stp->st_deny_bmap &= ~mask; in clear_deny()
494 test_deny(u32 deny, struct nfs4_ol_stateid *stp) in test_deny() argument
498 return (bool)(stp->st_deny_bmap & mask); in test_deny()
516 access_permit_read(struct nfs4_ol_stateid *stp) in access_permit_read() argument
518 return test_access(NFS4_SHARE_ACCESS_READ, stp) || in access_permit_read()
519 test_access(NFS4_SHARE_ACCESS_BOTH, stp) || in access_permit_read()
520 test_access(NFS4_SHARE_ACCESS_WRITE, stp); in access_permit_read()
524 access_permit_write(struct nfs4_ol_stateid *stp) in access_permit_write() argument
526 return test_access(NFS4_SHARE_ACCESS_WRITE, stp) || in access_permit_write()
527 test_access(NFS4_SHARE_ACCESS_BOTH, stp); in access_permit_write()
730 * stp: skip checking this entry.
739 struct nfs4_ol_stateid *stp, u32 access, bool share_access) in nfs4_resolve_deny_conflicts_locked() argument
752 if (st == stp && new_stp) in nfs4_resolve_deny_conflicts_locked()
765 clp = stp->st_stid.sc_client; in nfs4_resolve_deny_conflicts_locked()
1427 struct nfs4_ol_stateid *stp; in recalculate_deny_mode() local
1433 list_for_each_entry(stp, &fp->fi_stateids, st_perfile) { in recalculate_deny_mode()
1434 fp->fi_share_deny |= bmap_to_share_mode(stp->st_deny_bmap); in recalculate_deny_mode()
1442 reset_union_bmap_deny(u32 deny, struct nfs4_ol_stateid *stp) in reset_union_bmap_deny() argument
1450 clear_deny(i, stp); in reset_union_bmap_deny()
1456 recalculate_deny_mode(stp->st_stid.sc_file); in reset_union_bmap_deny()
1461 release_all_access(struct nfs4_ol_stateid *stp) in release_all_access() argument
1464 struct nfs4_file *fp = stp->st_stid.sc_file; in release_all_access()
1466 if (fp && stp->st_deny_bmap != 0) in release_all_access()
1470 if (test_access(i, stp)) in release_all_access()
1471 nfs4_file_put_access(stp->st_stid.sc_file, i); in release_all_access()
1472 clear_access(i, stp); in release_all_access()
1496 nfs4_ol_stateid_unhashed(const struct nfs4_ol_stateid *stp) in nfs4_ol_stateid_unhashed() argument
1498 return list_empty(&stp->st_perfile); in nfs4_ol_stateid_unhashed()
1501 static bool unhash_ol_stateid(struct nfs4_ol_stateid *stp) in unhash_ol_stateid() argument
1503 struct nfs4_file *fp = stp->st_stid.sc_file; in unhash_ol_stateid()
1505 lockdep_assert_held(&stp->st_stateowner->so_client->cl_lock); in unhash_ol_stateid()
1507 if (list_empty(&stp->st_perfile)) in unhash_ol_stateid()
1511 list_del_init(&stp->st_perfile); in unhash_ol_stateid()
1513 list_del(&stp->st_perstateowner); in unhash_ol_stateid()
1519 struct nfs4_ol_stateid *stp = openlockstateid(stid); in nfs4_free_ol_stateid() local
1521 put_clnt_odstate(stp->st_clnt_odstate); in nfs4_free_ol_stateid()
1522 release_all_access(stp); in nfs4_free_ol_stateid()
1523 if (stp->st_stateowner) in nfs4_free_ol_stateid()
1524 nfs4_put_stateowner(stp->st_stateowner); in nfs4_free_ol_stateid()
1531 struct nfs4_ol_stateid *stp = openlockstateid(stid); in nfs4_free_lock_stateid() local
1532 struct nfs4_lockowner *lo = lockowner(stp->st_stateowner); in nfs4_free_lock_stateid()
1535 nf = find_any_file(stp->st_stid.sc_file); in nfs4_free_lock_stateid()
1549 static void put_ol_stateid_locked(struct nfs4_ol_stateid *stp, in put_ol_stateid_locked() argument
1552 struct nfs4_stid *s = &stp->st_stid; in put_ol_stateid_locked()
1557 WARN_ON_ONCE(!list_empty(&stp->st_locks)); in put_ol_stateid_locked()
1567 list_add(&stp->st_locks, reaplist); in put_ol_stateid_locked()
1570 static bool unhash_lock_stateid(struct nfs4_ol_stateid *stp) in unhash_lock_stateid() argument
1572 lockdep_assert_held(&stp->st_stid.sc_client->cl_lock); in unhash_lock_stateid()
1574 if (!unhash_ol_stateid(stp)) in unhash_lock_stateid()
1576 list_del_init(&stp->st_locks); in unhash_lock_stateid()
1577 stp->st_stid.sc_status |= SC_STATUS_CLOSED; in unhash_lock_stateid()
1581 static void release_lock_stateid(struct nfs4_ol_stateid *stp) in release_lock_stateid() argument
1583 struct nfs4_client *clp = stp->st_stid.sc_client; in release_lock_stateid()
1587 unhashed = unhash_lock_stateid(stp); in release_lock_stateid()
1590 nfs4_put_stid(&stp->st_stid); in release_lock_stateid()
1609 struct nfs4_ol_stateid *stp; in free_ol_stateid_reaplist() local
1615 stp = list_first_entry(reaplist, struct nfs4_ol_stateid, in free_ol_stateid_reaplist()
1617 list_del(&stp->st_locks); in free_ol_stateid_reaplist()
1618 fp = stp->st_stid.sc_file; in free_ol_stateid_reaplist()
1619 stp->st_stid.sc_free(&stp->st_stid); in free_ol_stateid_reaplist()
1628 struct nfs4_ol_stateid *stp; in release_open_stateid_locks() local
1633 stp = list_entry(open_stp->st_locks.next, in release_open_stateid_locks()
1635 unhash_lock_stateid(stp); in release_open_stateid_locks()
1636 put_ol_stateid_locked(stp, reaplist); in release_open_stateid_locks()
1640 static bool unhash_open_stateid(struct nfs4_ol_stateid *stp, in unhash_open_stateid() argument
1643 lockdep_assert_held(&stp->st_stid.sc_client->cl_lock); in unhash_open_stateid()
1645 if (!unhash_ol_stateid(stp)) in unhash_open_stateid()
1647 release_open_stateid_locks(stp, reaplist); in unhash_open_stateid()
1651 static void release_open_stateid(struct nfs4_ol_stateid *stp) in release_open_stateid() argument
1655 spin_lock(&stp->st_stid.sc_client->cl_lock); in release_open_stateid()
1656 stp->st_stid.sc_status |= SC_STATUS_CLOSED; in release_open_stateid()
1657 if (unhash_open_stateid(stp, &reaplist)) in release_open_stateid()
1658 put_ol_stateid_locked(stp, &reaplist); in release_open_stateid()
1659 spin_unlock(&stp->st_stid.sc_client->cl_lock); in release_open_stateid()
1692 struct nfs4_ol_stateid *stp; in release_openowner() local
1699 stp = list_first_entry(&oo->oo_owner.so_stateids, in release_openowner()
1701 if (unhash_open_stateid(stp, &reaplist)) in release_openowner()
1702 put_ol_stateid_locked(stp, &reaplist); in release_openowner()
1760 struct nfs4_ol_stateid *stp; in nfsd4_revoke_states() local
1767 stp = openlockstateid(stid); in nfsd4_revoke_states()
1768 mutex_lock_nested(&stp->st_mutex, in nfsd4_revoke_states()
1777 release_all_access(stp); in nfsd4_revoke_states()
1780 mutex_unlock(&stp->st_mutex); in nfsd4_revoke_states()
1783 stp = openlockstateid(stid); in nfsd4_revoke_states()
1784 mutex_lock_nested(&stp->st_mutex, in nfsd4_revoke_states()
1789 lockowner(stp->st_stateowner); in nfsd4_revoke_states()
1796 nf = find_any_file(stp->st_stid.sc_file); in nfsd4_revoke_states()
1803 release_all_access(stp); in nfsd4_revoke_states()
1806 mutex_unlock(&stp->st_mutex); in nfsd4_revoke_states()
4819 struct nfs4_ol_stateid *stp; in nfsd4_drop_revoked_stid() local
4825 stp = openlockstateid(s); in nfsd4_drop_revoked_stid()
4826 if (unhash_open_stateid(stp, &reaplist)) in nfsd4_drop_revoked_stid()
4827 put_ol_stateid_locked(stp, &reaplist); in nfsd4_drop_revoked_stid()
4832 stp = openlockstateid(s); in nfsd4_drop_revoked_stid()
4833 unhashed = unhash_lock_stateid(stp); in nfsd4_drop_revoked_stid()
4888 nfsd4_lock_ol_stateid(struct nfs4_ol_stateid *stp) in nfsd4_lock_ol_stateid() argument
4892 mutex_lock_nested(&stp->st_mutex, LOCK_STATEID_MUTEX); in nfsd4_lock_ol_stateid()
4893 ret = nfsd4_verify_open_stid(&stp->st_stid); in nfsd4_lock_ol_stateid()
4895 nfsd40_drop_revoked_stid(stp->st_stid.sc_client, in nfsd4_lock_ol_stateid()
4896 &stp->st_stid.sc_stateid); in nfsd4_lock_ol_stateid()
4899 mutex_unlock(&stp->st_mutex); in nfsd4_lock_ol_stateid()
4906 struct nfs4_ol_stateid *stp; in nfsd4_find_and_lock_existing_open() local
4909 stp = nfsd4_find_existing_open(fp, open); in nfsd4_find_and_lock_existing_open()
4911 if (!stp || nfsd4_lock_ol_stateid(stp) == nfs_ok) in nfsd4_find_and_lock_existing_open()
4913 nfs4_put_stid(&stp->st_stid); in nfsd4_find_and_lock_existing_open()
4915 return stp; in nfsd4_find_and_lock_existing_open()
4967 struct nfs4_ol_stateid *stp; in init_open_stateid() local
4969 stp = open->op_stp; in init_open_stateid()
4971 mutex_init(&stp->st_mutex); in init_open_stateid()
4972 mutex_lock_nested(&stp->st_mutex, OPEN_STATEID_MUTEX); in init_open_stateid()
4983 refcount_inc(&stp->st_stid.sc_count); in init_open_stateid()
4984 stp->st_stid.sc_type = SC_TYPE_OPEN; in init_open_stateid()
4985 INIT_LIST_HEAD(&stp->st_locks); in init_open_stateid()
4986 stp->st_stateowner = nfs4_get_stateowner(&oo->oo_owner); in init_open_stateid()
4988 stp->st_stid.sc_file = fp; in init_open_stateid()
4989 stp->st_access_bmap = 0; in init_open_stateid()
4990 stp->st_deny_bmap = 0; in init_open_stateid()
4991 stp->st_openstp = NULL; in init_open_stateid()
4992 list_add(&stp->st_perstateowner, &oo->oo_owner.so_stateids); in init_open_stateid()
4993 list_add(&stp->st_perfile, &fp->fi_stateids); in init_open_stateid()
5005 mutex_unlock(&stp->st_mutex); in init_open_stateid()
5006 stp = retstp; in init_open_stateid()
5008 return stp; in init_open_stateid()
5536 struct svc_fh *cur_fh, struct nfs4_ol_stateid *stp, in nfs4_get_vfs_file() argument
5558 stp, open->op_share_deny, false)) in nfs4_get_vfs_file()
5572 stp, open->op_share_access, true)) in nfs4_get_vfs_file()
5579 old_access_bmap = stp->st_access_bmap; in nfs4_get_vfs_file()
5580 set_access(open->op_share_access, stp); in nfs4_get_vfs_file()
5583 old_deny_bmap = stp->st_deny_bmap; in nfs4_get_vfs_file()
5584 set_deny(open->op_share_deny, stp); in nfs4_get_vfs_file()
5616 stp->st_access_bmap = old_access_bmap; in nfs4_get_vfs_file()
5618 reset_union_bmap_deny(bmap_to_share_mode(old_deny_bmap), stp); in nfs4_get_vfs_file()
5624 struct svc_fh *cur_fh, struct nfs4_ol_stateid *stp, in nfs4_upgrade_open() argument
5628 unsigned char old_deny_bmap = stp->st_deny_bmap; in nfs4_upgrade_open()
5630 if (!test_access(open->op_share_access, stp)) in nfs4_upgrade_open()
5631 return nfs4_get_vfs_file(rqstp, fp, cur_fh, stp, open, false); in nfs4_upgrade_open()
5638 set_deny(open->op_share_deny, stp); in nfs4_upgrade_open()
5644 stp, open->op_share_deny, false)) in nfs4_upgrade_open()
5655 reset_union_bmap_deny(old_deny_bmap, stp); in nfs4_upgrade_open()
5794 nfs4_set_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp, in nfs4_set_delegation() argument
5798 struct nfs4_client *clp = stp->st_stid.sc_client; in nfs4_set_delegation()
5799 struct nfs4_file *fp = stp->st_stid.sc_file; in nfs4_set_delegation()
5800 struct nfs4_clnt_odstate *odstate = stp->st_clnt_odstate; in nfs4_set_delegation()
5992 nfs4_open_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp, in nfs4_open_delegation() argument
5996 struct nfs4_openowner *oo = openowner(stp->st_stateowner); in nfs4_open_delegation()
5997 struct nfs4_client *clp = stp->st_stid.sc_client; in nfs4_open_delegation()
6030 dp = nfs4_set_delegation(open, stp, parent); in nfs4_open_delegation()
6103 struct nfs4_ol_stateid *stp = NULL; in nfsd4_process_open2() local
6120 stp = nfsd4_find_and_lock_existing_open(fp, open); in nfsd4_process_open2()
6128 if (!stp) { in nfsd4_process_open2()
6129 stp = init_open_stateid(fp, open); in nfsd4_process_open2()
6138 * stp is already locked. in nfsd4_process_open2()
6142 status = nfs4_upgrade_open(rqstp, fp, current_fh, stp, open); in nfsd4_process_open2()
6144 mutex_unlock(&stp->st_mutex); in nfsd4_process_open2()
6148 status = nfs4_get_vfs_file(rqstp, fp, current_fh, stp, open, true); in nfsd4_process_open2()
6150 release_open_stateid(stp); in nfsd4_process_open2()
6151 mutex_unlock(&stp->st_mutex); in nfsd4_process_open2()
6155 stp->st_clnt_odstate = find_or_hash_clnt_odstate(fp, in nfsd4_process_open2()
6157 if (stp->st_clnt_odstate == open->op_odstate) in nfsd4_process_open2()
6161 nfs4_inc_and_copy_stateid(&open->op_stateid, &stp->st_stid); in nfsd4_process_open2()
6162 mutex_unlock(&stp->st_mutex); in nfsd4_process_open2()
6176 nfs4_open_delegation(open, stp, &resp->cstate.current_fh); in nfsd4_process_open2()
6179 trace_nfsd_open(&stp->st_stid.sc_stateid); in nfsd4_process_open2()
6201 if (stp) in nfsd4_process_open2()
6202 nfs4_put_stid(&stp->st_stid); in nfsd4_process_open2()
6381 struct nfs4_ol_stateid *stp; in nfs4_lockowner_has_blockers() local
6384 list_for_each_entry(stp, &lo->lo_owner.so_stateids, st_perstateowner) { in nfs4_lockowner_has_blockers()
6385 nf = stp->st_stid.sc_file; in nfs4_lockowner_has_blockers()
6540 struct nfs4_ol_stateid *stp; in nfs4_laundromat() local
6594 stp = oo->oo_last_closed_stid; in nfs4_laundromat()
6597 nfs4_put_stid(&stp->st_stid); in nfs4_laundromat()
6713 static inline __be32 nfs4_check_fh(struct svc_fh *fhp, struct nfs4_stid *stp) in nfs4_check_fh() argument
6715 if (!fh_match(&fhp->fh_handle, &stp->sc_file->fi_fhandle)) in nfs4_check_fh()
6721 __be32 nfs4_check_openmode(struct nfs4_ol_stateid *stp, int flags) in nfs4_check_openmode() argument
6726 if (stp->st_openstp) in nfs4_check_openmode()
6727 stp = stp->st_openstp; in nfs4_check_openmode()
6728 if ((flags & WR_STATE) && !access_permit_write(stp)) in nfs4_check_openmode()
6730 if ((flags & RD_STATE) && !access_permit_read(stp)) in nfs4_check_openmode()
7135 struct nfs4_ol_stateid *stp = openlockstateid(s); in nfsd4_free_lock_stateid() local
7138 ret = nfsd4_lock_ol_stateid(stp); in nfsd4_free_lock_stateid()
7147 if (check_for_locks(stp->st_stid.sc_file, in nfsd4_free_lock_stateid()
7148 lockowner(stp->st_stateowner))) in nfsd4_free_lock_stateid()
7151 release_lock_stateid(stp); in nfsd4_free_lock_stateid()
7155 mutex_unlock(&stp->st_mutex); in nfsd4_free_lock_stateid()
7225 …ks(struct nfsd4_compound_state *cstate, stateid_t *stateid, u32 seqid, struct nfs4_ol_stateid *stp) in nfs4_seqid_op_checks() argument
7228 struct nfs4_stateowner *sop = stp->st_stateowner; in nfs4_seqid_op_checks()
7234 status = nfsd4_lock_ol_stateid(stp); in nfs4_seqid_op_checks()
7237 status = check_stateid_generation(stateid, &stp->st_stid.sc_stateid, nfsd4_has_session(cstate)); in nfs4_seqid_op_checks()
7239 status = nfs4_check_fh(current_fh, &stp->st_stid); in nfs4_seqid_op_checks()
7241 mutex_unlock(&stp->st_mutex); in nfs4_seqid_op_checks()
7268 struct nfs4_ol_stateid *stp = NULL; in nfs4_preprocess_seqid_op() local
7278 stp = openlockstateid(s); in nfs4_preprocess_seqid_op()
7279 if (nfsd4_cstate_assign_replay(cstate, stp->st_stateowner) == -EAGAIN) { in nfs4_preprocess_seqid_op()
7280 nfs4_put_stateowner(stp->st_stateowner); in nfs4_preprocess_seqid_op()
7284 status = nfs4_seqid_op_checks(cstate, stateid, seqid, stp); in nfs4_preprocess_seqid_op()
7286 *stpp = stp; in nfs4_preprocess_seqid_op()
7288 nfs4_put_stid(&stp->st_stid); in nfs4_preprocess_seqid_op()
7297 struct nfs4_ol_stateid *stp; in nfs4_preprocess_confirmed_seqid_op() local
7300 SC_TYPE_OPEN, 0, &stp, nn); in nfs4_preprocess_confirmed_seqid_op()
7303 oo = openowner(stp->st_stateowner); in nfs4_preprocess_confirmed_seqid_op()
7305 mutex_unlock(&stp->st_mutex); in nfs4_preprocess_confirmed_seqid_op()
7306 nfs4_put_stid(&stp->st_stid); in nfs4_preprocess_confirmed_seqid_op()
7309 *stpp = stp; in nfs4_preprocess_confirmed_seqid_op()
7320 struct nfs4_ol_stateid *stp; in nfsd4_open_confirm() local
7332 SC_TYPE_OPEN, 0, &stp, nn); in nfsd4_open_confirm()
7335 oo = openowner(stp->st_stateowner); in nfsd4_open_confirm()
7338 mutex_unlock(&stp->st_mutex); in nfsd4_open_confirm()
7342 nfs4_inc_and_copy_stateid(&oc->oc_resp_stateid, &stp->st_stid); in nfsd4_open_confirm()
7343 mutex_unlock(&stp->st_mutex); in nfsd4_open_confirm()
7344 trace_nfsd_open_confirm(oc->oc_seqid, &stp->st_stid.sc_stateid); in nfsd4_open_confirm()
7348 nfs4_put_stid(&stp->st_stid); in nfsd4_open_confirm()
7354 static inline void nfs4_stateid_downgrade_bit(struct nfs4_ol_stateid *stp, u32 access) in nfs4_stateid_downgrade_bit() argument
7356 if (!test_access(access, stp)) in nfs4_stateid_downgrade_bit()
7358 nfs4_file_put_access(stp->st_stid.sc_file, access); in nfs4_stateid_downgrade_bit()
7359 clear_access(access, stp); in nfs4_stateid_downgrade_bit()
7362 static inline void nfs4_stateid_downgrade(struct nfs4_ol_stateid *stp, u32 to_access) in nfs4_stateid_downgrade() argument
7366 nfs4_stateid_downgrade_bit(stp, NFS4_SHARE_ACCESS_WRITE); in nfs4_stateid_downgrade()
7367 nfs4_stateid_downgrade_bit(stp, NFS4_SHARE_ACCESS_BOTH); in nfs4_stateid_downgrade()
7370 nfs4_stateid_downgrade_bit(stp, NFS4_SHARE_ACCESS_READ); in nfs4_stateid_downgrade()
7371 nfs4_stateid_downgrade_bit(stp, NFS4_SHARE_ACCESS_BOTH); in nfs4_stateid_downgrade()
7386 struct nfs4_ol_stateid *stp; in nfsd4_open_downgrade() local
7398 &od->od_stateid, &stp, nn); in nfsd4_open_downgrade()
7402 if (!test_access(od->od_share_access, stp)) { in nfsd4_open_downgrade()
7404 stp->st_access_bmap, od->od_share_access); in nfsd4_open_downgrade()
7407 if (!test_deny(od->od_share_deny, stp)) { in nfsd4_open_downgrade()
7409 stp->st_deny_bmap, od->od_share_deny); in nfsd4_open_downgrade()
7412 nfs4_stateid_downgrade(stp, od->od_share_access); in nfsd4_open_downgrade()
7413 reset_union_bmap_deny(od->od_share_deny, stp); in nfsd4_open_downgrade()
7414 nfs4_inc_and_copy_stateid(&od->od_stateid, &stp->st_stid); in nfsd4_open_downgrade()
7417 mutex_unlock(&stp->st_mutex); in nfsd4_open_downgrade()
7418 nfs4_put_stid(&stp->st_stid); in nfsd4_open_downgrade()
7429 struct nfs4_ol_stateid *stp; in nfsd4_close_open_stateid() local
7438 list_for_each_entry(stp, &reaplist, st_locks) in nfsd4_close_open_stateid()
7439 nfs4_free_cpntf_statelist(clp->net, &stp->st_stid); in nfsd4_close_open_stateid()
7458 struct nfs4_ol_stateid *stp; in nfsd4_close() local
7469 &stp, nn); in nfsd4_close()
7474 spin_lock(&stp->st_stid.sc_client->cl_lock); in nfsd4_close()
7475 stp->st_stid.sc_status |= SC_STATUS_CLOSED; in nfsd4_close()
7476 spin_unlock(&stp->st_stid.sc_client->cl_lock); in nfsd4_close()
7484 nfs4_inc_and_copy_stateid(&close->cl_stateid, &stp->st_stid); in nfsd4_close()
7486 need_move_to_close_list = nfsd4_close_open_stateid(stp); in nfsd4_close()
7487 mutex_unlock(&stp->st_mutex); in nfsd4_close()
7489 move_to_close_lru(stp, net); in nfsd4_close()
7501 nfs4_put_stid(&stp->st_stid); in nfsd4_close()
7773 init_lock_stateid(struct nfs4_ol_stateid *stp, struct nfs4_lockowner *lo, in init_lock_stateid() argument
7780 mutex_init(&stp->st_mutex); in init_lock_stateid()
7781 mutex_lock_nested(&stp->st_mutex, OPEN_STATEID_MUTEX); in init_lock_stateid()
7789 refcount_inc(&stp->st_stid.sc_count); in init_lock_stateid()
7790 stp->st_stid.sc_type = SC_TYPE_LOCK; in init_lock_stateid()
7791 stp->st_stateowner = nfs4_get_stateowner(&lo->lo_owner); in init_lock_stateid()
7793 stp->st_stid.sc_file = fp; in init_lock_stateid()
7794 stp->st_access_bmap = 0; in init_lock_stateid()
7795 stp->st_deny_bmap = open_stp->st_deny_bmap; in init_lock_stateid()
7796 stp->st_openstp = open_stp; in init_lock_stateid()
7798 list_add(&stp->st_locks, &open_stp->st_locks); in init_lock_stateid()
7799 list_add(&stp->st_perstateowner, &lo->lo_owner.so_stateids); in init_lock_stateid()
7800 list_add(&stp->st_perfile, &fp->fi_stateids); in init_lock_stateid()
7803 return stp; in init_lock_stateid()
7811 mutex_unlock(&stp->st_mutex); in init_lock_stateid()
7815 mutex_unlock(&stp->st_mutex); in init_lock_stateid()
8278 struct nfs4_ol_stateid *stp; in nfsd4_locku() local
8294 &stp, nn); in nfsd4_locku()
8297 nf = find_any_file(stp->st_stid.sc_file); in nfsd4_locku()
8310 file_lock->c.flc_owner = (fl_owner_t)lockowner(nfs4_get_stateowner(stp->st_stateowner)); in nfsd4_locku()
8326 nfs4_inc_and_copy_stateid(&locku->lu_stateid, &stp->st_stid); in nfsd4_locku()
8330 mutex_unlock(&stp->st_mutex); in nfsd4_locku()
8331 nfs4_put_stid(&stp->st_stid); in nfsd4_locku()
8406 struct nfs4_ol_stateid *stp; in nfsd4_release_lockowner() local
8427 list_for_each_entry(stp, &lo->lo_owner.so_stateids, st_perstateowner) { in nfsd4_release_lockowner()
8428 if (check_for_locks(stp->st_stid.sc_file, lo)) { in nfsd4_release_lockowner()
8436 stp = list_first_entry(&lo->lo_owner.so_stateids, in nfsd4_release_lockowner()
8439 unhash_lock_stateid(stp); in nfsd4_release_lockowner()
8440 put_ol_stateid_locked(stp, &reaplist); in nfsd4_release_lockowner()