Lines Matching refs:res
96 TEE_Result res = TEE_SUCCESS; in test_read_init() local
101 res = test_get_offs_size(type, idx, vers, &offs, &sz); in test_read_init()
102 if (res == TEE_SUCCESS) { in test_read_init()
110 return res; in test_read_init()
170 #define CHECK_RES(res, cleanup) \ argument
172 TEE_Result _res = (res); \
200 TEE_Result res = TEE_SUCCESS; in read_block() local
204 res = tee_fs_htree_read_block(ht, bn, b); in read_block()
205 if (res != TEE_SUCCESS) in read_block()
206 return res; in read_block()
225 TEE_Result res = TEE_SUCCESS; in do_range() local
229 res = fn(ht, n + begin, salt); in do_range()
230 CHECK_RES(res, goto out); in do_range()
234 return res; in do_range()
242 TEE_Result res = TEE_SUCCESS; in do_range_backwards() local
246 res = fn(ht, num_blocks - 1 - n + begin, salt); in do_range_backwards()
247 CHECK_RES(res, goto out); in do_range_backwards()
251 return res; in do_range_backwards()
259 TEE_Result res = TEE_SUCCESS; in htree_test_rewrite() local
269 res = tee_fs_htree_open(true, hash, 0, uuid, &test_htree_ops, aux, &ht); in htree_test_rewrite()
270 CHECK_RES(res, goto out); in htree_test_rewrite()
276 res = do_range(write_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
277 CHECK_RES(res, goto out); in htree_test_rewrite()
279 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
280 CHECK_RES(res, goto out); in htree_test_rewrite()
287 res = do_range_backwards(write_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
288 CHECK_RES(res, goto out); in htree_test_rewrite()
290 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
291 CHECK_RES(res, goto out); in htree_test_rewrite()
298 res = do_range(write_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
299 CHECK_RES(res, goto out); in htree_test_rewrite()
301 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
302 CHECK_RES(res, goto out); in htree_test_rewrite()
308 res = tee_fs_htree_sync_to_storage(&ht, hash, NULL); in htree_test_rewrite()
309 CHECK_RES(res, goto out); in htree_test_rewrite()
311 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
312 CHECK_RES(res, goto out); in htree_test_rewrite()
318 res = tee_fs_htree_open(false, hash, 0, uuid, &test_htree_ops, aux, in htree_test_rewrite()
320 CHECK_RES(res, goto out); in htree_test_rewrite()
325 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
326 CHECK_RES(res, goto out); in htree_test_rewrite()
332 res = do_range_backwards(write_block, &ht, w_unsync_begin, w_unsync_num, in htree_test_rewrite()
334 CHECK_RES(res, goto out); in htree_test_rewrite()
336 res = do_range(read_block, &ht, 0, w_unsync_begin, salt); in htree_test_rewrite()
337 CHECK_RES(res, goto out); in htree_test_rewrite()
338 res = do_range(read_block, &ht, w_unsync_begin, w_unsync_num, salt + 1); in htree_test_rewrite()
339 CHECK_RES(res, goto out); in htree_test_rewrite()
340 res = do_range(read_block, &ht, w_unsync_begin + w_unsync_num, in htree_test_rewrite()
342 CHECK_RES(res, goto out); in htree_test_rewrite()
348 res = do_range(write_block, &ht, w_unsync_begin, w_unsync_num, in htree_test_rewrite()
350 CHECK_RES(res, goto out); in htree_test_rewrite()
352 res = do_range(read_block, &ht, 0, w_unsync_begin, salt); in htree_test_rewrite()
353 CHECK_RES(res, goto out); in htree_test_rewrite()
354 res = do_range(read_block, &ht, w_unsync_begin, w_unsync_num, salt + 2); in htree_test_rewrite()
355 CHECK_RES(res, goto out); in htree_test_rewrite()
356 res = do_range(read_block, &ht, w_unsync_begin + w_unsync_num, in htree_test_rewrite()
358 CHECK_RES(res, goto out); in htree_test_rewrite()
367 res = tee_fs_htree_open(false, hash, 0, uuid, &test_htree_ops, aux, in htree_test_rewrite()
369 CHECK_RES(res, goto out); in htree_test_rewrite()
371 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
372 CHECK_RES(res, goto out); in htree_test_rewrite()
380 res = tee_fs_htree_open(false, NULL, 0, uuid, &test_htree_ops, aux, in htree_test_rewrite()
382 CHECK_RES(res, goto out); in htree_test_rewrite()
384 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
385 CHECK_RES(res, goto out); in htree_test_rewrite()
393 if (res == TEE_ERROR_TIME_NOT_SET) in htree_test_rewrite()
394 res = TEE_ERROR_SECURITY; in htree_test_rewrite()
395 return res; in htree_test_rewrite()
439 TEE_Result res = TEE_SUCCESS; in test_write_read() local
457 res = htree_test_rewrite(aux, n, m, o); in test_write_read()
458 CHECK_RES(res, goto out); in test_write_read()
466 return res; in test_write_read()
473 TEE_Result res = TEE_SUCCESS; in test_corrupt_type() local
481 res = test_get_offs_size(type, idx, 0, &offs, &size0); in test_corrupt_type()
482 CHECK_RES(res, return res); in test_corrupt_type()
492 res = test_get_offs_size(type, idx, 0, &offs, &size); in test_corrupt_type()
493 CHECK_RES(res, goto out); in test_corrupt_type()
495 res = test_get_offs_size(type, idx, 1, &offs, &size); in test_corrupt_type()
496 CHECK_RES(res, goto out); in test_corrupt_type()
504 res = tee_fs_htree_open(false, hash, 0, uuid, &test_htree_ops, in test_corrupt_type()
506 if (!res) { in test_corrupt_type()
507 res = do_range(read_block, &ht, 0, num_blocks, 1); in test_corrupt_type()
519 if (res == TEE_ERROR_TIME_NOT_SET) { in test_corrupt_type()
521 res = TEE_ERROR_SECURITY; in test_corrupt_type()
524 if (!res) in test_corrupt_type()
544 if (res) { in test_corrupt_type()
545 res = TEE_SUCCESS; in test_corrupt_type()
548 res = TEE_ERROR_SECURITY; in test_corrupt_type()
553 return res; in test_corrupt_type()
562 TEE_Result res = TEE_SUCCESS; in test_corrupt() local
570 res = TEE_ERROR_OUT_OF_MEMORY; in test_corrupt()
578 res = tee_fs_htree_open(true, hash, 0, uuid, &test_htree_ops, aux, &ht); in test_corrupt()
579 CHECK_RES(res, goto out); in test_corrupt()
580 res = do_range(write_block, &ht, 0, num_blocks, 1); in test_corrupt()
581 CHECK_RES(res, goto out); in test_corrupt()
582 res = tee_fs_htree_sync_to_storage(&ht, hash, NULL); in test_corrupt()
583 CHECK_RES(res, goto out); in test_corrupt()
587 res = tee_fs_htree_open(false, hash, 0, uuid, &test_htree_ops, aux, in test_corrupt()
589 CHECK_RES(res, goto out); in test_corrupt()
590 res = do_range(read_block, &ht, 0, num_blocks, 1); in test_corrupt()
591 CHECK_RES(res, goto out); in test_corrupt()
594 res = test_corrupt_type(uuid, hash, num_blocks, aux, in test_corrupt()
596 CHECK_RES(res, goto out); in test_corrupt()
598 res = test_corrupt_type(uuid, hash, num_blocks, aux, in test_corrupt()
600 CHECK_RES(res, goto out); in test_corrupt()
603 res = test_corrupt_type(uuid, hash, num_blocks, aux, in test_corrupt()
605 CHECK_RES(res, goto out); in test_corrupt()
611 return res; in test_corrupt()
617 TEE_Result res = TEE_SUCCESS; in core_fs_htree_tests() local
622 res = test_write_read(10); in core_fs_htree_tests()
623 if (res) in core_fs_htree_tests()
624 return res; in core_fs_htree_tests()