Lines Matching refs:idx

54 static TEE_Result maybe_grow_files(struct tee_fs_dirfile_dirh *dirh, int idx)  in maybe_grow_files()  argument
58 if (idx < dirh->nbits) in maybe_grow_files()
61 p = realloc(dirh->files, bitstr_size(idx + 1)); in maybe_grow_files()
66 bit_nclear(dirh->files, dirh->nbits, idx); in maybe_grow_files()
67 dirh->nbits = idx + 1; in maybe_grow_files()
72 static TEE_Result set_file(struct tee_fs_dirfile_dirh *dirh, int idx) in set_file() argument
74 TEE_Result res = maybe_grow_files(dirh, idx); in set_file()
77 bit_set(dirh->files, idx); in set_file()
82 static void clear_file(struct tee_fs_dirfile_dirh *dirh, int idx) in clear_file() argument
84 if (idx < dirh->nbits) in clear_file()
85 bit_clear(dirh->files, idx); in clear_file()
88 static bool test_file(struct tee_fs_dirfile_dirh *dirh, int idx) in test_file() argument
90 if (idx < dirh->nbits) in test_file()
91 return bit_test(dirh->files, idx); in test_file()
96 static TEE_Result read_dent(struct tee_fs_dirfile_dirh *dirh, int idx, in read_dent() argument
103 res = dirh->fops->read(dirh->fh, sizeof(struct dirfile_entry) * idx, in read_dent()
237 dfh->idx = n; in tee_fs_dirfile_find()
245 static TEE_Result find_empty_idx(struct tee_fs_dirfile_dirh *dh, int *idx) in find_empty_idx() argument
261 *idx = n; in find_empty_idx()
307 if (dfh->idx < 0) { in tee_fs_dirfile_rename()
313 res = find_empty_idx(dirh, &dfh2.idx); in tee_fs_dirfile_rename()
317 dfh->idx = dfh2.idx; in tee_fs_dirfile_rename()
320 return write_dent(dirh, dfh->idx, &dent); in tee_fs_dirfile_rename()
330 res = read_dent(dirh, dfh->idx, &dent); in tee_fs_dirfile_remove()
342 res = write_dent(dirh, dfh->idx, &dent); in tee_fs_dirfile_remove()
355 res = read_dent(dirh, dfh->idx, &dent); in tee_fs_dirfile_update_hash()
363 return write_dent(dirh, dfh->idx, &dent); in tee_fs_dirfile_update_hash()
367 const TEE_UUID *uuid, int *idx, void *oid, in tee_fs_dirfile_get_next() argument
371 int i = *idx + 1; in tee_fs_dirfile_get_next()
391 *idx = i; in tee_fs_dirfile_get_next()