Lines Matching refs:cfix
545 static struct ptunit_result dfix_init(struct iscache_fixture *cfix) in dfix_init() argument
549 ptu_test(ptunit_thrd_init, &cfix->thrd); in dfix_init()
551 memset(cfix->section, 0, sizeof(cfix->section)); in dfix_init()
561 cfix->section[idx] = section; in dfix_init()
567 static struct ptunit_result cfix_init(struct iscache_fixture *cfix) in cfix_init() argument
571 ptu_test(dfix_init, cfix); in cfix_init()
573 errcode = pt_iscache_init(&cfix->iscache, NULL); in cfix_init()
579 static struct ptunit_result sfix_init(struct iscache_fixture *cfix) in sfix_init() argument
583 ptu_test(cfix_init, cfix); in sfix_init()
585 cfix->iscache.limit = 0x7800; in sfix_init()
588 status = pt_iscache_add(&cfix->iscache, cfix->section[idx], in sfix_init()
596 static struct ptunit_result cfix_fini(struct iscache_fixture *cfix) in cfix_fini() argument
600 ptu_test(ptunit_thrd_fini, &cfix->thrd); in cfix_fini()
602 for (idx = 0; idx < cfix->thrd.nthreads; ++idx) in cfix_fini()
603 ptu_int_eq(cfix->thrd.result[idx], 0); in cfix_fini()
605 pt_iscache_fini(&cfix->iscache); in cfix_fini()
608 ptu_int_eq(cfix->section[idx]->ucount, 1); in cfix_fini()
609 ptu_int_eq(cfix->section[idx]->acount, 0); in cfix_fini()
610 ptu_int_eq(cfix->section[idx]->mcount, 0); in cfix_fini()
611 ptu_null(cfix->section[idx]->iscache); in cfix_fini()
613 errcode = pt_section_put(cfix->section[idx]); in cfix_fini()
741 static struct ptunit_result init_fini(struct iscache_fixture *cfix) in init_fini() argument
743 (void) cfix; in init_fini()
749 static struct ptunit_result name(struct iscache_fixture *cfix) in name() argument
753 pt_iscache_init(&cfix->iscache, "iscache-name"); in name()
755 name = pt_iscache_name(&cfix->iscache); in name()
761 static struct ptunit_result name_none(struct iscache_fixture *cfix) in name_none() argument
765 pt_iscache_init(&cfix->iscache, NULL); in name_none()
767 name = pt_iscache_name(&cfix->iscache); in name_none()
773 static struct ptunit_result add(struct iscache_fixture *cfix) in add() argument
777 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in add()
781 ptu_int_eq(cfix->section[0]->ucount, 2); in add()
782 ptu_int_eq(cfix->section[0]->acount, 1); in add()
788 static struct ptunit_result add_no_name(struct iscache_fixture *cfix) in add_no_name() argument
795 errcode = pt_iscache_add(&cfix->iscache, §ion, 0ull); in add_no_name()
801 static struct ptunit_result add_file(struct iscache_fixture *cfix) in add_file() argument
805 isid = pt_iscache_add_file(&cfix->iscache, "name", 0ull, 1ull, 0ull); in add_file()
811 static struct ptunit_result find(struct iscache_fixture *cfix) in find() argument
816 section = cfix->section[0]; in find()
819 isid = pt_iscache_add(&cfix->iscache, section, 0ull); in find()
822 found = pt_iscache_find(&cfix->iscache, section->filename, in find()
829 static struct ptunit_result find_empty(struct iscache_fixture *cfix) in find_empty() argument
834 section = cfix->section[0]; in find_empty()
837 found = pt_iscache_find(&cfix->iscache, section->filename, in find_empty()
844 static struct ptunit_result find_bad_filename(struct iscache_fixture *cfix) in find_bad_filename() argument
849 section = cfix->section[0]; in find_bad_filename()
852 isid = pt_iscache_add(&cfix->iscache, section, 0ull); in find_bad_filename()
855 found = pt_iscache_find(&cfix->iscache, "bad-filename", in find_bad_filename()
862 static struct ptunit_result find_null_filename(struct iscache_fixture *cfix) in find_null_filename() argument
866 errcode = pt_iscache_find(&cfix->iscache, NULL, 0ull, 0ull, 0ull); in find_null_filename()
872 static struct ptunit_result find_bad_offset(struct iscache_fixture *cfix) in find_bad_offset() argument
877 section = cfix->section[0]; in find_bad_offset()
880 isid = pt_iscache_add(&cfix->iscache, section, 0ull); in find_bad_offset()
883 found = pt_iscache_find(&cfix->iscache, section->filename, 0ull, in find_bad_offset()
890 static struct ptunit_result find_bad_size(struct iscache_fixture *cfix) in find_bad_size() argument
895 section = cfix->section[0]; in find_bad_size()
898 isid = pt_iscache_add(&cfix->iscache, section, 0ull); in find_bad_size()
901 found = pt_iscache_find(&cfix->iscache, section->filename, in find_bad_size()
908 static struct ptunit_result find_bad_laddr(struct iscache_fixture *cfix) in find_bad_laddr() argument
913 section = cfix->section[0]; in find_bad_laddr()
916 isid = pt_iscache_add(&cfix->iscache, section, 0ull); in find_bad_laddr()
919 found = pt_iscache_find(&cfix->iscache, section->filename, in find_bad_laddr()
926 static struct ptunit_result lookup(struct iscache_fixture *cfix) in lookup() argument
932 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in lookup()
935 errcode = pt_iscache_lookup(&cfix->iscache, §ion, &laddr, isid); in lookup()
937 ptu_ptr_eq(section, cfix->section[0]); in lookup()
946 static struct ptunit_result lookup_bad_isid(struct iscache_fixture *cfix) in lookup_bad_isid() argument
952 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in lookup_bad_isid()
955 errcode = pt_iscache_lookup(&cfix->iscache, §ion, &laddr, 0); in lookup_bad_isid()
958 errcode = pt_iscache_lookup(&cfix->iscache, §ion, &laddr, -isid); in lookup_bad_isid()
961 errcode = pt_iscache_lookup(&cfix->iscache, §ion, &laddr, isid + 1); in lookup_bad_isid()
967 static struct ptunit_result clear_empty(struct iscache_fixture *cfix) in clear_empty() argument
971 errcode = pt_iscache_clear(&cfix->iscache); in clear_empty()
977 static struct ptunit_result clear_find(struct iscache_fixture *cfix) in clear_find() argument
982 section = cfix->section[0]; in clear_find()
985 isid = pt_iscache_add(&cfix->iscache, section, 0ull); in clear_find()
988 errcode = pt_iscache_clear(&cfix->iscache); in clear_find()
992 found = pt_iscache_find(&cfix->iscache, section->filename, in clear_find()
999 static struct ptunit_result clear_lookup(struct iscache_fixture *cfix) in clear_lookup() argument
1005 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in clear_lookup()
1008 errcode = pt_iscache_clear(&cfix->iscache); in clear_lookup()
1011 errcode = pt_iscache_lookup(&cfix->iscache, §ion, &laddr, isid); in clear_lookup()
1017 static struct ptunit_result add_twice(struct iscache_fixture *cfix) in add_twice() argument
1021 isid[0] = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in add_twice()
1024 isid[1] = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in add_twice()
1033 static struct ptunit_result add_same(struct iscache_fixture *cfix) in add_same() argument
1037 isid[0] = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in add_same()
1040 cfix->section[1]->offset = cfix->section[0]->offset; in add_same()
1041 cfix->section[1]->size = cfix->section[0]->size; in add_same()
1043 isid[1] = pt_iscache_add(&cfix->iscache, cfix->section[1], 0ull); in add_same()
1053 add_twice_different_laddr(struct iscache_fixture *cfix) in add_twice_different_laddr() argument
1057 isid[0] = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in add_twice_different_laddr()
1060 isid[1] = pt_iscache_add(&cfix->iscache, cfix->section[0], 1ull); in add_twice_different_laddr()
1067 ptu_int_eq(cfix->section[0]->ucount, 3); in add_twice_different_laddr()
1068 ptu_int_eq(cfix->section[0]->acount, 2); in add_twice_different_laddr()
1074 add_same_different_laddr(struct iscache_fixture *cfix) in add_same_different_laddr() argument
1078 isid[0] = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in add_same_different_laddr()
1081 cfix->section[1]->offset = cfix->section[0]->offset; in add_same_different_laddr()
1082 cfix->section[1]->size = cfix->section[0]->size; in add_same_different_laddr()
1084 isid[1] = pt_iscache_add(&cfix->iscache, cfix->section[1], 1ull); in add_same_different_laddr()
1094 add_different_same_laddr(struct iscache_fixture *cfix) in add_different_same_laddr() argument
1098 isid[0] = pt_iscache_add(&cfix->iscache, cfix->section[0], 0ull); in add_different_same_laddr()
1101 isid[1] = pt_iscache_add(&cfix->iscache, cfix->section[1], 0ull); in add_different_same_laddr()
1110 static struct ptunit_result add_file_same(struct iscache_fixture *cfix) in add_file_same() argument
1114 isid[0] = pt_iscache_add_file(&cfix->iscache, "name", 0ull, 1ull, 0ull); in add_file_same()
1117 isid[1] = pt_iscache_add_file(&cfix->iscache, "name", 0ull, 1ull, 0ull); in add_file_same()
1127 add_file_same_different_laddr(struct iscache_fixture *cfix) in add_file_same_different_laddr() argument
1131 isid[0] = pt_iscache_add_file(&cfix->iscache, "name", 0ull, 1ull, 0ull); in add_file_same_different_laddr()
1134 isid[1] = pt_iscache_add_file(&cfix->iscache, "name", 0ull, 1ull, 1ull); in add_file_same_different_laddr()
1144 add_file_different_same_laddr(struct iscache_fixture *cfix) in add_file_different_same_laddr() argument
1148 isid[0] = pt_iscache_add_file(&cfix->iscache, "name", 0ull, 1ull, 0ull); in add_file_different_same_laddr()
1151 isid[1] = pt_iscache_add_file(&cfix->iscache, "name", 1ull, 1ull, 0ull); in add_file_different_same_laddr()
1160 static struct ptunit_result read(struct iscache_fixture *cfix) in read() argument
1165 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in read()
1168 status = pt_iscache_read(&cfix->iscache, buffer, 2ull, isid, 0xa008ull); in read()
1177 static struct ptunit_result read_truncate(struct iscache_fixture *cfix) in read_truncate() argument
1182 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in read_truncate()
1185 status = pt_iscache_read(&cfix->iscache, buffer, sizeof(buffer), isid, in read_truncate()
1194 static struct ptunit_result read_bad_vaddr(struct iscache_fixture *cfix) in read_bad_vaddr() argument
1199 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in read_bad_vaddr()
1202 status = pt_iscache_read(&cfix->iscache, buffer, 1ull, isid, 0xb000ull); in read_bad_vaddr()
1209 static struct ptunit_result read_bad_isid(struct iscache_fixture *cfix) in read_bad_isid() argument
1214 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in read_bad_isid()
1217 status = pt_iscache_read(&cfix->iscache, buffer, 1ull, isid + 1, in read_bad_isid()
1225 static struct ptunit_result lru_map(struct iscache_fixture *cfix) in lru_map() argument
1229 cfix->iscache.limit = cfix->section[0]->size; in lru_map()
1230 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_map()
1231 ptu_null(cfix->iscache.lru); in lru_map()
1233 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_map()
1236 status = pt_section_map(cfix->section[0]); in lru_map()
1239 status = pt_section_unmap(cfix->section[0]); in lru_map()
1242 ptu_ptr(cfix->iscache.lru); in lru_map()
1243 ptu_ptr_eq(cfix->iscache.lru->section, cfix->section[0]); in lru_map()
1244 ptu_null(cfix->iscache.lru->next); in lru_map()
1245 ptu_uint_eq(cfix->iscache.used, cfix->section[0]->size); in lru_map()
1250 static struct ptunit_result lru_read(struct iscache_fixture *cfix) in lru_read() argument
1255 cfix->iscache.limit = cfix->section[0]->size; in lru_read()
1256 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_read()
1257 ptu_null(cfix->iscache.lru); in lru_read()
1259 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_read()
1262 status = pt_iscache_read(&cfix->iscache, buffer, 2ull, isid, 0xa008ull); in lru_read()
1265 ptu_ptr(cfix->iscache.lru); in lru_read()
1266 ptu_ptr_eq(cfix->iscache.lru->section, cfix->section[0]); in lru_read()
1267 ptu_null(cfix->iscache.lru->next); in lru_read()
1268 ptu_uint_eq(cfix->iscache.used, cfix->section[0]->size); in lru_read()
1273 static struct ptunit_result lru_map_nodup(struct iscache_fixture *cfix) in lru_map_nodup() argument
1277 cfix->iscache.limit = 2 * cfix->section[0]->size; in lru_map_nodup()
1278 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_map_nodup()
1279 ptu_null(cfix->iscache.lru); in lru_map_nodup()
1281 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_map_nodup()
1284 status = pt_section_map(cfix->section[0]); in lru_map_nodup()
1287 status = pt_section_unmap(cfix->section[0]); in lru_map_nodup()
1290 status = pt_section_map(cfix->section[0]); in lru_map_nodup()
1293 status = pt_section_unmap(cfix->section[0]); in lru_map_nodup()
1296 ptu_ptr(cfix->iscache.lru); in lru_map_nodup()
1297 ptu_ptr_eq(cfix->iscache.lru->section, cfix->section[0]); in lru_map_nodup()
1298 ptu_null(cfix->iscache.lru->next); in lru_map_nodup()
1299 ptu_uint_eq(cfix->iscache.used, cfix->section[0]->size); in lru_map_nodup()
1304 static struct ptunit_result lru_map_too_big(struct iscache_fixture *cfix) in lru_map_too_big() argument
1308 cfix->iscache.limit = cfix->section[0]->size - 1; in lru_map_too_big()
1309 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_map_too_big()
1310 ptu_null(cfix->iscache.lru); in lru_map_too_big()
1312 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_map_too_big()
1315 status = pt_section_map(cfix->section[0]); in lru_map_too_big()
1318 status = pt_section_unmap(cfix->section[0]); in lru_map_too_big()
1321 ptu_null(cfix->iscache.lru); in lru_map_too_big()
1322 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_map_too_big()
1327 static struct ptunit_result lru_map_add_front(struct iscache_fixture *cfix) in lru_map_add_front() argument
1331 cfix->iscache.limit = cfix->section[0]->size + cfix->section[1]->size; in lru_map_add_front()
1332 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_map_add_front()
1333 ptu_null(cfix->iscache.lru); in lru_map_add_front()
1335 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_map_add_front()
1338 isid = pt_iscache_add(&cfix->iscache, cfix->section[1], 0xa000ull); in lru_map_add_front()
1341 status = pt_section_map(cfix->section[0]); in lru_map_add_front()
1344 status = pt_section_unmap(cfix->section[0]); in lru_map_add_front()
1347 status = pt_section_map(cfix->section[1]); in lru_map_add_front()
1350 status = pt_section_unmap(cfix->section[1]); in lru_map_add_front()
1353 ptu_ptr(cfix->iscache.lru); in lru_map_add_front()
1354 ptu_ptr_eq(cfix->iscache.lru->section, cfix->section[1]); in lru_map_add_front()
1355 ptu_ptr(cfix->iscache.lru->next); in lru_map_add_front()
1356 ptu_ptr_eq(cfix->iscache.lru->next->section, cfix->section[0]); in lru_map_add_front()
1357 ptu_null(cfix->iscache.lru->next->next); in lru_map_add_front()
1358 ptu_uint_eq(cfix->iscache.used, in lru_map_add_front()
1359 cfix->section[0]->size + cfix->section[1]->size); in lru_map_add_front()
1364 static struct ptunit_result lru_map_move_front(struct iscache_fixture *cfix) in lru_map_move_front() argument
1368 cfix->iscache.limit = cfix->section[0]->size + cfix->section[1]->size; in lru_map_move_front()
1369 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_map_move_front()
1370 ptu_null(cfix->iscache.lru); in lru_map_move_front()
1372 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_map_move_front()
1375 isid = pt_iscache_add(&cfix->iscache, cfix->section[1], 0xa000ull); in lru_map_move_front()
1378 status = pt_section_map(cfix->section[0]); in lru_map_move_front()
1381 status = pt_section_unmap(cfix->section[0]); in lru_map_move_front()
1384 status = pt_section_map(cfix->section[1]); in lru_map_move_front()
1387 status = pt_section_unmap(cfix->section[1]); in lru_map_move_front()
1390 status = pt_section_map(cfix->section[0]); in lru_map_move_front()
1393 status = pt_section_unmap(cfix->section[0]); in lru_map_move_front()
1396 ptu_ptr(cfix->iscache.lru); in lru_map_move_front()
1397 ptu_ptr_eq(cfix->iscache.lru->section, cfix->section[0]); in lru_map_move_front()
1398 ptu_ptr(cfix->iscache.lru->next); in lru_map_move_front()
1399 ptu_ptr_eq(cfix->iscache.lru->next->section, cfix->section[1]); in lru_map_move_front()
1400 ptu_null(cfix->iscache.lru->next->next); in lru_map_move_front()
1401 ptu_uint_eq(cfix->iscache.used, in lru_map_move_front()
1402 cfix->section[0]->size + cfix->section[1]->size); in lru_map_move_front()
1407 static struct ptunit_result lru_map_evict(struct iscache_fixture *cfix) in lru_map_evict() argument
1411 cfix->iscache.limit = cfix->section[0]->size + in lru_map_evict()
1412 cfix->section[1]->size - 1; in lru_map_evict()
1413 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_map_evict()
1414 ptu_null(cfix->iscache.lru); in lru_map_evict()
1416 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_map_evict()
1419 isid = pt_iscache_add(&cfix->iscache, cfix->section[1], 0xa000ull); in lru_map_evict()
1422 status = pt_section_map(cfix->section[0]); in lru_map_evict()
1425 status = pt_section_unmap(cfix->section[0]); in lru_map_evict()
1428 status = pt_section_map(cfix->section[1]); in lru_map_evict()
1431 status = pt_section_unmap(cfix->section[1]); in lru_map_evict()
1434 ptu_ptr(cfix->iscache.lru); in lru_map_evict()
1435 ptu_ptr_eq(cfix->iscache.lru->section, cfix->section[1]); in lru_map_evict()
1436 ptu_null(cfix->iscache.lru->next); in lru_map_evict()
1437 ptu_uint_eq(cfix->iscache.used, cfix->section[1]->size); in lru_map_evict()
1442 static struct ptunit_result lru_bcache_evict(struct iscache_fixture *cfix) in lru_bcache_evict() argument
1446 cfix->iscache.limit = 4 * cfix->section[0]->size + in lru_bcache_evict()
1447 cfix->section[1]->size - 1; in lru_bcache_evict()
1448 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_bcache_evict()
1449 ptu_null(cfix->iscache.lru); in lru_bcache_evict()
1451 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_bcache_evict()
1454 isid = pt_iscache_add(&cfix->iscache, cfix->section[1], 0xa000ull); in lru_bcache_evict()
1457 status = pt_section_map(cfix->section[0]); in lru_bcache_evict()
1460 status = pt_section_unmap(cfix->section[0]); in lru_bcache_evict()
1463 status = pt_section_map(cfix->section[1]); in lru_bcache_evict()
1466 status = pt_section_unmap(cfix->section[1]); in lru_bcache_evict()
1469 status = pt_section_request_bcache(cfix->section[0]); in lru_bcache_evict()
1472 ptu_ptr(cfix->iscache.lru); in lru_bcache_evict()
1473 ptu_ptr_eq(cfix->iscache.lru->section, cfix->section[0]); in lru_bcache_evict()
1474 ptu_null(cfix->iscache.lru->next); in lru_bcache_evict()
1475 ptu_uint_eq(cfix->iscache.used, 4 * cfix->section[0]->size); in lru_bcache_evict()
1480 static struct ptunit_result lru_bcache_clear(struct iscache_fixture *cfix) in lru_bcache_clear() argument
1484 cfix->iscache.limit = cfix->section[0]->size + cfix->section[1]->size; in lru_bcache_clear()
1485 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_bcache_clear()
1486 ptu_null(cfix->iscache.lru); in lru_bcache_clear()
1488 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_bcache_clear()
1491 isid = pt_iscache_add(&cfix->iscache, cfix->section[1], 0xa000ull); in lru_bcache_clear()
1494 status = pt_section_map(cfix->section[0]); in lru_bcache_clear()
1497 status = pt_section_unmap(cfix->section[0]); in lru_bcache_clear()
1500 status = pt_section_map(cfix->section[1]); in lru_bcache_clear()
1503 status = pt_section_unmap(cfix->section[1]); in lru_bcache_clear()
1506 status = pt_section_request_bcache(cfix->section[0]); in lru_bcache_clear()
1509 ptu_null(cfix->iscache.lru); in lru_bcache_clear()
1510 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_bcache_clear()
1515 static struct ptunit_result lru_limit_evict(struct iscache_fixture *cfix) in lru_limit_evict() argument
1519 cfix->iscache.limit = cfix->section[0]->size + cfix->section[1]->size; in lru_limit_evict()
1520 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_limit_evict()
1521 ptu_null(cfix->iscache.lru); in lru_limit_evict()
1523 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_limit_evict()
1526 isid = pt_iscache_add(&cfix->iscache, cfix->section[1], 0xa000ull); in lru_limit_evict()
1529 status = pt_section_map(cfix->section[0]); in lru_limit_evict()
1532 status = pt_section_unmap(cfix->section[0]); in lru_limit_evict()
1535 status = pt_section_map(cfix->section[1]); in lru_limit_evict()
1538 status = pt_section_unmap(cfix->section[1]); in lru_limit_evict()
1541 status = pt_iscache_set_limit(&cfix->iscache, in lru_limit_evict()
1542 cfix->section[0]->size + in lru_limit_evict()
1543 cfix->section[1]->size - 1); in lru_limit_evict()
1546 ptu_ptr(cfix->iscache.lru); in lru_limit_evict()
1547 ptu_ptr_eq(cfix->iscache.lru->section, cfix->section[1]); in lru_limit_evict()
1548 ptu_null(cfix->iscache.lru->next); in lru_limit_evict()
1549 ptu_uint_eq(cfix->iscache.used, cfix->section[1]->size); in lru_limit_evict()
1554 static struct ptunit_result lru_clear(struct iscache_fixture *cfix) in lru_clear() argument
1558 cfix->iscache.limit = cfix->section[0]->size; in lru_clear()
1559 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_clear()
1560 ptu_null(cfix->iscache.lru); in lru_clear()
1562 isid = pt_iscache_add(&cfix->iscache, cfix->section[0], 0xa000ull); in lru_clear()
1565 status = pt_section_map(cfix->section[0]); in lru_clear()
1568 status = pt_section_unmap(cfix->section[0]); in lru_clear()
1571 status = pt_iscache_clear(&cfix->iscache); in lru_clear()
1574 ptu_null(cfix->iscache.lru); in lru_clear()
1575 ptu_uint_eq(cfix->iscache.used, 0ull); in lru_clear()
1582 struct iscache_fixture *cfix; in worker_add() local
1585 cfix = arg; in worker_add()
1586 if (!cfix) in worker_add()
1600 isid = pt_iscache_add(&cfix->iscache, in worker_add()
1601 cfix->section[sec], laddr); in worker_add()
1605 errcode = pt_iscache_lookup(&cfix->iscache, §ion, in worker_add()
1619 if (section->offset != cfix->section[sec]->offset) in worker_add()
1622 if (section->size != cfix->section[sec]->size) in worker_add()
1636 struct iscache_fixture *cfix; in worker_add_file() local
1639 cfix = arg; in worker_add_file()
1640 if (!cfix) in worker_add_file()
1656 isid = pt_iscache_add_file(&cfix->iscache, "name", in worker_add_file()
1661 errcode = pt_iscache_lookup(&cfix->iscache, §ion, in worker_add_file()
1686 struct iscache_fixture *cfix; in worker_map() local
1689 cfix = arg; in worker_map()
1690 if (!cfix) in worker_map()
1696 status = pt_section_map(cfix->section[sec]); in worker_map()
1700 status = pt_section_unmap(cfix->section[sec]); in worker_map()
1711 struct iscache_fixture *cfix; in worker_map_limit() local
1715 cfix = arg; in worker_map_limit()
1716 if (!cfix) in worker_map_limit()
1723 errcode = pt_section_map(cfix->section[sec]); in worker_map_limit()
1727 errcode = pt_section_unmap(cfix->section[sec]); in worker_map_limit()
1738 errcode = pt_iscache_set_limit(&cfix->iscache, limit); in worker_map_limit()
1748 struct iscache_fixture *cfix; in worker_map_bcache() local
1751 cfix = arg; in worker_map_bcache()
1752 if (!cfix) in worker_map_bcache()
1759 section = cfix->section[sec]; in worker_map_bcache()
1784 struct iscache_fixture *cfix; in worker_add_map() local
1788 cfix = arg; in worker_add_map()
1789 if (!cfix) in worker_add_map()
1792 section = cfix->section[0]; in worker_add_map()
1799 isid = pt_iscache_add(&cfix->iscache, section, laddr); in worker_add_map()
1817 struct iscache_fixture *cfix; in worker_add_clear() local
1821 cfix = arg; in worker_add_clear()
1822 if (!cfix) in worker_add_clear()
1825 section = cfix->section[0]; in worker_add_clear()
1832 isid = pt_iscache_add(&cfix->iscache, section, laddr); in worker_add_clear()
1836 errcode = pt_iscache_clear(&cfix->iscache); in worker_add_clear()
1846 struct iscache_fixture *cfix; in worker_add_file_map() local
1849 cfix = arg; in worker_add_file_map()
1850 if (!cfix) in worker_add_file_map()
1862 isid = pt_iscache_add_file(&cfix->iscache, "name", in worker_add_file_map()
1867 errcode = pt_iscache_lookup(&cfix->iscache, §ion, in worker_add_file_map()
1889 struct iscache_fixture *cfix; in worker_add_file_clear() local
1892 cfix = arg; in worker_add_file_clear()
1893 if (!cfix) in worker_add_file_clear()
1904 isid = pt_iscache_add_file(&cfix->iscache, "name", in worker_add_file_clear()
1912 errcode = pt_iscache_clear(&cfix->iscache); in worker_add_file_clear()
1920 static struct ptunit_result stress(struct iscache_fixture *cfix, in stress() argument
1930 ptu_test(ptunit_thrd_create, &cfix->thrd, worker, cfix); in stress()
1934 errcode = worker(cfix); in stress()
1941 struct iscache_fixture cfix, dfix, sfix; in main() local
1944 cfix.init = cfix_init; in main()
1945 cfix.fini = cfix_fini; in main()
1969 ptu_run_f(suite, init_fini, cfix); in main()
1970 ptu_run_f(suite, add, cfix); in main()
1971 ptu_run_f(suite, add_no_name, cfix); in main()
1972 ptu_run_f(suite, add_file, cfix); in main()
1974 ptu_run_f(suite, find, cfix); in main()
1975 ptu_run_f(suite, find_empty, cfix); in main()
1976 ptu_run_f(suite, find_bad_filename, cfix); in main()
1977 ptu_run_f(suite, find_null_filename, cfix); in main()
1978 ptu_run_f(suite, find_bad_offset, cfix); in main()
1979 ptu_run_f(suite, find_bad_size, cfix); in main()
1980 ptu_run_f(suite, find_bad_laddr, cfix); in main()
1982 ptu_run_f(suite, lookup, cfix); in main()
1983 ptu_run_f(suite, lookup_bad_isid, cfix); in main()
1985 ptu_run_f(suite, clear_empty, cfix); in main()
1986 ptu_run_f(suite, clear_find, cfix); in main()
1987 ptu_run_f(suite, clear_lookup, cfix); in main()
1989 ptu_run_f(suite, add_twice, cfix); in main()
1990 ptu_run_f(suite, add_same, cfix); in main()
1991 ptu_run_f(suite, add_twice_different_laddr, cfix); in main()
1992 ptu_run_f(suite, add_same_different_laddr, cfix); in main()
1993 ptu_run_f(suite, add_different_same_laddr, cfix); in main()
1995 ptu_run_f(suite, add_file_same, cfix); in main()
1996 ptu_run_f(suite, add_file_same_different_laddr, cfix); in main()
1997 ptu_run_f(suite, add_file_different_same_laddr, cfix); in main()
1999 ptu_run_f(suite, read, cfix); in main()
2000 ptu_run_f(suite, read_truncate, cfix); in main()
2001 ptu_run_f(suite, read_bad_vaddr, cfix); in main()
2002 ptu_run_f(suite, read_bad_isid, cfix); in main()
2004 ptu_run_f(suite, lru_map, cfix); in main()
2005 ptu_run_f(suite, lru_read, cfix); in main()
2006 ptu_run_f(suite, lru_map_nodup, cfix); in main()
2007 ptu_run_f(suite, lru_map_too_big, cfix); in main()
2008 ptu_run_f(suite, lru_map_add_front, cfix); in main()
2009 ptu_run_f(suite, lru_map_move_front, cfix); in main()
2010 ptu_run_f(suite, lru_map_evict, cfix); in main()
2011 ptu_run_f(suite, lru_limit_evict, cfix); in main()
2012 ptu_run_f(suite, lru_bcache_evict, cfix); in main()
2013 ptu_run_f(suite, lru_bcache_clear, cfix); in main()
2014 ptu_run_f(suite, lru_clear, cfix); in main()
2016 ptu_run_fp(suite, stress, cfix, worker_add); in main()
2017 ptu_run_fp(suite, stress, cfix, worker_add_file); in main()
2021 ptu_run_fp(suite, stress, cfix, worker_add_map); in main()
2022 ptu_run_fp(suite, stress, cfix, worker_add_clear); in main()
2023 ptu_run_fp(suite, stress, cfix, worker_add_file_map); in main()
2024 ptu_run_fp(suite, stress, cfix, worker_add_file_clear); in main()