Rename kos_fuse_lfn to kos_lfn, remove kos_fuse_init prototype.

This commit is contained in:
2019-10-22 06:12:35 +03:00
parent 68454dbe4d
commit adc3e553f7
4 changed files with 12 additions and 14 deletions

12
kofu.c
View File

@@ -119,7 +119,7 @@ void ls_range(f70s1arg_t *f70) {
if (f70->size > requested) { if (f70->size > requested) {
f70->size = requested; f70->size = requested;
} }
kos_fuse_lfn(f70, &r); kos_lfn(f70, &r);
f70->offset += f70->size; f70->offset += f70->size;
printf("status = %d, count = %d\n", r.status, r.count); printf("status = %d, count = %d\n", r.status, r.count);
f70s1info_t *dir = f70->buf; f70s1info_t *dir = f70->buf;
@@ -145,7 +145,7 @@ void ls_range(f70s1arg_t *f70) {
void ls_all(f70s1arg_t *f70) { void ls_all(f70s1arg_t *f70) {
f70ret_t r; f70ret_t r;
while (true) { while (true) {
kos_fuse_lfn(f70, &r); kos_lfn(f70, &r);
printf("status = %d, count = %d\n", r.status, r.count); printf("status = %d, count = %d\n", r.status, r.count);
if (r.status != F70_SUCCESS && r.status != F70_END_OF_FILE) { if (r.status != F70_SUCCESS && r.status != F70_END_OF_FILE) {
abort(); abort();
@@ -189,7 +189,7 @@ void kofu_stat(int argc, const char **argv) {
bdfe_t file; bdfe_t file;
f70.buf = &file; f70.buf = &file;
f70.path = argv[1]; f70.path = argv[1];
kos_fuse_lfn(&f70, &r); kos_lfn(&f70, &r);
printf("attr: 0x%2.2x\n", file.attr); printf("attr: 0x%2.2x\n", file.attr);
printf("size: %llu\n", file.size); printf("size: %llu\n", file.size);
return; return;
@@ -207,7 +207,7 @@ void read_range(struct f70s0arg *f70) {
if (f70->size > requested) { if (f70->size > requested) {
f70->size = requested; f70->size = requested;
} }
kos_fuse_lfn(f70, &r); kos_lfn(f70, &r);
f70->offset_lo += f70->size; f70->offset_lo += f70->size;
printf("status = %d, count = %d\n", r.status, r.count); printf("status = %d, count = %d\n", r.status, r.count);
assert((r.status == F70_SUCCESS && r.count == f70->size) || 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) { void read_all(struct f70s0arg *f70) {
f70ret r; f70ret r;
while (true) { while (true) {
kos_fuse_lfn(f70, &r); kos_lfn(f70, &r);
f70->offset_lo += f70->size; f70->offset_lo += f70->size;
printf("status = %d, count = %d\n", r.status, r.count); printf("status = %d, count = %d\n", r.status, r.count);
assert((r.status == F70_SUCCESS && r.count == f70->size) || 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); 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) || assert((r.status == F70_SUCCESS && r.count == f70.count) ||
(r.status == F70_END_OF_FILE && r.count < f70.count)); (r.status == F70_END_OF_FILE && r.count < f70.count));

View File

@@ -65,7 +65,7 @@ static int kofuse_getattr(const char *path, struct stat *stbuf,
bdfe_t file; bdfe_t file;
f70s5arg_t f70 = {.sf = 5, .flags = 0, .buf = &file, .zero = 0, .path = path}; f70s5arg_t f70 = {.sf = 5, .flags = 0, .buf = &file, .zero = 0, .path = path};
f70ret_t r; f70ret_t r;
kos_fuse_lfn(&f70, &r); kos_lfn(&f70, &r);
bdfe_to_stat(&file, stbuf); bdfe_to_stat(&file, stbuf);
// res = -ENOENT; // 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); 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}; f70s1arg_t f70 = {1, 0, CP866, DIRENTS_TO_READ, dir, 0, path};
f70ret_t r; f70ret_t r;
kos_fuse_lfn(&f70, &r); kos_lfn(&f70, &r);
for (size_t i = 0; i < dir->cnt; i++) { for (size_t i = 0; i < dir->cnt; i++) {
filler(buf, dir->bdfes[i].name, NULL, 0, 0); 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}; f70s0arg_t f70 = {.sf = 0, .offset = offset, .count = size, .buf = buf, .zero = 0, .path = path};
f70ret_t r; f70ret_t r;
kos_fuse_lfn(&f70, &r); kos_lfn(&f70, &r);
return size; return size;
} }

View File

@@ -170,8 +170,8 @@ proc kos_disk_del c uses ebx esi edi ebp, _name
endp endp
public kos_fuse_lfn public kos_lfn
proc kos_fuse_lfn c uses ebx edx esi edi ebp, _f70arg, _f70ret proc kos_lfn c uses ebx edx esi edi ebp, _f70arg, _f70ret
push ebx push ebx
mov ebx, [_f70arg] mov ebx, [_f70arg]
pushad ; file_system_lfn writes here pushad ; file_system_lfn writes here

View File

@@ -95,10 +95,8 @@ typedef struct {
} hash_context; } hash_context;
uint32_t kos_time_to_epoch(uint32_t *time); 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_init(void);
void kos_lfn(void *f70sXarg, f70ret_t *r);
void *kos_disk_add(const char *file_name, const char *disk_name); void *kos_disk_add(const char *file_name, const char *disk_name);
int kos_disk_del(const char *name); int kos_disk_del(const char *name);