Lines Matching defs:g_ns

753 static struct spdk_nvmf_ns g_ns;
767 memset(&g_ns, 0, sizeof(g_ns));
768 TAILQ_INIT(&g_ns.registrants);
769 g_ns.subsystem = &g_subsystem;
770 g_ns.ptpl_file = NULL;
771 g_ns.ptpl_activated = false;
773 g_ns.bdev = &g_bdevs[0];
809 TAILQ_FOREACH_SAFE(reg, &g_ns.registrants, link, tmp) {
810 TAILQ_REMOVE(&g_ns.registrants, reg, link);
938 gen = g_ns.gen;
943 nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);
945 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
947 SPDK_CU_ASSERT_FATAL(g_ns.gen == gen + 1);
954 nvmf_ns_reservation_register(&g_ns, &g_ctrlr2_A, req);
961 nvmf_ns_reservation_register(&g_ns, &g_ctrlr_B, req);
963 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_B.hostid);
965 SPDK_CU_ASSERT_FATAL(g_ns.gen == gen + 2);
970 nvmf_ns_reservation_register(&g_ns, &g_ctrlr_C, req);
972 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_C.hostid);
974 SPDK_CU_ASSERT_FATAL(g_ns.gen == gen + 3);
998 nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);
1000 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1008 gen = g_ns.gen;
1009 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr1_A, req);
1011 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1012 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE);
1013 SPDK_CU_ASSERT_FATAL(g_ns.crkey == 0xa11);
1014 SPDK_CU_ASSERT_FATAL(g_ns.holder == reg);
1015 SPDK_CU_ASSERT_FATAL(g_ns.gen == gen);
1020 nvmf_ns_reservation_register(&g_ns, &g_ctrlr_C, req);
1022 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_C.hostid);
1028 nvmf_ns_reservation_register(&g_ns, &g_ctrlr_B, req);
1030 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_B.hostid);
1036 nvmf_ns_reservation_register(&g_ns, &g_ctrlr_B, req);
1042 nvmf_ns_reservation_register(&g_ns, &g_ctrlr_B, req);
1044 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_B.hostid);
1050 nvmf_ns_reservation_register(&g_ns, &g_ctrlr_B, req);
1052 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_B.hostid);
1061 nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);
1063 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1065 SPDK_CU_ASSERT_FATAL(g_ns.rtype == 0);
1066 SPDK_CU_ASSERT_FATAL(g_ns.crkey == 0);
1067 SPDK_CU_ASSERT_FATAL(g_ns.holder == NULL);
1090 g_ns.ptpl_file = NULL;
1093 update_sgroup = nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);
1096 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1100 g_ns.ptpl_file = "/tmp/Ns1PR.cfg";
1103 update_sgroup = nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);
1106 SPDK_CU_ASSERT_FATAL(g_ns.ptpl_activated == true);
1107 rc = nvmf_ns_update_reservation_info(&g_ns);
1109 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1114 rc = nvmf_ns_reservation_load(&g_ns, &info);
1122 update_sgroup = nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);
1125 SPDK_CU_ASSERT_FATAL(g_ns.ptpl_activated == false);
1126 rc = nvmf_ns_update_reservation_info(&g_ns);
1128 rc = nvmf_ns_reservation_load(&g_ns, &info);
1130 unlink(g_ns.ptpl_file);
1152 gen = g_ns.gen;
1158 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr1_A, req);
1160 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1161 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_REG_ONLY);
1162 SPDK_CU_ASSERT_FATAL(g_ns.crkey == 0xa1);
1163 SPDK_CU_ASSERT_FATAL(g_ns.holder == reg);
1164 SPDK_CU_ASSERT_FATAL(g_ns.gen == gen);
1169 gen = g_ns.gen;
1172 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr_B, req);
1174 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1176 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_B.hostid);
1178 SPDK_CU_ASSERT_FATAL(g_ns.holder == reg);
1179 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_C.hostid);
1181 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_ALL_REGS);
1182 SPDK_CU_ASSERT_FATAL(g_ns.gen > gen);
1188 gen = g_ns.gen;
1191 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr_C, req);
1193 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr2_A.hostid);
1195 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_B.hostid);
1197 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_C.hostid);
1199 SPDK_CU_ASSERT_FATAL(g_ns.holder == reg);
1200 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_ALL_REGS);
1201 SPDK_CU_ASSERT_FATAL(g_ns.gen > gen);
1225 g_ns.ptpl_file = "/tmp/Ns1PR.cfg";
1228 update_sgroup = nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);
1231 SPDK_CU_ASSERT_FATAL(g_ns.ptpl_activated == true);
1232 rc = nvmf_ns_update_reservation_info(&g_ns);
1234 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1239 rc = nvmf_ns_reservation_load(&g_ns, &info);
1247 update_sgroup = nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr1_A, req);
1250 rc = nvmf_ns_update_reservation_info(&g_ns);
1253 rc = nvmf_ns_reservation_load(&g_ns, &info);
1265 update_sgroup = nvmf_ns_reservation_release(&g_ns, &g_ctrlr1_A, req);
1268 rc = nvmf_ns_update_reservation_info(&g_ns);
1271 rc = nvmf_ns_reservation_load(&g_ns, &info);
1276 unlink(g_ns.ptpl_file);
1302 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr1_A, req);
1304 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1305 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_ALL_REGS);
1306 SPDK_CU_ASSERT_FATAL(g_ns.holder == reg);
1311 nvmf_ns_reservation_release(&g_ns, &g_ctrlr_B, req);
1313 SPDK_CU_ASSERT_FATAL(g_ns.rtype == 0);
1314 SPDK_CU_ASSERT_FATAL(g_ns.crkey == 0);
1315 SPDK_CU_ASSERT_FATAL(g_ns.holder == NULL);
1320 nvmf_ns_reservation_release(&g_ns, &g_ctrlr_C, req);
1322 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr1_A.hostid);
1324 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr2_A.hostid);
1326 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_B.hostid);
1328 reg = nvmf_ns_reservation_get_registrant(&g_ns, &g_ctrlr_C.hostid);
1363 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr_B, req);
1365 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_REG_ONLY);
1379 nvmf_ns_reservation_register(&g_ns, &g_ctrlr_B, req);
1381 SPDK_CU_ASSERT_FATAL(g_ns.rtype == 0);
1411 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr_B, req);
1413 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_REG_ONLY);
1425 nvmf_ns_reservation_release(&g_ns, &g_ctrlr_B, req);
1427 SPDK_CU_ASSERT_FATAL(g_ns.rtype == 0);
1457 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr_B, req);
1459 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE);
1472 nvmf_ns_reservation_release(&g_ns, &g_ctrlr_B, req);
1474 SPDK_CU_ASSERT_FATAL(g_ns.rtype == 0);
1504 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr_B, req);
1506 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_REG_ONLY);
1518 nvmf_ns_reservation_release(&g_ns, &g_ctrlr_B, req);
1520 SPDK_CU_ASSERT_FATAL(g_ns.rtype == 0);
1550 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr_B, req);
1552 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_REG_ONLY);
1566 nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr_C, req);
1568 SPDK_CU_ASSERT_FATAL(g_ns.rtype == SPDK_NVME_RESERVE_WRITE_EXCLUSIVE_ALL_REGS);
2177 update_sgroup = nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);
2180 SPDK_CU_ASSERT_FATAL(g_ns.ptpl_activated == true);
2181 rc = nvmf_ns_update_reservation_info(&g_ns);
2188 update_sgroup = nvmf_ns_reservation_acquire(&g_ns, &g_ctrlr1_A, req);
2191 rc = nvmf_ns_update_reservation_info(&g_ns);
2196 nsid = spdk_nvmf_subsystem_add_ns_ext(&subsystem, g_ns.bdev->name, NULL, 0, NULL);