Lines Matching +full:1 +full:ms
31 Stage 1 (lock, unlock) is mainly about checking input args and
89 const struct dlm_message *ms, bool local);
90 static int receive_extralen(const struct dlm_message *ms);
99 * Usage: matrix[grmode+1][rqmode+1] (although m[rq+1][gr+1] is the same)
104 {1, 1, 1, 1, 1, 1, 1, 0}, /* UN */
105 {1, 1, 1, 1, 1, 1, 1, 0}, /* NL */
106 {1, 1, 1, 1, 1, 1, 0, 0}, /* CR */
107 {1, 1, 1, 1, 0, 0, 0, 0}, /* CW */
108 {1, 1, 1, 0, 1, 0, 0, 0}, /* PR */
109 {1, 1, 1, 0, 0, 0, 0, 0}, /* PW */
110 {1, 1, 0, 0, 0, 0, 0, 0}, /* EX */
117 * Usage: matrix[grmode+1][rqmode+1]
118 * 1 = LVB is returned to the caller
120 * -1 = nothing happens to the LVB
125 { -1, 1, 1, 1, 1, 1, 1, -1 }, /* UN */
126 { -1, 1, 1, 1, 1, 1, 1, 0 }, /* NL */
127 { -1, -1, 1, 1, 1, 1, 1, 0 }, /* CR */
128 { -1, -1, -1, 1, 1, 1, 1, 0 }, /* CW */
129 { -1, -1, -1, -1, 1, 1, 1, 0 }, /* PR */
130 { -1, 0, 0, 0, 0, 0, 1, 0 }, /* PW */
131 { -1, 0, 0, 0, 0, 0, 0, 0 }, /* EX */
132 { -1, 0, 0, 0, 0, 0, 0, 0 } /* PD */
136 __dlm_compat_matrix[(gr)->lkb_grmode + 1][(rq)->lkb_rqmode + 1]
140 return __dlm_compat_matrix[mode1 + 1][mode2 + 1]; in dlm_modes_compat()
146 * Usage: matrix[grmode+1][rqmode+1]
152 {0, 0, 1, 1, 1, 1, 1, 0}, /* NL */
153 {0, 0, 0, 1, 1, 1, 1, 0}, /* CR */
154 {0, 0, 0, 0, 1, 1, 1, 0}, /* CW */
155 {0, 0, 0, 1, 0, 1, 1, 0}, /* PR */
156 {0, 0, 0, 0, 0, 0, 1, 0}, /* PW */
265 return 1; in middle_conversion()
367 return 1; in dlm_kref_put_write_lock_bh()
501 /* if we hit contention we do in 250 ms a retry to trylock.
517 while (1) { in dlm_rsb_scan()
661 * ref count of 1; when found on normal list the ref count is incremented.
708 from_dir = 1; in find_rsb_dir()
710 from_other = 1; in find_rsb_dir()
712 from_local = 1; in find_rsb_dir()
732 create = 1; in find_rsb_dir()
886 r->res_nodeid = -1; in find_rsb_dir()
1129 request; this could happen with master 0 / res_nodeid -1 */ in validate_master_nodeid()
1243 * . dlm_master_lookup RECOVER_DIR (fix_master 0, from_master 1)
1252 * . dlm_master_lookup RECOVER_MASTER (fix_master 1, from_master 0)
1278 *r_nodeid = -1; in _dlm_master_lookup()
1501 lkb->lkb_nodeid = -1; in _create_lkb()
1523 return _create_lkb(ls, lkb_ret, 1, ULONG_MAX); in create_lkb()
1700 return -1; in msg_reply_type()
1764 const struct dlm_message *ms) in _remove_from_waiters() argument
1772 overlap_done = 1; in _remove_from_waiters()
1779 overlap_done = 1; in _remove_from_waiters()
1790 return -1; in _remove_from_waiters()
1802 (lkb->lkb_wait_type == DLM_MSG_CONVERT) && ms && !ms->m_result && in _remove_from_waiters()
1821 lkb->lkb_id, ms ? le32_to_cpu(ms->m_header.h_nodeid) : 0, in _remove_from_waiters()
1823 return -1; in _remove_from_waiters()
1868 const struct dlm_message *ms, bool local) in remove_from_waiters_ms() argument
1878 error = _remove_from_waiters(lkb, le32_to_cpu(ms->m_type), ms); in remove_from_waiters_ms()
1890 /* b=1 lvb returned to caller in set_lvb_lock()
1892 b=-1 do nothing */ in set_lvb_lock()
1894 b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1]; in set_lvb_lock()
1896 if (b == 1) { in set_lvb_lock()
1967 const struct dlm_message *ms) in set_lvb_lock_pc() argument
1977 b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1]; in set_lvb_lock_pc()
1978 if (b == 1) { in set_lvb_lock_pc()
1979 int len = receive_extralen(ms); in set_lvb_lock_pc()
1982 memcpy(lkb->lkb_lvbptr, ms->m_extra, len); in set_lvb_lock_pc()
1983 lkb->lkb_lvbseq = le32_to_cpu(ms->m_lvbseq); in set_lvb_lock_pc()
2018 1 moved lock to granted
2019 -1 removed lock */
2032 rv = 1; in revert_lock()
2040 rv = -1; in revert_lock()
2074 const struct dlm_message *ms) in grant_lock_pc() argument
2076 set_lvb_lock_pc(r, lkb, ms); in grant_lock_pc()
2112 static void munge_altmode(struct dlm_lkb *lkb, const struct dlm_message *ms) in munge_altmode() argument
2114 if (ms->m_type != cpu_to_le32(DLM_MSG_REQUEST_REPLY) && in munge_altmode()
2115 ms->m_type != cpu_to_le32(DLM_MSG_GRANT)) { in munge_altmode()
2117 lkb->lkb_id, le32_to_cpu(ms->m_type)); in munge_altmode()
2136 return 1; in first_in_list()
2151 return 1; in queue_conflict()
2204 lkb_is_ahead = 1; in conversion_deadlock_detect()
2210 return 1; in conversion_deadlock_detect()
2214 return 1; in conversion_deadlock_detect()
2221 * Return 1 if the lock can be granted, 0 otherwise.
2226 * now is 1 if the function is being called in the context of the
2230 * recover is 1 if dlm_recover_grant() is trying to grant conversions
2255 * be 1. The full condition to grant an expedite request: (now && in _can_be_granted()
2261 return 1; in _can_be_granted()
2295 return 1; in _can_be_granted()
2321 return 1; in _can_be_granted()
2330 return 1; in _can_be_granted()
2341 return 1; in _can_be_granted()
2350 return 1; in _can_be_granted()
2365 return 1; in _can_be_granted()
2377 return 1; in _can_be_granted()
2464 grant_restart = 1; in grant_pending_convert()
2473 demote_restart = 1; in grant_pending_convert()
2500 *cw = 1; in grant_pending_convert()
2506 quit = 1; in grant_pending_convert()
2526 *cw = 1; in grant_pending_wait()
2533 /* cw of 1 means there's a lock with a rqmode of DLM_LOCK_CW that's blocked
2542 return 1; in lock_requires_bast()
2547 !__dlm_compat_matrix[gr->lkb_grmode+1][high+1]) in lock_requires_bast()
2548 return 1; in lock_requires_bast()
2593 return 1; in modes_require_bast()
2598 return 1; in modes_require_bast()
2644 1: the rsb master is not available and the lkb has been placed on
2661 return 1; in set_master()
2692 return 1; in set_master()
2843 !__quecvt_compat_matrix[lkb->lkb_grmode+1][args->mode+1]) in validate_lock_args()
2863 WARN_ON(1); in validate_lock_args()
2883 /* note: it's valid for lkb_nodeid/res_nodeid to be -1 when we get here
3008 WARN_ON(1); in validate_unlock_args()
3036 if (can_be_granted(r, lkb, 1, 0, NULL)) { in do_request()
3075 if (can_be_granted(r, lkb, 1, 0, &deadlk)) { in do_convert()
3101 if (_can_be_granted(r, lkb, 1, 0)) { in do_convert()
3364 * Two stage 1 varieties: dlm_lock() and dlm_unlock()
3497 struct dlm_message *ms; in _create_message() local
3509 ms = (struct dlm_message *) mb; in _create_message()
3511 ms->m_header.h_version = cpu_to_le32(DLM_HEADER_MAJOR | DLM_HEADER_MINOR); in _create_message()
3512 ms->m_header.u.h_lockspace = cpu_to_le32(ls->ls_global_id); in _create_message()
3513 ms->m_header.h_nodeid = cpu_to_le32(dlm_our_nodeid()); in _create_message()
3514 ms->m_header.h_length = cpu_to_le16(mb_len); in _create_message()
3515 ms->m_header.h_cmd = DLM_MSG; in _create_message()
3517 ms->m_type = cpu_to_le32(mstype); in _create_message()
3520 *ms_ret = ms; in _create_message()
3554 static int send_message(struct dlm_mhandle *mh, struct dlm_message *ms, in send_message() argument
3562 struct dlm_message *ms) in send_args() argument
3564 ms->m_nodeid = cpu_to_le32(lkb->lkb_nodeid); in send_args()
3565 ms->m_pid = cpu_to_le32(lkb->lkb_ownpid); in send_args()
3566 ms->m_lkid = cpu_to_le32(lkb->lkb_id); in send_args()
3567 ms->m_remid = cpu_to_le32(lkb->lkb_remid); in send_args()
3568 ms->m_exflags = cpu_to_le32(lkb->lkb_exflags); in send_args()
3569 ms->m_sbflags = cpu_to_le32(dlm_sbflags_val(lkb)); in send_args()
3570 ms->m_flags = cpu_to_le32(dlm_dflags_val(lkb)); in send_args()
3571 ms->m_lvbseq = cpu_to_le32(lkb->lkb_lvbseq); in send_args()
3572 ms->m_status = cpu_to_le32(lkb->lkb_status); in send_args()
3573 ms->m_grmode = cpu_to_le32(lkb->lkb_grmode); in send_args()
3574 ms->m_rqmode = cpu_to_le32(lkb->lkb_rqmode); in send_args()
3575 ms->m_hash = cpu_to_le32(r->res_hash); in send_args()
3581 ms->m_asts |= cpu_to_le32(DLM_CB_BAST); in send_args()
3583 ms->m_asts |= cpu_to_le32(DLM_CB_CAST); in send_args()
3588 switch (ms->m_type) { in send_args()
3591 memcpy(ms->m_extra, r->res_name, r->res_length); in send_args()
3600 memcpy(ms->m_extra, lkb->lkb_lvbptr, r->res_ls->ls_lvblen); in send_args()
3607 struct dlm_message *ms; in send_common() local
3617 error = create_message(r, lkb, to_nodeid, mstype, &ms, &mh); in send_common()
3621 send_args(r, lkb, ms); in send_common()
3623 error = send_message(mh, ms, r->res_name, r->res_length); in send_common()
3671 struct dlm_message *ms; in send_grant() local
3677 error = create_message(r, lkb, to_nodeid, DLM_MSG_GRANT, &ms, &mh); in send_grant()
3681 send_args(r, lkb, ms); in send_grant()
3683 ms->m_result = 0; in send_grant()
3685 error = send_message(mh, ms, r->res_name, r->res_length); in send_grant()
3692 struct dlm_message *ms; in send_bast() local
3698 error = create_message(r, NULL, to_nodeid, DLM_MSG_BAST, &ms, &mh); in send_bast()
3702 send_args(r, lkb, ms); in send_bast()
3704 ms->m_bastmode = cpu_to_le32(mode); in send_bast()
3706 error = send_message(mh, ms, r->res_name, r->res_length); in send_bast()
3713 struct dlm_message *ms; in send_lookup() local
3723 error = create_message(r, NULL, to_nodeid, DLM_MSG_LOOKUP, &ms, &mh); in send_lookup()
3727 send_args(r, lkb, ms); in send_lookup()
3729 error = send_message(mh, ms, r->res_name, r->res_length); in send_lookup()
3741 struct dlm_message *ms; in send_remove() local
3747 error = create_message(r, NULL, to_nodeid, DLM_MSG_REMOVE, &ms, &mh); in send_remove()
3751 memcpy(ms->m_extra, r->res_name, r->res_length); in send_remove()
3752 ms->m_hash = cpu_to_le32(r->res_hash); in send_remove()
3754 error = send_message(mh, ms, r->res_name, r->res_length); in send_remove()
3762 struct dlm_message *ms; in send_common_reply() local
3768 error = create_message(r, lkb, to_nodeid, mstype, &ms, &mh); in send_common_reply()
3772 send_args(r, lkb, ms); in send_common_reply()
3774 ms->m_result = cpu_to_le32(to_dlm_errno(rv)); in send_common_reply()
3776 error = send_message(mh, ms, r->res_name, r->res_length); in send_common_reply()
3806 struct dlm_message *ms; in send_lookup_reply() local
3810 error = create_message(r, NULL, nodeid, DLM_MSG_LOOKUP_REPLY, &ms, &mh); in send_lookup_reply()
3814 ms->m_lkid = ms_in->m_lkid; in send_lookup_reply()
3815 ms->m_result = cpu_to_le32(to_dlm_errno(rv)); in send_lookup_reply()
3816 ms->m_nodeid = cpu_to_le32(ret_nodeid); in send_lookup_reply()
3818 error = send_message(mh, ms, ms_in->m_extra, receive_extralen(ms_in)); in send_lookup_reply()
3827 static void receive_flags(struct dlm_lkb *lkb, const struct dlm_message *ms) in receive_flags() argument
3829 lkb->lkb_exflags = le32_to_cpu(ms->m_exflags); in receive_flags()
3830 dlm_set_sbflags_val(lkb, le32_to_cpu(ms->m_sbflags)); in receive_flags()
3831 dlm_set_dflags_val(lkb, le32_to_cpu(ms->m_flags)); in receive_flags()
3835 const struct dlm_message *ms, in receive_flags_reply() argument
3841 dlm_set_sbflags_val(lkb, le32_to_cpu(ms->m_sbflags)); in receive_flags_reply()
3842 dlm_set_dflags_val(lkb, le32_to_cpu(ms->m_flags)); in receive_flags_reply()
3845 static int receive_extralen(const struct dlm_message *ms) in receive_extralen() argument
3847 return (le16_to_cpu(ms->m_header.h_length) - in receive_extralen()
3852 const struct dlm_message *ms) in receive_lvb() argument
3861 len = receive_extralen(ms); in receive_lvb()
3864 memcpy(lkb->lkb_lvbptr, ms->m_extra, len); in receive_lvb()
3880 const struct dlm_message *ms) in receive_request_args() argument
3882 lkb->lkb_nodeid = le32_to_cpu(ms->m_header.h_nodeid); in receive_request_args()
3883 lkb->lkb_ownpid = le32_to_cpu(ms->m_pid); in receive_request_args()
3884 lkb->lkb_remid = le32_to_cpu(ms->m_lkid); in receive_request_args()
3886 lkb->lkb_rqmode = le32_to_cpu(ms->m_rqmode); in receive_request_args()
3888 lkb->lkb_bastfn = (ms->m_asts & cpu_to_le32(DLM_CB_BAST)) ? &fake_bastfn : NULL; in receive_request_args()
3889 lkb->lkb_astfn = (ms->m_asts & cpu_to_le32(DLM_CB_CAST)) ? &fake_astfn : NULL; in receive_request_args()
3902 const struct dlm_message *ms) in receive_convert_args() argument
3907 if (receive_lvb(ls, lkb, ms)) in receive_convert_args()
3910 lkb->lkb_rqmode = le32_to_cpu(ms->m_rqmode); in receive_convert_args()
3911 lkb->lkb_lvbseq = le32_to_cpu(ms->m_lvbseq); in receive_convert_args()
3917 const struct dlm_message *ms) in receive_unlock_args() argument
3919 if (receive_lvb(ls, lkb, ms)) in receive_unlock_args()
3927 static void setup_local_lkb(struct dlm_ls *ls, const struct dlm_message *ms) in setup_local_lkb() argument
3930 lkb->lkb_nodeid = le32_to_cpu(ms->m_header.h_nodeid); in setup_local_lkb()
3931 lkb->lkb_remid = le32_to_cpu(ms->m_lkid); in setup_local_lkb()
3937 static int validate_message(struct dlm_lkb *lkb, const struct dlm_message *ms) in validate_message() argument
3939 int from = le32_to_cpu(ms->m_header.h_nodeid); in validate_message()
3943 if (ms->m_flags & cpu_to_le32(BIT(DLM_DFL_USER_BIT)) && in validate_message()
3951 switch (ms->m_type) { in validate_message()
3971 else if (lkb->lkb_nodeid != -1 && lkb->lkb_nodeid != from) in validate_message()
3983 le32_to_cpu(ms->m_type), from, lkb->lkb_id, in validate_message()
3989 static int receive_request(struct dlm_ls *ls, const struct dlm_message *ms) in receive_request() argument
3996 from_nodeid = le32_to_cpu(ms->m_header.h_nodeid); in receive_request()
4002 receive_flags(lkb, ms); in receive_request()
4004 error = receive_request_args(ls, lkb, ms); in receive_request()
4016 namelen = receive_extralen(ms); in receive_request()
4018 error = find_rsb(ls, ms->m_extra, namelen, from_nodeid, in receive_request()
4060 le32_to_cpu(ms->m_lkid), from_nodeid, error); in receive_request()
4063 setup_local_lkb(ls, ms); in receive_request()
4068 static int receive_convert(struct dlm_ls *ls, const struct dlm_message *ms) in receive_convert() argument
4072 int error, reply = 1; in receive_convert()
4074 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_convert()
4078 if (lkb->lkb_remid != le32_to_cpu(ms->m_lkid)) { in receive_convert()
4082 le32_to_cpu(ms->m_header.h_nodeid), in receive_convert()
4083 le32_to_cpu(ms->m_lkid)); in receive_convert()
4094 error = validate_message(lkb, ms); in receive_convert()
4098 receive_flags(lkb, ms); in receive_convert()
4100 error = receive_convert_args(ls, lkb, ms); in receive_convert()
4119 setup_local_lkb(ls, ms); in receive_convert()
4124 static int receive_unlock(struct dlm_ls *ls, const struct dlm_message *ms) in receive_unlock() argument
4130 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_unlock()
4134 if (lkb->lkb_remid != le32_to_cpu(ms->m_lkid)) { in receive_unlock()
4137 le32_to_cpu(ms->m_header.h_nodeid), in receive_unlock()
4138 le32_to_cpu(ms->m_lkid)); in receive_unlock()
4149 error = validate_message(lkb, ms); in receive_unlock()
4153 receive_flags(lkb, ms); in receive_unlock()
4155 error = receive_unlock_args(ls, lkb, ms); in receive_unlock()
4171 setup_local_lkb(ls, ms); in receive_unlock()
4176 static int receive_cancel(struct dlm_ls *ls, const struct dlm_message *ms) in receive_cancel() argument
4182 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_cancel()
4186 receive_flags(lkb, ms); in receive_cancel()
4193 error = validate_message(lkb, ms); in receive_cancel()
4207 setup_local_lkb(ls, ms); in receive_cancel()
4212 static int receive_grant(struct dlm_ls *ls, const struct dlm_message *ms) in receive_grant() argument
4218 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_grant()
4227 error = validate_message(lkb, ms); in receive_grant()
4231 receive_flags_reply(lkb, ms, false); in receive_grant()
4233 munge_altmode(lkb, ms); in receive_grant()
4234 grant_lock_pc(r, lkb, ms); in receive_grant()
4243 static int receive_bast(struct dlm_ls *ls, const struct dlm_message *ms) in receive_bast() argument
4249 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_bast()
4258 error = validate_message(lkb, ms); in receive_bast()
4262 queue_bast(r, lkb, le32_to_cpu(ms->m_bastmode)); in receive_bast()
4263 lkb->lkb_highbast = le32_to_cpu(ms->m_bastmode); in receive_bast()
4271 static void receive_lookup(struct dlm_ls *ls, const struct dlm_message *ms) in receive_lookup() argument
4275 from_nodeid = le32_to_cpu(ms->m_header.h_nodeid); in receive_lookup()
4278 len = receive_extralen(ms); in receive_lookup()
4280 error = dlm_master_lookup(ls, from_nodeid, ms->m_extra, len, 0, in receive_lookup()
4285 receive_request(ls, ms); in receive_lookup()
4288 send_lookup_reply(ls, ms, ret_nodeid, error); in receive_lookup()
4291 static void receive_remove(struct dlm_ls *ls, const struct dlm_message *ms) in receive_remove() argument
4293 char name[DLM_RESNAME_MAXLEN+1]; in receive_remove()
4297 from_nodeid = le32_to_cpu(ms->m_header.h_nodeid); in receive_remove()
4299 len = receive_extralen(ms); in receive_remove()
4307 dir_nodeid = dlm_hash2nodeid(ls, le32_to_cpu(ms->m_hash)); in receive_remove()
4326 memcpy(name, ms->m_extra, len); in receive_remove()
4386 static void receive_purge(struct dlm_ls *ls, const struct dlm_message *ms) in receive_purge() argument
4388 do_purge(ls, le32_to_cpu(ms->m_nodeid), le32_to_cpu(ms->m_pid)); in receive_purge()
4392 const struct dlm_message *ms) in receive_request_reply() argument
4397 int from_nodeid = le32_to_cpu(ms->m_header.h_nodeid); in receive_request_reply()
4399 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_request_reply()
4407 error = validate_message(lkb, ms); in receive_request_reply()
4415 lkb->lkb_id, from_nodeid, le32_to_cpu(ms->m_lkid), in receive_request_reply()
4416 from_dlm_errno(le32_to_cpu(ms->m_result))); in receive_request_reply()
4430 result = from_dlm_errno(le32_to_cpu(ms->m_result)); in receive_request_reply()
4443 receive_flags_reply(lkb, ms, false); in receive_request_reply()
4444 lkb->lkb_remid = le32_to_cpu(ms->m_lkid); in receive_request_reply()
4446 munge_altmode(lkb, ms); in receive_request_reply()
4450 grant_lock_pc(r, lkb, ms); in receive_request_reply()
4468 r->res_nodeid = -1; in receive_request_reply()
4469 lkb->lkb_nodeid = -1; in receive_request_reply()
4514 const struct dlm_message *ms, bool local) in __receive_convert_reply() argument
4517 switch (from_dlm_errno(le32_to_cpu(ms->m_result))) { in __receive_convert_reply()
4524 receive_flags_reply(lkb, ms, local); in __receive_convert_reply()
4531 receive_flags_reply(lkb, ms, local); in __receive_convert_reply()
4540 receive_flags_reply(lkb, ms, local); in __receive_convert_reply()
4543 grant_lock_pc(r, lkb, ms); in __receive_convert_reply()
4549 lkb->lkb_id, le32_to_cpu(ms->m_header.h_nodeid), in __receive_convert_reply()
4550 le32_to_cpu(ms->m_lkid), in __receive_convert_reply()
4551 from_dlm_errno(le32_to_cpu(ms->m_result))); in __receive_convert_reply()
4558 const struct dlm_message *ms, bool local) in _receive_convert_reply() argument
4566 error = validate_message(lkb, ms); in _receive_convert_reply()
4570 error = remove_from_waiters_ms(lkb, ms, local); in _receive_convert_reply()
4574 __receive_convert_reply(r, lkb, ms, local); in _receive_convert_reply()
4581 const struct dlm_message *ms) in receive_convert_reply() argument
4586 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_convert_reply()
4590 _receive_convert_reply(lkb, ms, false); in receive_convert_reply()
4596 const struct dlm_message *ms, bool local) in _receive_unlock_reply() argument
4604 error = validate_message(lkb, ms); in _receive_unlock_reply()
4608 error = remove_from_waiters_ms(lkb, ms, local); in _receive_unlock_reply()
4614 switch (from_dlm_errno(le32_to_cpu(ms->m_result))) { in _receive_unlock_reply()
4616 receive_flags_reply(lkb, ms, local); in _receive_unlock_reply()
4624 lkb->lkb_id, from_dlm_errno(le32_to_cpu(ms->m_result))); in _receive_unlock_reply()
4632 const struct dlm_message *ms) in receive_unlock_reply() argument
4637 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_unlock_reply()
4641 _receive_unlock_reply(lkb, ms, false); in receive_unlock_reply()
4647 const struct dlm_message *ms, bool local) in _receive_cancel_reply() argument
4655 error = validate_message(lkb, ms); in _receive_cancel_reply()
4659 error = remove_from_waiters_ms(lkb, ms, local); in _receive_cancel_reply()
4665 switch (from_dlm_errno(le32_to_cpu(ms->m_result))) { in _receive_cancel_reply()
4667 receive_flags_reply(lkb, ms, local); in _receive_cancel_reply()
4676 from_dlm_errno(le32_to_cpu(ms->m_result))); in _receive_cancel_reply()
4684 const struct dlm_message *ms) in receive_cancel_reply() argument
4689 error = find_lkb(ls, le32_to_cpu(ms->m_remid), &lkb); in receive_cancel_reply()
4693 _receive_cancel_reply(lkb, ms, false); in receive_cancel_reply()
4699 const struct dlm_message *ms) in receive_lookup_reply() argument
4706 error = find_lkb(ls, le32_to_cpu(ms->m_lkid), &lkb); in receive_lookup_reply()
4709 le32_to_cpu(ms->m_lkid)); in receive_lookup_reply()
4713 /* ms->m_result is the value returned by dlm_master_lookup on dir node in receive_lookup_reply()
4724 ret_nodeid = le32_to_cpu(ms->m_nodeid); in receive_lookup_reply()
4736 lkb->lkb_id, le32_to_cpu(ms->m_header.h_nodeid), in receive_lookup_reply()
4744 do_lookup_list = 1; in receive_lookup_reply()
4746 } else if (ret_nodeid == -1) { in receive_lookup_reply()
4749 lkb->lkb_id, le32_to_cpu(ms->m_header.h_nodeid)); in receive_lookup_reply()
4751 r->res_nodeid = -1; in receive_lookup_reply()
4752 lkb->lkb_nodeid = -1; in receive_lookup_reply()
4778 static void _receive_message(struct dlm_ls *ls, const struct dlm_message *ms, in _receive_message() argument
4783 if (WARN_ON_ONCE(!dlm_is_member(ls, le32_to_cpu(ms->m_header.h_nodeid)))) { in _receive_message()
4785 le32_to_cpu(ms->m_type), in _receive_message()
4786 le32_to_cpu(ms->m_header.h_nodeid), in _receive_message()
4787 le32_to_cpu(ms->m_lkid), le32_to_cpu(ms->m_remid), in _receive_message()
4788 from_dlm_errno(le32_to_cpu(ms->m_result))); in _receive_message()
4792 switch (ms->m_type) { in _receive_message()
4797 error = receive_request(ls, ms); in _receive_message()
4801 error = receive_convert(ls, ms); in _receive_message()
4805 error = receive_unlock(ls, ms); in _receive_message()
4809 noent = 1; in _receive_message()
4810 error = receive_cancel(ls, ms); in _receive_message()
4816 error = receive_request_reply(ls, ms); in _receive_message()
4820 error = receive_convert_reply(ls, ms); in _receive_message()
4824 error = receive_unlock_reply(ls, ms); in _receive_message()
4828 error = receive_cancel_reply(ls, ms); in _receive_message()
4834 noent = 1; in _receive_message()
4835 error = receive_grant(ls, ms); in _receive_message()
4839 noent = 1; in _receive_message()
4840 error = receive_bast(ls, ms); in _receive_message()
4846 receive_lookup(ls, ms); in _receive_message()
4850 receive_remove(ls, ms); in _receive_message()
4856 receive_lookup_reply(ls, ms); in _receive_message()
4862 receive_purge(ls, ms); in _receive_message()
4867 le32_to_cpu(ms->m_type)); in _receive_message()
4883 le32_to_cpu(ms->m_type), le32_to_cpu(ms->m_remid), in _receive_message()
4884 le32_to_cpu(ms->m_header.h_nodeid), in _receive_message()
4885 le32_to_cpu(ms->m_lkid), saved_seq); in _receive_message()
4888 le32_to_cpu(ms->m_type), le32_to_cpu(ms->m_remid), in _receive_message()
4889 le32_to_cpu(ms->m_header.h_nodeid), in _receive_message()
4890 le32_to_cpu(ms->m_lkid), saved_seq); in _receive_message()
4892 if (ms->m_type == cpu_to_le32(DLM_MSG_CONVERT)) in _receive_message()
4893 dlm_dump_rsb_hash(ls, le32_to_cpu(ms->m_hash)); in _receive_message()
4899 le32_to_cpu(ms->m_type), in _receive_message()
4900 le32_to_cpu(ms->m_header.h_nodeid), in _receive_message()
4901 le32_to_cpu(ms->m_lkid), le32_to_cpu(ms->m_remid), in _receive_message()
4914 static void dlm_receive_message(struct dlm_ls *ls, const struct dlm_message *ms, in dlm_receive_message() argument
4926 le32_to_cpu(ms->m_type), nodeid); in dlm_receive_message()
4938 dlm_add_requestqueue(ls, nodeid, ms); in dlm_receive_message()
4941 _receive_message(ls, ms, 0); in dlm_receive_message()
4949 void dlm_receive_message_saved(struct dlm_ls *ls, const struct dlm_message *ms, in dlm_receive_message_saved() argument
4952 _receive_message(ls, ms, saved_seq); in dlm_receive_message_saved()
5046 return 1; in waiter_needs_recovery()
5049 return 1; in waiter_needs_recovery()
5195 * . lkb ref count decremented for each waiters_count (almost always 1,
5216 while (1) { in dlm_recover_waiters_post()
5267 * wait_count will almost always be 1, but in case of an in dlm_recover_waiters_post()
5306 err = 1; in dlm_recover_waiters_post()
5313 if (r->res_nodeid != -1 && is_master(r)) in dlm_recover_waiters_post()
5320 err = 1; in dlm_recover_waiters_post()
5426 if (r->res_nodeid != -1 && is_master(r)) { in dlm_recover_purge()
5488 while (1) { in dlm_recover_grant()
5892 found_other_mode = 1; in dlm_user_adopt_orphan()
6151 1) references lkb->ua which we free here and 2) adds lkbs to proc->asts,
6167 while (1) { in dlm_clear_proc_locks()
6206 while (1) { in purge_proc_locks()
6259 struct dlm_message *ms; in send_purge() local
6264 DLM_MSG_PURGE, &ms, &mh); in send_purge()
6267 ms->m_nodeid = cpu_to_le32(nodeid); in send_purge()
6268 ms->m_pid = cpu_to_le32(pid); in send_purge()
6270 return send_message(mh, ms, NULL, 0); in send_purge()
6308 error = _create_lkb(ls, &lkb, lkb_id, lkb_id + 1); in dlm_debug_add_lkb()