Rename read syscall, vfs_read and so to xxx_read_file

This commit is contained in:
2026-03-01 00:29:04 +01:00
parent 0533c2705d
commit a3b98fcaa2
12 changed files with 41 additions and 41 deletions

View File

@@ -164,8 +164,8 @@ int fatfs_describe (struct vfs_volume* volume, const char* path, struct desc* de
return ST_OK;
}
int fatfs_read (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
int fatfs_read_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
struct fatfs_ctx* fatfs_ctx = volume->udata;
FL_FILE* file = fl_fopen (fatfs_ctx, path, "wb+");
@@ -181,8 +181,8 @@ int fatfs_read (struct vfs_volume* volume, const char* path, uint8_t* buffer, si
return ST_OK;
}
int fatfs_write (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
int fatfs_write_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
struct fatfs_ctx* fatfs_ctx = volume->udata;
FL_FILE* file = fl_fopen (fatfs_ctx, path, "wb+");

View File

@@ -18,11 +18,11 @@ int fatfs32_format (struct vfs_volume* volume);
int fatfs_describe (struct vfs_volume* volume, const char* path, struct desc* desc);
int fatfs_read (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int fatfs_read_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int fatfs_write (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int fatfs_write_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int fatfs_read_dir_entry (struct vfs_volume* volume, const char* path, struct dir_entry* entry,
size_t entry_num);

View File

@@ -150,8 +150,8 @@ int tarfs_describe (struct vfs_volume* volume, const char* path, struct desc* de
}
}
int tarfs_read (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
int tarfs_read_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
(void)volume;
const char* filename = path_basename (path);
@@ -196,8 +196,8 @@ int tarfs_read_dir_entry (struct vfs_volume* volume, const char* path, struct di
return ST_DIR_NO_ENTRIES;
}
int tarfs_write (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
int tarfs_write_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
(void)volume, (void)path, (void)buffer, (void)off, (void)size;
return ST_OK;
}

View File

@@ -40,11 +40,11 @@ int tarfs_format (struct vfs_volume* volume);
int tarfs_describe (struct vfs_volume* volume, const char* path, struct desc* desc);
int tarfs_read (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int tarfs_read_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int tarfs_write (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int tarfs_write_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int tarfs_read_dir_entry (struct vfs_volume* volume, const char* path, struct dir_entry* entry,
size_t entry_num);

View File

@@ -57,24 +57,24 @@ int vfs_create_volume (const char* key, int fs_type, struct device* back_device)
volume->driver_ops.mount = &tarfs_mount;
volume->driver_ops.format = &tarfs_format;
volume->driver_ops.describe = &tarfs_describe;
volume->driver_ops.read = &tarfs_read;
volume->driver_ops.write = &tarfs_write;
volume->driver_ops.read_file = &tarfs_read_file;
volume->driver_ops.write_file = &tarfs_write_file;
volume->driver_ops.read_dir_entry = &tarfs_read_dir_entry;
break;
case VFS_FAT16:
volume->driver_ops.mount = &fatfs_mount;
volume->driver_ops.format = &fatfs16_format;
volume->driver_ops.describe = &fatfs_describe;
volume->driver_ops.read = &fatfs_read;
volume->driver_ops.write = &fatfs_write;
volume->driver_ops.read_file = &fatfs_read_file;
volume->driver_ops.write_file = &fatfs_write_file;
volume->driver_ops.read_dir_entry = &fatfs_read_dir_entry;
break;
case VFS_FAT32:
volume->driver_ops.mount = &fatfs_mount;
volume->driver_ops.format = &fatfs32_format;
volume->driver_ops.describe = &fatfs_describe;
volume->driver_ops.read = &fatfs_read;
volume->driver_ops.write = &fatfs_write;
volume->driver_ops.read_file = &fatfs_read_file;
volume->driver_ops.write_file = &fatfs_write_file;
volume->driver_ops.read_dir_entry = &fatfs_read_dir_entry;
break;
default:
@@ -183,8 +183,8 @@ int vfs_format (struct proc* proc, const char* volume_name) {
return volume->driver_ops.format (volume);
}
int vfs_read (struct proc* proc, const char* volume_name, const char* path, uint8_t* buffer,
size_t off, size_t size) {
int vfs_read_file (struct proc* proc, const char* volume_name, const char* path, uint8_t* buffer,
size_t off, size_t size) {
struct vfs_volume* volume = vfs_find_volume (volume_name);
if (volume == NULL)
@@ -199,7 +199,7 @@ int vfs_read (struct proc* proc, const char* volume_name, const char* path, uint
spin_unlock (&volume->lock);
return volume->driver_ops.read (volume, path, buffer, off, size);
return volume->driver_ops.read_file (volume, path, buffer, off, size);
}
int vfs_describe (struct proc* proc, const char* volume_name, const char* path, struct desc* desc) {

View File

@@ -38,11 +38,11 @@ struct vfs_volume {
int (*describe) (struct vfs_volume* volume, const char* path, struct desc* desc);
int (*read) (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int (*read_file) (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int (*write) (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int (*write_file) (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int (*read_dir_entry) (struct vfs_volume* volume, const char* path, struct dir_entry* entry,
size_t entry_num);
@@ -64,8 +64,8 @@ int vfs_volume_close (struct proc* proc, const char* volume, struct reschedule_c
int vfs_format (struct proc* proc, const char* volume_name);
int vfs_read (struct proc* proc, const char* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int vfs_read_file (struct proc* proc, const char* volume, const char* path, uint8_t* buffer,
size_t off, size_t size);
int vfs_describe (struct proc* proc, const char* volume, const char* path, struct desc* desc);