Lines Matching refs:lsp

878 	struct nfs4_lock_state *lsp;  in nfs4_alloc_lock_state()  local
881 lsp = kzalloc(sizeof(*lsp), GFP_NOFS); in nfs4_alloc_lock_state()
882 if (lsp == NULL) in nfs4_alloc_lock_state()
884 nfs4_init_seqid_counter(&lsp->ls_seqid); in nfs4_alloc_lock_state()
885 refcount_set(&lsp->ls_count, 1); in nfs4_alloc_lock_state()
886 lsp->ls_state = state; in nfs4_alloc_lock_state()
887 lsp->ls_owner = fl_owner; in nfs4_alloc_lock_state()
888 lsp->ls_seqid.owner_id = ida_simple_get(&server->lockowner_id, 0, 0, GFP_NOFS); in nfs4_alloc_lock_state()
889 if (lsp->ls_seqid.owner_id < 0) in nfs4_alloc_lock_state()
891 INIT_LIST_HEAD(&lsp->ls_locks); in nfs4_alloc_lock_state()
892 return lsp; in nfs4_alloc_lock_state()
894 kfree(lsp); in nfs4_alloc_lock_state()
898 void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp) in nfs4_free_lock_state() argument
900 ida_simple_remove(&server->lockowner_id, lsp->ls_seqid.owner_id); in nfs4_free_lock_state()
901 nfs4_destroy_seqid_counter(&lsp->ls_seqid); in nfs4_free_lock_state()
902 kfree(lsp); in nfs4_free_lock_state()
912 struct nfs4_lock_state *lsp, *new = NULL; in nfs4_get_lock_state() local
916 lsp = __nfs4_find_lock_state(state, owner, NULL); in nfs4_get_lock_state()
917 if (lsp != NULL) in nfs4_get_lock_state()
922 lsp = new; in nfs4_get_lock_state()
934 return lsp; in nfs4_get_lock_state()
941 void nfs4_put_lock_state(struct nfs4_lock_state *lsp) in nfs4_put_lock_state() argument
946 if (lsp == NULL) in nfs4_put_lock_state()
948 state = lsp->ls_state; in nfs4_put_lock_state()
949 if (!refcount_dec_and_lock(&lsp->ls_count, &state->state_lock)) in nfs4_put_lock_state()
951 list_del(&lsp->ls_locks); in nfs4_put_lock_state()
956 if (test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags)) { in nfs4_put_lock_state()
959 clp->cl_mvops->free_lock_state(server, lsp); in nfs4_put_lock_state()
961 nfs4_free_lock_state(server, lsp); in nfs4_put_lock_state()
966 struct nfs4_lock_state *lsp = src->fl_u.nfs4_fl.owner; in nfs4_fl_copy_lock() local
968 dst->fl_u.nfs4_fl.owner = lsp; in nfs4_fl_copy_lock()
969 refcount_inc(&lsp->ls_count); in nfs4_fl_copy_lock()
984 struct nfs4_lock_state *lsp; in nfs4_set_lock_state() local
988 lsp = nfs4_get_lock_state(state, fl->fl_owner); in nfs4_set_lock_state()
989 if (lsp == NULL) in nfs4_set_lock_state()
991 fl->fl_u.nfs4_fl.owner = lsp; in nfs4_set_lock_state()
1000 struct nfs4_lock_state *lsp; in nfs4_copy_lock_stateid() local
1014 lsp = __nfs4_find_lock_state(state, fl_owner, fl_flock_owner); in nfs4_copy_lock_stateid()
1015 if (lsp && test_bit(NFS_LOCK_LOST, &lsp->ls_flags)) in nfs4_copy_lock_stateid()
1017 else if (lsp != NULL && test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags) != 0) { in nfs4_copy_lock_stateid()
1018 nfs4_stateid_copy(dst, &lsp->ls_stateid); in nfs4_copy_lock_stateid()
1022 nfs4_put_lock_state(lsp); in nfs4_copy_lock_stateid()
1520 struct nfs4_lock_state *lsp; in nfs4_reclaim_locks() local
1562 lsp = fl->fl_u.nfs4_fl.owner; in nfs4_reclaim_locks()
1563 if (lsp) in nfs4_reclaim_locks()
1564 set_bit(NFS_LOCK_LOST, &lsp->ls_flags); in nfs4_reclaim_locks()