Lines Matching +full:0 +full:ms

89 				    const struct dlm_message *ms, bool local);
90 static int receive_extralen(const struct dlm_message *ms);
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 */
111 {0, 0, 0, 0, 0, 0, 0, 0} /* PD */
119 * 0 = LVB is written to the resource
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 */
151 {0, 0, 0, 0, 0, 0, 0, 0}, /* UN */
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 */
157 {0, 0, 0, 0, 0, 0, 0, 0}, /* EX */
158 {0, 0, 0, 0, 0, 0, 0, 0} /* PD */
246 DLM_ASSERT(r->res_nodeid >= 0, dlm_print_rsb(r);); in is_remote()
266 return 0; in middle_conversion()
315 dlm_add_cb(lkb, DLM_CB_BAST, rqmode, 0, 0); in queue_bast()
370 return 0; in dlm_kref_put_write_lock_bh()
427 r->res_toss_time = 0; in del_scan()
501 /* if we hit contention we do in 250 ms a retry to trylock.
622 return 0; in get_rsb_struct()
633 return 0; in dlm_search_rsb_tree()
700 int from_local = 0; in find_rsb_dir()
701 int from_other = 0; in find_rsb_dir()
702 int from_dir = 0; in find_rsb_dir()
703 int create = 0; in find_rsb_dir()
815 r->res_nodeid = 0; in find_rsb_dir()
817 r->res_first_lkid = 0; in find_rsb_dir()
824 r->res_first_lkid = 0; in find_rsb_dir()
859 r->res_nodeid = 0; in find_rsb_dir()
882 r->res_nodeid = 0; in find_rsb_dir()
885 r->res_master_nodeid = 0; in find_rsb_dir()
989 r->res_nodeid = 0; in find_rsb_nodir()
1013 r->res_nodeid = (dir_nodeid == our_nodeid) ? 0 : dir_nodeid; in find_rsb_nodir()
1087 hash = jhash(name, len, 0); in find_rsb()
1129 request; this could happen with master 0 / res_nodeid -1 */ in validate_master_nodeid()
1139 r->res_nodeid = 0; in validate_master_nodeid()
1140 return 0; in validate_master_nodeid()
1202 log_debug(ls, "%s master 0 to %d first %x %s", __func__, in __dlm_master_lookup()
1237 * . dlm_master_lookup flags 0
1243 * . dlm_master_lookup RECOVER_DIR (fix_master 0, from_master 1)
1252 * . dlm_master_lookup RECOVER_MASTER (fix_master 1, from_master 0)
1272 hash = jhash(name, len, 0); in _dlm_master_lookup()
1314 return 0; in _dlm_master_lookup()
1346 return 0; in _dlm_master_lookup()
1511 if (rv < 0) { in _create_lkb()
1518 return 0; in _create_lkb()
1547 return lkb ? 0 : -ENOENT; in find_lkb()
1669 DLM_ASSERT(0, dlm_print_lkb(lkb); printk("sts=%d\n", status);); in add_lkb()
1675 lkb->lkb_status = 0; in del_lkb()
1709 int error = 0; in add_to_waiters()
1764 const struct dlm_message *ms) in _remove_from_waiters() argument
1767 int overlap_done = 0; in _remove_from_waiters()
1796 in the cancel reply should be 0). We preempt the cancel reply in _remove_from_waiters()
1802 (lkb->lkb_wait_type == DLM_MSG_CONVERT) && ms && !ms->m_result && in _remove_from_waiters()
1806 lkb->lkb_wait_type = 0; in _remove_from_waiters()
1816 lkb->lkb_wait_type = 0; in _remove_from_waiters()
1821 lkb->lkb_id, ms ? le32_to_cpu(ms->m_header.h_nodeid) : 0, in _remove_from_waiters()
1836 lkb->lkb_wait_type = 0; in _remove_from_waiters()
1846 return 0; 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()
1891 b=0 lvb written to rsb or invalidated in set_lvb_lock()
1909 } else if (b == 0) { in set_lvb_lock()
1967 const struct dlm_message *ms) in set_lvb_lock_pc() argument
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()
2017 /* returns: 0 did nothing
2023 int rv = 0; in revert_lock()
2064 lkb->lkb_highbast = 0; in _grant_lock()
2074 const struct dlm_message *ms) in grant_lock_pc() argument
2076 set_lvb_lock_pc(r, lkb, ms); in grant_lock_pc()
2090 queue_cast(r, lkb, 0); in grant_lock_pending()
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()
2138 return 0; in first_in_list()
2153 return 0; in queue_conflict()
2200 int lkb_is_ahead = 0; in conversion_deadlock_detect()
2217 return 0; in conversion_deadlock_detect()
2221 * Return 1 if the lock can be granted, 0 otherwise.
2227 * immediate request, it is 0 if called later, after the lock has been
2269 return 0; in _can_be_granted()
2278 return 0; in _can_be_granted()
2332 return 0; in _can_be_granted()
2379 return 0; in _can_be_granted()
2386 int8_t alt = 0, rqmode = lkb->lkb_rqmode; in can_be_granted()
2390 *err = 0; in can_be_granted()
2431 rv = _can_be_granted(r, lkb, now, 0); in can_be_granted()
2452 quit = 0; in grant_pending_convert()
2454 grant_restart = 0; in grant_pending_convert()
2455 demote_restart = 0; in grant_pending_convert()
2460 deadlk = 0; in grant_pending_convert()
2462 if (can_be_granted(r, lkb, 0, recover, &deadlk)) { in grant_pending_convert()
2519 if (can_be_granted(r, lkb, 0, 0, NULL)) { in grant_pending_wait()
2543 return 0; in lock_requires_bast()
2549 return 0; in lock_requires_bast()
2556 int cw = 0; in grant_pending_locks()
2594 return 0; in modes_require_bast()
2599 return 0; in modes_require_bast()
2634 0. If the rsb's nodeid is _not_ known, it needs to be looked up
2643 0: nodeid is set in rsb/lkb and the caller should go ahead and use it
2656 return 0; in set_master()
2665 lkb->lkb_nodeid = 0; in set_master()
2666 return 0; in set_master()
2671 return 0; in set_master()
2685 r->res_nodeid = 0; in set_master()
2686 lkb->lkb_nodeid = 0; in set_master()
2687 return 0; in set_master()
2715 case 0: in confirm_master()
2717 r->res_first_lkid = 0; in confirm_master()
2728 r->res_first_lkid = 0; in confirm_master()
2754 if (mode < 0 || mode > DLM_LOCK_EX) in set_lock_args()
2803 rv = 0; in set_lock_args()
2819 return 0; in set_unlock_args()
2848 dlm_set_sbflags_val(lkb, 0); in validate_lock_args()
2856 rv = 0; in validate_lock_args()
2859 case 0: in validate_lock_args()
2880 /* when dlm_unlock() sees -EBUSY with CANCEL/FORCEUNLOCK it returns 0
2909 /* caller changes -EBUSY to 0 for CANCEL and FORCEUNLOCK */ in validate_unlock_args()
2999 dlm_set_sbflags_val(lkb, 0); in validate_unlock_args()
3001 rv = 0; in validate_unlock_args()
3004 case 0: in validate_unlock_args()
3034 int error = 0; in do_request()
3036 if (can_be_granted(r, lkb, 1, 0, NULL)) { in do_request()
3038 queue_cast(r, lkb, 0); in do_request()
3070 int error = 0; in do_convert()
3071 int deadlk = 0; in do_convert()
3075 if (can_be_granted(r, lkb, 1, 0, &deadlk)) { in do_convert()
3077 queue_cast(r, lkb, 0); in do_convert()
3101 if (_can_be_granted(r, lkb, 1, 0)) { in do_convert()
3103 queue_cast(r, lkb, 0); in do_convert()
3126 case 0: in do_convert_effects()
3153 /* returns: 0 did nothing, -DLM_ECANCEL canceled lock */
3164 return 0; in do_cancel()
3188 if (error < 0) in _request_lock()
3191 error = 0; in _request_lock()
3281 error = find_rsb(ls, name, len, 0, R_REQUEST, &r); in request_lock()
3410 error = 0; in dlm_lock()
3417 error = 0; in dlm_lock()
3457 error = 0; in dlm_unlock()
3459 error = 0; in 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()
3521 return 0; in _create_message()
3554 static int send_message(struct dlm_mhandle *mh, struct dlm_message *ms, in send_message() argument
3558 return 0; in send_message()
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()
3626 return 0; in send_common()
3648 r->res_ls->ls_local_ms.m_result = 0; in send_convert()
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()
3732 return 0; 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()
3866 return 0; 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()
3898 return 0; 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()
3913 return 0; 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()
3921 return 0; 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()
3940 int error = 0; 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()
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
3994 int error, namelen = 0; in receive_request()
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()
4046 error = 0; in receive_request()
4049 return 0; 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
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()
4116 return 0; 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()
4168 return 0; 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()
4204 return 0; 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()
4235 queue_cast(r, lkb, 0); in receive_grant()
4240 return 0; 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()
4268 return 0; 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
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()
4325 memset(name, 0, sizeof(name)); 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()
4441 case 0: 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()
4451 queue_cast(r, lkb, 0); in receive_request_reply()
4467 r->res_master_nodeid = 0; in receive_request_reply()
4481 confirm_master(r, 0); in receive_request_reply()
4490 if ((result == 0 || result == -EINPROGRESS) && in receive_request_reply()
4510 return 0; 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()
4538 case 0: 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()
4544 queue_cast(r, lkb, 0); 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()
4592 return 0; 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()
4643 return 0; 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()
4671 case 0: 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()
4695 return 0; in receive_cancel_reply()
4699 const struct dlm_message *ms) in receive_lookup_reply() argument
4704 int do_lookup_list = 0; in receive_lookup_reply()
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()
4743 r->res_nodeid = 0; in receive_lookup_reply()
4745 r->res_first_lkid = 0; in receive_lookup_reply()
4749 lkb->lkb_id, le32_to_cpu(ms->m_header.h_nodeid)); in receive_lookup_reply()
4750 r->res_master_nodeid = 0; in receive_lookup_reply()
4778 static void _receive_message(struct dlm_ls *ls, const struct dlm_message *ms, in _receive_message() argument
4781 int error = 0, noent = 0; in _receive_message()
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()
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()
4835 error = receive_grant(ls, ms); 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()
4964 int type = 0; in dlm_receive_buffer()
5020 memset(ms_local, 0, sizeof(struct dlm_message)); in recover_convert_waiter()
5051 return 0; in waiter_needs_recovery()
5114 local_cancel_result = 0; in dlm_recover_waiters_pre()
5139 memset(ms_local, 0, sizeof(struct dlm_message)); in dlm_recover_waiters_pre()
5149 memset(ms_local, 0, sizeof(struct dlm_message)); in dlm_recover_waiters_pre()
5214 int error = 0, mstype, err, oc, ou; in dlm_recover_waiters_post()
5246 err = 0; in dlm_recover_waiters_post()
5263 lkb->lkb_wait_type = 0; in dlm_recover_waiters_post()
5314 confirm_master(r, 0); in dlm_recover_waiters_post()
5409 int nodes_count = 0; in dlm_recover_purge()
5410 int nodeid_gone = 0; in dlm_recover_purge()
5411 unsigned int lkb_count = 0; in dlm_recover_purge()
5484 unsigned int count = 0; in dlm_recover_grant()
5485 unsigned int rsb_count = 0; in dlm_recover_grant()
5486 unsigned int lkb_count = 0; in dlm_recover_grant()
5494 count = 0; in dlm_recover_grant()
5500 confirm_master(r, 0); in dlm_recover_grant()
5582 return 0; in receive_rcom_lock_args()
5598 uint32_t remid = 0; in dlm_recover_master_copy()
5725 case 0: in dlm_recover_process_copy()
5742 return 0; in dlm_recover_process_copy()
5787 case 0: in dlm_user_request()
5790 error = 0; in dlm_user_request()
5793 error = 0; in dlm_user_request()
5828 trace_dlm_lock_start(ls, lkb, NULL, 0, mode, flags); in dlm_user_convert()
5852 error = set_lock_args(mode, &ua->lksb, flags, 0, fake_astfn, ua, in dlm_user_convert()
5860 error = 0; in dlm_user_convert()
5862 trace_dlm_lock_end(ls, lkb, NULL, 0, mode, flags, error, false); in dlm_user_convert()
5882 int found_other_mode = 0; in dlm_user_adopt_orphan()
5883 int rv = 0; in dlm_user_adopt_orphan()
5972 error = 0; in dlm_user_unlock()
5975 error = 0; in dlm_user_unlock()
6021 error = 0; in dlm_user_cancel()
6024 error = 0; in dlm_user_cancel()
6073 error = 0; in dlm_user_deadlock()
6076 error = 0; in dlm_user_deadlock()
6098 set_unlock_args(0, lkb->lkb_ua, &args); in orphan_proc_lock()
6102 error = 0; in orphan_proc_lock()
6121 error = 0; in unlock_proc_lock()
6240 /* pid of 0 means purge all orphans */
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()
6276 int error = 0; in dlm_user_purge()
6319 lkb->lkb_astparam = (void *)0xDEADBEEF; in dlm_debug_add_lkb()
6321 error = find_rsb(ls, name, len, 0, R_REQUEST, &r); in dlm_debug_add_lkb()
6334 return 0; in dlm_debug_add_lkb()