diff --git a/ce/ce.c b/ce/ce.c index 9985318..1f7f6f6 100644 --- a/ce/ce.c +++ b/ce/ce.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -67,7 +67,7 @@ static void cmd_cat (struct list_node_link* tokens) { return; } - struct fs_desc_buffer desc; + struct desc desc; struct list_node_link *token_link, *token_tmp_link; list_foreach (tokens, token_link, token_tmp_link) { diff --git a/include/fs_desc_buffer.h b/include/desc.h similarity index 88% rename from include/fs_desc_buffer.h rename to include/desc.h index 67a8983..a709d83 100644 --- a/include/fs_desc_buffer.h +++ b/include/desc.h @@ -6,7 +6,7 @@ #define FS_FILE 0 #define FS_DIR 1 -struct fs_desc_buffer { +struct desc { int type; size_t size; }; diff --git a/kernel/fs/tarfs.c b/kernel/fs/tarfs.c index f898dee..78c8ac5 100644 --- a/kernel/fs/tarfs.c +++ b/kernel/fs/tarfs.c @@ -1,7 +1,7 @@ +#include #include #include #include -#include #include #include #include @@ -103,8 +103,7 @@ int tarfs_mount (struct vfs_mountpoint* mountpoint, struct proc* proc, return ret; } -int tarfs_describe (struct vfs_mountpoint* mountpoint, const char* path, - struct fs_desc_buffer* desc) { +int tarfs_describe (struct vfs_mountpoint* mountpoint, const char* path, struct desc* desc) { (void)mountpoint; const char* filename = path_basename (path); diff --git a/kernel/fs/tarfs.h b/kernel/fs/tarfs.h index 273e84e..f13d234 100644 --- a/kernel/fs/tarfs.h +++ b/kernel/fs/tarfs.h @@ -1,8 +1,8 @@ #ifndef _KERNEL_FS_TARFS_H #define _KERNEL_FS_TARFS_H +#include #include -#include #include #include #include @@ -35,8 +35,7 @@ struct vfs_mountpoint; int tarfs_mount (struct vfs_mountpoint* mountpoint, struct proc* proc, struct reschedule_ctx* rctx); -int tarfs_describe (struct vfs_mountpoint* mountpoint, const char* path, - struct fs_desc_buffer* desc); +int tarfs_describe (struct vfs_mountpoint* mountpoint, const char* path, struct desc* desc); int tarfs_read (struct vfs_mountpoint* mountpoint, const char* path, uint8_t* buffer, size_t off, size_t size); diff --git a/kernel/fs/vfs.c b/kernel/fs/vfs.c index f7ff3f7..4224260 100644 --- a/kernel/fs/vfs.c +++ b/kernel/fs/vfs.c @@ -122,7 +122,7 @@ int vfs_close (struct procgroup* procgroup, const char* mountpoint, const char* } int vfs_describe (struct procgroup* procgroup, const char* mountpoint, const char* path, - struct fs_desc_buffer* desc) { + struct desc* desc) { struct vfs_mountpoint* vmp = vfs_find_mountpoint (mountpoint); if (vmp == NULL) diff --git a/kernel/fs/vfs.h b/kernel/fs/vfs.h index aeefeae..ea5f014 100644 --- a/kernel/fs/vfs.h +++ b/kernel/fs/vfs.h @@ -1,8 +1,8 @@ #ifndef _KERNEL_FS_VFS_H #define _KERNEL_FS_VFS_H +#include #include -#include #include #include #include @@ -24,8 +24,7 @@ struct vfs_mountpoint { int (*mount) (struct vfs_mountpoint* mountpoint, struct proc* proc, struct reschedule_ctx* rctx); - int (*describe) (struct vfs_mountpoint* mountpoint, const char* path, - struct fs_desc_buffer* desc); + int (*describe) (struct vfs_mountpoint* mountpoint, const char* path, struct desc* desc); int (*read) (struct vfs_mountpoint* mountpoint, const char* path, uint8_t* buffer, size_t off, size_t size); @@ -43,7 +42,7 @@ int vfs_create_mountpoint (const char* key, int fs_type, struct device* back_dev struct proc* proc, struct reschedule_ctx* rctx); int vfs_describe (struct procgroup* procgroup, const char* mountpoint, const char* path, - struct fs_desc_buffer* desc); + struct desc* desc); int vfs_read (struct procgroup* procgroup, const char* mountpoint, const char* path, uint8_t* buffer, size_t off, size_t size); diff --git a/kernel/proc/proc.c b/kernel/proc/proc.c index 79a9b6c..063fa2c 100644 --- a/kernel/proc/proc.c +++ b/kernel/proc/proc.c @@ -1,7 +1,7 @@ #include #include +#include #include -#include #include #include #include @@ -106,7 +106,7 @@ struct elf_aux proc_load_segments (struct proc* proc, uint8_t* elf) { struct proc* proc_from_file (struct procgroup* procgroup, const char* mountpoint, const char* path) { - struct fs_desc_buffer desc; + struct desc desc; if (vfs_open (procgroup, mountpoint, path) != ST_OK) return NULL; diff --git a/kernel/syscall/syscall.c b/kernel/syscall/syscall.c index 54540b8..8220081 100644 --- a/kernel/syscall/syscall.c +++ b/kernel/syscall/syscall.c @@ -384,13 +384,12 @@ DEFINE_SYSCALL (sys_read) { return SYSRESULT (vfs_read (proc->procgroup, mountpoint, subpath, buffer, off, size)); } -/* int describe (char* path, struct fs_desc_buffer* desc) */ +/* int describe (char* path, struct desc* desc) */ DEFINE_SYSCALL (sys_describe) { uintptr_t uvaddr_path = a1; uintptr_t uvaddr_desc = a2; - struct fs_desc_buffer* desc = - sys_get_user_buffer (proc, uvaddr_desc, sizeof (struct fs_desc_buffer)); + struct desc* desc = sys_get_user_buffer (proc, uvaddr_desc, sizeof (struct desc)); if (desc == NULL) return SYSRESULT (-ST_BAD_ADDRESS_SPACE); diff --git a/libsystem/system.c b/libsystem/system.c index 91bbea5..d1b02d6 100644 --- a/libsystem/system.c +++ b/libsystem/system.c @@ -49,7 +49,7 @@ int read (const char* path, size_t off, uint8_t* buffer, size_t size) { return (int)do_syscall (SYS_READ, path, off, buffer, size); } -int describe (const char* path, struct fs_desc_buffer* desc) { +int describe (const char* path, struct desc* desc) { return (int)do_syscall (SYS_DESCRIBE, path, desc); } diff --git a/libsystem/system.h b/libsystem/system.h index 20787af..b0b3d08 100644 --- a/libsystem/system.h +++ b/libsystem/system.h @@ -1,7 +1,7 @@ #ifndef _LIBMSL_M_SYSTEM_H #define _LIBMSL_M_SYSTEM_H -#include +#include #include #include @@ -63,7 +63,7 @@ int close (const char* path); int read (const char* path, size_t off, uint8_t* buffer, size_t size); /* describe a file */ -int describe (const char* path, struct fs_desc_buffer* desc); +int describe (const char* path, struct desc* desc); /* send a message to a procgroup's mail */ int mail_send (int pgid, void* mesg, size_t mesg_size);