Lines Matching refs:mres
53 static void dlm_init_migratable_lockres(struct dlm_migratable_lockres *mres,
58 struct dlm_migratable_lockres *mres,
64 struct dlm_migratable_lockres *mres);
874 struct dlm_migratable_lockres *mres; in dlm_request_all_locks_worker() local
885 mres = (struct dlm_migratable_lockres *)data; in dlm_request_all_locks_worker()
922 ret = dlm_send_one_lockres(dlm, res, mres, reco_master, in dlm_request_all_locks_worker()
1105 struct dlm_migratable_lockres *mres, in dlm_send_mig_lockres_msg() argument
1110 u64 mig_cookie = be64_to_cpu(mres->mig_cookie); in dlm_send_mig_lockres_msg()
1111 int mres_total_locks = be32_to_cpu(mres->total_locks); in dlm_send_mig_lockres_msg()
1113 u8 orig_flags = mres->flags, in dlm_send_mig_lockres_msg()
1114 orig_master = mres->master; in dlm_send_mig_lockres_msg()
1116 BUG_ON(mres->num_locks > DLM_MAX_MIGRATABLE_LOCKS); in dlm_send_mig_lockres_msg()
1117 if (!mres->num_locks) in dlm_send_mig_lockres_msg()
1121 orig_flags = mres->flags; in dlm_send_mig_lockres_msg()
1124 mres->flags |= DLM_MRES_ALL_DONE; in dlm_send_mig_lockres_msg()
1132 ret = o2net_send_message(DLM_MIG_LOCKRES_MSG, dlm->key, mres, in dlm_send_mig_lockres_msg()
1133 struct_size(mres, ml, mres->num_locks), in dlm_send_mig_lockres_msg()
1139 "node %u (%s)\n", dlm->name, mres->lockname_len, in dlm_send_mig_lockres_msg()
1140 mres->lockname, ret, send_to, in dlm_send_mig_lockres_msg()
1158 dlm_init_migratable_lockres(mres, res->lockname.name, in dlm_send_mig_lockres_msg()
1164 static void dlm_init_migratable_lockres(struct dlm_migratable_lockres *mres, in dlm_init_migratable_lockres() argument
1170 clear_page(mres); in dlm_init_migratable_lockres()
1171 mres->lockname_len = namelen; in dlm_init_migratable_lockres()
1172 memcpy(mres->lockname, lockname, namelen); in dlm_init_migratable_lockres()
1173 mres->num_locks = 0; in dlm_init_migratable_lockres()
1174 mres->total_locks = cpu_to_be32(total_locks); in dlm_init_migratable_lockres()
1175 mres->mig_cookie = cpu_to_be64(cookie); in dlm_init_migratable_lockres()
1176 mres->flags = flags; in dlm_init_migratable_lockres()
1177 mres->master = master; in dlm_init_migratable_lockres()
1181 struct dlm_migratable_lockres *mres, in dlm_prepare_lvb_for_migration() argument
1195 if (dlm_lvb_is_empty(mres->lvb)) { in dlm_prepare_lvb_for_migration()
1196 memcpy(mres->lvb, lock->lksb->lvb, DLM_LVB_LEN); in dlm_prepare_lvb_for_migration()
1201 if (!memcmp(mres->lvb, lock->lksb->lvb, DLM_LVB_LEN)) in dlm_prepare_lvb_for_migration()
1217 struct dlm_migratable_lockres *mres, int queue) in dlm_add_lock_to_array() argument
1220 int lock_num = mres->num_locks; in dlm_add_lock_to_array()
1222 ml = &(mres->ml[lock_num]); in dlm_add_lock_to_array()
1230 dlm_prepare_lvb_for_migration(lock, mres, queue); in dlm_add_lock_to_array()
1233 mres->num_locks++; in dlm_add_lock_to_array()
1235 if (mres->num_locks == DLM_MAX_MIGRATABLE_LOCKS) in dlm_add_lock_to_array()
1241 struct dlm_migratable_lockres *mres) in dlm_add_dummy_lock() argument
1251 dlm_add_lock_to_array(&dummy, mres, DLM_BLOCKED_LIST); in dlm_add_dummy_lock()
1270 struct dlm_migratable_lockres *mres, in dlm_send_one_lockres() argument
1292 dlm_init_migratable_lockres(mres, res->lockname.name, in dlm_send_one_lockres()
1302 if (!dlm_add_lock_to_array(lock, mres, i)) in dlm_send_one_lockres()
1307 ret = dlm_send_mig_lockres_msg(dlm, mres, send_to, in dlm_send_one_lockres()
1319 dlm_add_dummy_lock(dlm, mres); in dlm_send_one_lockres()
1322 ret = dlm_send_mig_lockres_msg(dlm, mres, send_to, res, total_locks); in dlm_send_one_lockres()
1358 struct dlm_migratable_lockres *mres = in dlm_mig_lockres_handler() local
1374 dlm->name, mres->lockname_len, in dlm_mig_lockres_handler()
1375 mres->lockname, mres->master); in dlm_mig_lockres_handler()
1380 BUG_ON(!(mres->flags & (DLM_MRES_RECOVERY|DLM_MRES_MIGRATION))); in dlm_mig_lockres_handler()
1382 real_master = mres->master; in dlm_mig_lockres_handler()
1385 BUG_ON(!(mres->flags & DLM_MRES_RECOVERY)); in dlm_mig_lockres_handler()
1389 (mres->flags & DLM_MRES_RECOVERY) ? in dlm_mig_lockres_handler()
1390 "recovery" : "migration", mres->master); in dlm_mig_lockres_handler()
1391 if (mres->flags & DLM_MRES_ALL_DONE) in dlm_mig_lockres_handler()
1403 hash = dlm_lockid_hash(mres->lockname, mres->lockname_len); in dlm_mig_lockres_handler()
1405 res = __dlm_lookup_lockres_full(dlm, mres->lockname, mres->lockname_len, in dlm_mig_lockres_handler()
1415 mres->lockname_len, mres->lockname); in dlm_mig_lockres_handler()
1423 if (mres->flags & DLM_MRES_RECOVERY) { in dlm_mig_lockres_handler()
1430 mres->lockname_len, in dlm_mig_lockres_handler()
1431 mres->lockname); in dlm_mig_lockres_handler()
1436 mres->lockname_len, mres->lockname); in dlm_mig_lockres_handler()
1451 res = dlm_new_lockres(dlm, mres->lockname, mres->lockname_len); in dlm_mig_lockres_handler()
1460 if (mres->flags & DLM_MRES_RECOVERY) in dlm_mig_lockres_handler()
1501 if (mres->master == DLM_LOCK_RES_OWNER_UNKNOWN) { in dlm_mig_lockres_handler()
1503 BUG_ON(!(mres->flags & DLM_MRES_RECOVERY)); in dlm_mig_lockres_handler()
1506 "%.*s\n", mres->lockname_len, mres->lockname); in dlm_mig_lockres_handler()
1545 struct dlm_migratable_lockres *mres; in dlm_mig_lockres_worker() local
1552 mres = (struct dlm_migratable_lockres *)data; in dlm_mig_lockres_worker()
1585 ret = dlm_process_recovery_data(dlm, res, mres); in dlm_mig_lockres_worker()
1591 if ((mres->flags & (DLM_MRES_MIGRATION|DLM_MRES_ALL_DONE)) == in dlm_mig_lockres_worker()
1593 ret = dlm_finish_migration(dlm, res, mres->master); in dlm_mig_lockres_worker()
1798 struct dlm_migratable_lockres *mres) in dlm_process_recovery_data() argument
1811 mlog(0, "running %d locks for this lockres\n", mres->num_locks); in dlm_process_recovery_data()
1812 for (i=0; i<mres->num_locks; i++) { in dlm_process_recovery_data()
1813 ml = &(mres->ml[i]); in dlm_process_recovery_data()
1817 BUG_ON(mres->num_locks != 1); in dlm_process_recovery_data()
1819 dlm->name, mres->lockname_len, mres->lockname, in dlm_process_recovery_data()
1838 BUG_ON(!(mres->flags & DLM_MRES_MIGRATION)); in dlm_process_recovery_data()
1943 if (!dlm_lvb_is_empty(mres->lvb)) { in dlm_process_recovery_data()
1948 memcpy(lksb->lvb, mres->lvb, DLM_LVB_LEN); in dlm_process_recovery_data()
1953 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); in dlm_process_recovery_data()
1961 memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) { in dlm_process_recovery_data()
1972 printk("%02x", mres->lvb[i]); in dlm_process_recovery_data()
1977 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); in dlm_process_recovery_data()
2023 if (mres->flags & DLM_MRES_RECOVERY && in dlm_process_recovery_data()