From adc3e553f7da11cdc344b9a00e9f696dba7642c0 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Tue, 22 Oct 2019 06:12:35 +0300 Subject: [PATCH] Rename kos_fuse_lfn to kos_lfn, remove kos_fuse_init prototype. --- kofu.c | 12 ++++++------ kofuse.c | 6 +++--- kolibri.asm | 4 ++-- kolibri.h | 4 +--- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/kofu.c b/kofu.c index c817449..21538a7 100644 --- a/kofu.c +++ b/kofu.c @@ -119,7 +119,7 @@ void ls_range(f70s1arg_t *f70) { if (f70->size > requested) { f70->size = requested; } - kos_fuse_lfn(f70, &r); + kos_lfn(f70, &r); f70->offset += f70->size; printf("status = %d, count = %d\n", r.status, r.count); f70s1info_t *dir = f70->buf; @@ -145,7 +145,7 @@ void ls_range(f70s1arg_t *f70) { void ls_all(f70s1arg_t *f70) { f70ret_t r; while (true) { - kos_fuse_lfn(f70, &r); + kos_lfn(f70, &r); printf("status = %d, count = %d\n", r.status, r.count); if (r.status != F70_SUCCESS && r.status != F70_END_OF_FILE) { abort(); @@ -189,7 +189,7 @@ void kofu_stat(int argc, const char **argv) { bdfe_t file; f70.buf = &file; f70.path = argv[1]; - kos_fuse_lfn(&f70, &r); + kos_lfn(&f70, &r); printf("attr: 0x%2.2x\n", file.attr); printf("size: %llu\n", file.size); return; @@ -207,7 +207,7 @@ void read_range(struct f70s0arg *f70) { if (f70->size > requested) { f70->size = requested; } - kos_fuse_lfn(f70, &r); + kos_lfn(f70, &r); f70->offset_lo += f70->size; printf("status = %d, count = %d\n", r.status, r.count); assert((r.status == F70_SUCCESS && r.count == f70->size) || @@ -225,7 +225,7 @@ void read_range(struct f70s0arg *f70) { void read_all(struct f70s0arg *f70) { f70ret r; while (true) { - kos_fuse_lfn(f70, &r); + kos_lfn(f70, &r); f70->offset_lo += f70->size; printf("status = %d, count = %d\n", r.status, r.count); assert((r.status == F70_SUCCESS && r.count == f70->size) || @@ -273,7 +273,7 @@ void kofu_read(int argc, const char **argv) { } f70.buf = (uint8_t*)malloc(f70.count); - kos_fuse_lfn(&f70, &r); + kos_lfn(&f70, &r); assert((r.status == F70_SUCCESS && r.count == f70.count) || (r.status == F70_END_OF_FILE && r.count < f70.count)); diff --git a/kofuse.c b/kofuse.c index 92f8231..ad224f8 100644 --- a/kofuse.c +++ b/kofuse.c @@ -65,7 +65,7 @@ static int kofuse_getattr(const char *path, struct stat *stbuf, bdfe_t file; f70s5arg_t f70 = {.sf = 5, .flags = 0, .buf = &file, .zero = 0, .path = path}; f70ret_t r; - kos_fuse_lfn(&f70, &r); + kos_lfn(&f70, &r); bdfe_to_stat(&file, stbuf); // res = -ENOENT; @@ -82,7 +82,7 @@ static int kofuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, f70s1info_t *dir = (f70s1info_t*)malloc(sizeof(f70s1info_t) + sizeof(bdfe_t) * DIRENTS_TO_READ); f70s1arg_t f70 = {1, 0, CP866, DIRENTS_TO_READ, dir, 0, path}; f70ret_t r; - kos_fuse_lfn(&f70, &r); + kos_lfn(&f70, &r); for (size_t i = 0; i < dir->cnt; i++) { filler(buf, dir->bdfes[i].name, NULL, 0, 0); } @@ -107,7 +107,7 @@ static int kofuse_read(const char *path, char *buf, size_t size, off_t offset, f70s0arg_t f70 = {.sf = 0, .offset = offset, .count = size, .buf = buf, .zero = 0, .path = path}; f70ret_t r; - kos_fuse_lfn(&f70, &r); + kos_lfn(&f70, &r); return size; } diff --git a/kolibri.asm b/kolibri.asm index 978d5f1..673d398 100644 --- a/kolibri.asm +++ b/kolibri.asm @@ -170,8 +170,8 @@ proc kos_disk_del c uses ebx esi edi ebp, _name endp -public kos_fuse_lfn -proc kos_fuse_lfn c uses ebx edx esi edi ebp, _f70arg, _f70ret +public kos_lfn +proc kos_lfn c uses ebx edx esi edi ebp, _f70arg, _f70ret push ebx mov ebx, [_f70arg] pushad ; file_system_lfn writes here diff --git a/kolibri.h b/kolibri.h index 031f19e..3992195 100644 --- a/kolibri.h +++ b/kolibri.h @@ -95,10 +95,8 @@ typedef struct { } hash_context; uint32_t kos_time_to_epoch(uint32_t *time); -void *kos_fuse_init(int fd, uint32_t sect_cnt, uint32_t sect_sz); -void kos_fuse_lfn(void *f70sXarg, f70ret_t *r); - void kos_init(void); +void kos_lfn(void *f70sXarg, f70ret_t *r); void *kos_disk_add(const char *file_name, const char *disk_name); int kos_disk_del(const char *name);