Lines Matching refs:fdp

64 static TEE_Result out_of_place_write(struct tee_fs_fd *fdp, size_t pos,  in out_of_place_write()  argument
73 struct tee_fs_htree_meta *meta = tee_fs_htree_get_meta(fdp->ht); in out_of_place_write()
96 res = tee_fs_htree_read_block(&fdp->ht, in out_of_place_write()
109 res = tee_fs_htree_write_block(&fdp->ht, start_block_num, in out_of_place_write()
123 tee_fs_htree_meta_set_dirty(fdp->ht); in out_of_place_write()
220 struct tee_fs_fd *fdp = aux; in ree_fs_rpc_read_init() local
229 return tee_fs_rpc_read_init(op, OPTEE_RPC_CMD_FS, fdp->fd, in ree_fs_rpc_read_init()
238 struct tee_fs_fd *fdp = aux; in ree_fs_rpc_write_init() local
247 return tee_fs_rpc_write_init(op, OPTEE_RPC_CMD_FS, fdp->fd, in ree_fs_rpc_write_init()
259 static TEE_Result ree_fs_ftruncate_internal(struct tee_fs_fd *fdp, in ree_fs_ftruncate_internal() argument
263 struct tee_fs_htree_meta *meta = tee_fs_htree_get_meta(fdp->ht); in ree_fs_ftruncate_internal()
268 res = out_of_place_write(fdp, meta->length, NULL, ext_len); in ree_fs_ftruncate_internal()
281 res = tee_fs_htree_truncate(&fdp->ht, in ree_fs_ftruncate_internal()
286 res = tee_fs_rpc_truncate(OPTEE_RPC_CMD_FS, fdp->fd, in ree_fs_ftruncate_internal()
292 tee_fs_htree_meta_set_dirty(fdp->ht); in ree_fs_ftruncate_internal()
307 struct tee_fs_fd *fdp = (struct tee_fs_fd *)fh; in ree_fs_read_primitive() local
308 struct tee_fs_htree_meta *meta = tee_fs_htree_get_meta(fdp->ht); in ree_fs_read_primitive()
339 res = tee_fs_htree_read_block(&fdp->ht, start_block_num, block); in ree_fs_read_primitive()
374 struct tee_fs_fd *fdp = (struct tee_fs_fd *)fh; in ree_fs_write_primitive() local
380 file_size = tee_fs_htree_get_meta(fdp->ht)->length; in ree_fs_write_primitive()
386 res = ree_fs_ftruncate_internal(fdp, pos); in ree_fs_write_primitive()
391 return out_of_place_write(fdp, pos, buf, len); in ree_fs_write_primitive()
400 struct tee_fs_fd *fdp; in ree_fs_open_primitive() local
402 fdp = calloc(1, sizeof(struct tee_fs_fd)); in ree_fs_open_primitive()
403 if (!fdp) in ree_fs_open_primitive()
405 fdp->fd = -1; in ree_fs_open_primitive()
406 fdp->uuid = uuid; in ree_fs_open_primitive()
410 dfh, &fdp->fd); in ree_fs_open_primitive()
412 res = tee_fs_rpc_open_dfh(OPTEE_RPC_CMD_FS, dfh, &fdp->fd); in ree_fs_open_primitive()
418 fdp, &fdp->ht); in ree_fs_open_primitive()
422 fdp->dfh = *dfh; in ree_fs_open_primitive()
424 fdp->dfh.idx = -1; in ree_fs_open_primitive()
425 *fh = (struct tee_file_handle *)fdp; in ree_fs_open_primitive()
429 if (fdp->fd != -1) in ree_fs_open_primitive()
430 tee_fs_rpc_close(OPTEE_RPC_CMD_FS, fdp->fd); in ree_fs_open_primitive()
433 free(fdp); in ree_fs_open_primitive()
441 struct tee_fs_fd *fdp = (struct tee_fs_fd *)fh; in ree_fs_close_primitive() local
443 if (fdp) { in ree_fs_close_primitive()
444 tee_fs_htree_close(&fdp->ht); in ree_fs_close_primitive()
445 tee_fs_rpc_close(OPTEE_RPC_CMD_FS, fdp->fd); in ree_fs_close_primitive()
446 free(fdp); in ree_fs_close_primitive()
454 struct tee_fs_fd *fdp = (struct tee_fs_fd *)fh; in ree_dirf_commit_writes() local
456 res = tee_fs_htree_sync_to_storage(&fdp->ht, fdp->dfh.hash); in ree_dirf_commit_writes()
459 memcpy(hash, fdp->dfh.hash, sizeof(fdp->dfh.hash)); in ree_dirf_commit_writes()
643 struct tee_fs_fd *fdp = (struct tee_fs_fd *)*fh; in ree_fs_open() local
645 *size = tee_fs_htree_get_meta(fdp->ht)->length; in ree_fs_open()
657 struct tee_fs_fd *fdp, struct tee_pobj *po, in set_name() argument
676 fdp->dfh.idx = old_dfh.idx; in set_name()
678 res = tee_fs_dirfile_rename(dirh, &po->uuid, &fdp->dfh, in set_name()
711 struct tee_fs_fd *fdp; in ree_fs_create() local
752 fdp = (struct tee_fs_fd *)*fh; in ree_fs_create()
753 res = tee_fs_htree_sync_to_storage(&fdp->ht, fdp->dfh.hash); in ree_fs_create()
757 res = set_name(dirh, fdp, po, overwrite); in ree_fs_create()
777 struct tee_fs_fd *fdp = (struct tee_fs_fd *)fh; in ree_fs_write() local
789 res = tee_fs_htree_sync_to_storage(&fdp->ht, fdp->dfh.hash); in ree_fs_write()
793 res = tee_fs_dirfile_update_hash(dirh, &fdp->dfh); in ree_fs_write()
897 struct tee_fs_fd *fdp = (struct tee_fs_fd *)fh; in ree_fs_truncate() local
905 res = ree_fs_ftruncate_internal(fdp, len); in ree_fs_truncate()
909 res = tee_fs_htree_sync_to_storage(&fdp->ht, fdp->dfh.hash); in ree_fs_truncate()
913 res = tee_fs_dirfile_update_hash(dirh, &fdp->dfh); in ree_fs_truncate()