Lines Matching refs:lsp
874 struct nfs4_lock_state *lsp; in nfs4_alloc_lock_state() local
877 lsp = kzalloc(sizeof(*lsp), GFP_NOFS); in nfs4_alloc_lock_state()
878 if (lsp == NULL) in nfs4_alloc_lock_state()
880 nfs4_init_seqid_counter(&lsp->ls_seqid); in nfs4_alloc_lock_state()
881 refcount_set(&lsp->ls_count, 1); in nfs4_alloc_lock_state()
882 lsp->ls_state = state; in nfs4_alloc_lock_state()
883 lsp->ls_owner = fl_owner; in nfs4_alloc_lock_state()
884 lsp->ls_seqid.owner_id = ida_simple_get(&server->lockowner_id, 0, 0, GFP_NOFS); in nfs4_alloc_lock_state()
885 if (lsp->ls_seqid.owner_id < 0) in nfs4_alloc_lock_state()
887 INIT_LIST_HEAD(&lsp->ls_locks); in nfs4_alloc_lock_state()
888 return lsp; in nfs4_alloc_lock_state()
890 kfree(lsp); in nfs4_alloc_lock_state()
894 void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp) in nfs4_free_lock_state() argument
896 ida_simple_remove(&server->lockowner_id, lsp->ls_seqid.owner_id); in nfs4_free_lock_state()
897 nfs4_destroy_seqid_counter(&lsp->ls_seqid); in nfs4_free_lock_state()
898 kfree(lsp); in nfs4_free_lock_state()
908 struct nfs4_lock_state *lsp, *new = NULL; in nfs4_get_lock_state() local
912 lsp = __nfs4_find_lock_state(state, owner, NULL); in nfs4_get_lock_state()
913 if (lsp != NULL) in nfs4_get_lock_state()
918 lsp = new; in nfs4_get_lock_state()
930 return lsp; in nfs4_get_lock_state()
937 void nfs4_put_lock_state(struct nfs4_lock_state *lsp) in nfs4_put_lock_state() argument
942 if (lsp == NULL) in nfs4_put_lock_state()
944 state = lsp->ls_state; in nfs4_put_lock_state()
945 if (!refcount_dec_and_lock(&lsp->ls_count, &state->state_lock)) in nfs4_put_lock_state()
947 list_del(&lsp->ls_locks); in nfs4_put_lock_state()
952 if (test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags)) { in nfs4_put_lock_state()
955 clp->cl_mvops->free_lock_state(server, lsp); in nfs4_put_lock_state()
957 nfs4_free_lock_state(server, lsp); in nfs4_put_lock_state()
962 struct nfs4_lock_state *lsp = src->fl_u.nfs4_fl.owner; in nfs4_fl_copy_lock() local
964 dst->fl_u.nfs4_fl.owner = lsp; in nfs4_fl_copy_lock()
965 refcount_inc(&lsp->ls_count); in nfs4_fl_copy_lock()
980 struct nfs4_lock_state *lsp; in nfs4_set_lock_state() local
984 lsp = nfs4_get_lock_state(state, fl->fl_owner); in nfs4_set_lock_state()
985 if (lsp == NULL) in nfs4_set_lock_state()
987 fl->fl_u.nfs4_fl.owner = lsp; in nfs4_set_lock_state()
996 struct nfs4_lock_state *lsp; in nfs4_copy_lock_stateid() local
1010 lsp = __nfs4_find_lock_state(state, fl_owner, fl_flock_owner); in nfs4_copy_lock_stateid()
1011 if (lsp && test_bit(NFS_LOCK_LOST, &lsp->ls_flags)) in nfs4_copy_lock_stateid()
1013 else if (lsp != NULL && test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags) != 0) { in nfs4_copy_lock_stateid()
1014 nfs4_stateid_copy(dst, &lsp->ls_stateid); in nfs4_copy_lock_stateid()
1018 nfs4_put_lock_state(lsp); in nfs4_copy_lock_stateid()
1517 struct nfs4_lock_state *lsp; in nfs4_reclaim_locks() local
1560 lsp = fl->fl_u.nfs4_fl.owner; in nfs4_reclaim_locks()
1561 if (lsp) in nfs4_reclaim_locks()
1562 set_bit(NFS_LOCK_LOST, &lsp->ls_flags); in nfs4_reclaim_locks()