Lines Matching refs:mres

51 static void dlm_init_migratable_lockres(struct dlm_migratable_lockres *mres,
56 struct dlm_migratable_lockres *mres,
62 struct dlm_migratable_lockres *mres);
865 struct dlm_migratable_lockres *mres; in dlm_request_all_locks_worker() local
876 mres = (struct dlm_migratable_lockres *)data; in dlm_request_all_locks_worker()
913 ret = dlm_send_one_lockres(dlm, res, mres, reco_master, in dlm_request_all_locks_worker()
1096 struct dlm_migratable_lockres *mres, in dlm_send_mig_lockres_msg() argument
1101 u64 mig_cookie = be64_to_cpu(mres->mig_cookie); in dlm_send_mig_lockres_msg()
1102 int mres_total_locks = be32_to_cpu(mres->total_locks); in dlm_send_mig_lockres_msg()
1104 u8 orig_flags = mres->flags, in dlm_send_mig_lockres_msg()
1105 orig_master = mres->master; in dlm_send_mig_lockres_msg()
1107 BUG_ON(mres->num_locks > DLM_MAX_MIGRATABLE_LOCKS); in dlm_send_mig_lockres_msg()
1108 if (!mres->num_locks) in dlm_send_mig_lockres_msg()
1112 orig_flags = mres->flags; in dlm_send_mig_lockres_msg()
1115 mres->flags |= DLM_MRES_ALL_DONE; in dlm_send_mig_lockres_msg()
1123 ret = o2net_send_message(DLM_MIG_LOCKRES_MSG, dlm->key, mres, in dlm_send_mig_lockres_msg()
1124 struct_size(mres, ml, mres->num_locks), in dlm_send_mig_lockres_msg()
1130 "node %u (%s)\n", dlm->name, mres->lockname_len, in dlm_send_mig_lockres_msg()
1131 mres->lockname, ret, send_to, in dlm_send_mig_lockres_msg()
1149 dlm_init_migratable_lockres(mres, res->lockname.name, in dlm_send_mig_lockres_msg()
1155 static void dlm_init_migratable_lockres(struct dlm_migratable_lockres *mres, in dlm_init_migratable_lockres() argument
1161 clear_page(mres); in dlm_init_migratable_lockres()
1162 mres->lockname_len = namelen; in dlm_init_migratable_lockres()
1163 memcpy(mres->lockname, lockname, namelen); in dlm_init_migratable_lockres()
1164 mres->num_locks = 0; in dlm_init_migratable_lockres()
1165 mres->total_locks = cpu_to_be32(total_locks); in dlm_init_migratable_lockres()
1166 mres->mig_cookie = cpu_to_be64(cookie); in dlm_init_migratable_lockres()
1167 mres->flags = flags; in dlm_init_migratable_lockres()
1168 mres->master = master; in dlm_init_migratable_lockres()
1172 struct dlm_migratable_lockres *mres, in dlm_prepare_lvb_for_migration() argument
1186 if (dlm_lvb_is_empty(mres->lvb)) { in dlm_prepare_lvb_for_migration()
1187 memcpy(mres->lvb, lock->lksb->lvb, DLM_LVB_LEN); in dlm_prepare_lvb_for_migration()
1192 if (!memcmp(mres->lvb, lock->lksb->lvb, DLM_LVB_LEN)) in dlm_prepare_lvb_for_migration()
1208 struct dlm_migratable_lockres *mres, int queue) in dlm_add_lock_to_array() argument
1211 int lock_num = mres->num_locks; in dlm_add_lock_to_array()
1213 ml = &(mres->ml[lock_num]); in dlm_add_lock_to_array()
1221 dlm_prepare_lvb_for_migration(lock, mres, queue); in dlm_add_lock_to_array()
1224 mres->num_locks++; in dlm_add_lock_to_array()
1226 if (mres->num_locks == DLM_MAX_MIGRATABLE_LOCKS) in dlm_add_lock_to_array()
1232 struct dlm_migratable_lockres *mres) in dlm_add_dummy_lock() argument
1242 dlm_add_lock_to_array(&dummy, mres, DLM_BLOCKED_LIST); in dlm_add_dummy_lock()
1261 struct dlm_migratable_lockres *mres, in dlm_send_one_lockres() argument
1283 dlm_init_migratable_lockres(mres, res->lockname.name, in dlm_send_one_lockres()
1293 if (!dlm_add_lock_to_array(lock, mres, i)) in dlm_send_one_lockres()
1298 ret = dlm_send_mig_lockres_msg(dlm, mres, send_to, in dlm_send_one_lockres()
1310 dlm_add_dummy_lock(dlm, mres); in dlm_send_one_lockres()
1313 ret = dlm_send_mig_lockres_msg(dlm, mres, send_to, res, total_locks); in dlm_send_one_lockres()
1349 struct dlm_migratable_lockres *mres = in dlm_mig_lockres_handler() local
1365 dlm->name, mres->lockname_len, in dlm_mig_lockres_handler()
1366 mres->lockname, mres->master); in dlm_mig_lockres_handler()
1371 BUG_ON(!(mres->flags & (DLM_MRES_RECOVERY|DLM_MRES_MIGRATION))); in dlm_mig_lockres_handler()
1373 real_master = mres->master; in dlm_mig_lockres_handler()
1376 BUG_ON(!(mres->flags & DLM_MRES_RECOVERY)); in dlm_mig_lockres_handler()
1380 (mres->flags & DLM_MRES_RECOVERY) ? in dlm_mig_lockres_handler()
1381 "recovery" : "migration", mres->master); in dlm_mig_lockres_handler()
1382 if (mres->flags & DLM_MRES_ALL_DONE) in dlm_mig_lockres_handler()
1394 hash = dlm_lockid_hash(mres->lockname, mres->lockname_len); in dlm_mig_lockres_handler()
1396 res = __dlm_lookup_lockres_full(dlm, mres->lockname, mres->lockname_len, in dlm_mig_lockres_handler()
1406 mres->lockname_len, mres->lockname); in dlm_mig_lockres_handler()
1414 if (mres->flags & DLM_MRES_RECOVERY) { in dlm_mig_lockres_handler()
1421 mres->lockname_len, in dlm_mig_lockres_handler()
1422 mres->lockname); in dlm_mig_lockres_handler()
1427 mres->lockname_len, mres->lockname); in dlm_mig_lockres_handler()
1442 res = dlm_new_lockres(dlm, mres->lockname, mres->lockname_len); in dlm_mig_lockres_handler()
1451 if (mres->flags & DLM_MRES_RECOVERY) in dlm_mig_lockres_handler()
1492 if (mres->master == DLM_LOCK_RES_OWNER_UNKNOWN) { in dlm_mig_lockres_handler()
1494 BUG_ON(!(mres->flags & DLM_MRES_RECOVERY)); in dlm_mig_lockres_handler()
1497 "%.*s\n", mres->lockname_len, mres->lockname); in dlm_mig_lockres_handler()
1536 struct dlm_migratable_lockres *mres; in dlm_mig_lockres_worker() local
1543 mres = (struct dlm_migratable_lockres *)data; in dlm_mig_lockres_worker()
1576 ret = dlm_process_recovery_data(dlm, res, mres); in dlm_mig_lockres_worker()
1582 if ((mres->flags & (DLM_MRES_MIGRATION|DLM_MRES_ALL_DONE)) == in dlm_mig_lockres_worker()
1584 ret = dlm_finish_migration(dlm, res, mres->master); in dlm_mig_lockres_worker()
1789 struct dlm_migratable_lockres *mres) in dlm_process_recovery_data() argument
1802 mlog(0, "running %d locks for this lockres\n", mres->num_locks); in dlm_process_recovery_data()
1803 for (i=0; i<mres->num_locks; i++) { in dlm_process_recovery_data()
1804 ml = &(mres->ml[i]); in dlm_process_recovery_data()
1808 BUG_ON(mres->num_locks != 1); in dlm_process_recovery_data()
1810 dlm->name, mres->lockname_len, mres->lockname, in dlm_process_recovery_data()
1829 BUG_ON(!(mres->flags & DLM_MRES_MIGRATION)); in dlm_process_recovery_data()
1934 if (!dlm_lvb_is_empty(mres->lvb)) { in dlm_process_recovery_data()
1939 memcpy(lksb->lvb, mres->lvb, DLM_LVB_LEN); in dlm_process_recovery_data()
1944 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); in dlm_process_recovery_data()
1952 memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) { in dlm_process_recovery_data()
1963 printk("%02x", mres->lvb[i]); in dlm_process_recovery_data()
1968 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); in dlm_process_recovery_data()
2014 if (mres->flags & DLM_MRES_RECOVERY && in dlm_process_recovery_data()