Break ioctl() up into smaller syscalls

This commit is contained in:
2025-10-14 20:05:41 +02:00
parent c34a253d11
commit 406434fed0
21 changed files with 375 additions and 320 deletions

View File

@ -51,7 +51,7 @@ void vfs_init_littlefs(VfsMountPoint *mp, bool format) {
mp->mkdir = &littlefs_mkdir;
}
int32_t vfs_stat(char *mountpoint, const char *path, IoctlStat *stat) {
int32_t vfs_stat(char *mountpoint, const char *path, FsStat *stat) {
VfsMountPoint *mp = NULL;
spinlock_acquire(&VFS_TABLE.spinlock);
@ -79,7 +79,7 @@ int32_t vfs_mkdir(char *mountpoint, const char *path) {
return mp->mkdir(mp, path);
}
int32_t vfs_fetchdirent(char *mountpoint, const char *path, IoctlDirent *direntbuf, size_t idx) {
int32_t vfs_fetchdirent(char *mountpoint, const char *path, FsDirent *direntbuf, size_t idx) {
VfsMountPoint *mp = NULL;
spinlock_acquire(&VFS_TABLE.spinlock);

View File

@ -7,7 +7,7 @@
#include "spinlock/spinlock.h"
#include "fs/portlfs/portlfs.h"
#include "storedev/storedev.h"
#include "sysdefs/ioctl.h"
#include "sysdefs/fs.h"
#include "compiler/attr.h"
#define VFS_MOUNTPOINT_LABEL_MAX 128
@ -50,8 +50,8 @@ typedef struct VfsMountPoint {
VfsObj *(*open)(struct VfsMountPoint *vmp, const char *path, uint32_t flags);
int32_t (*cleanup)(struct VfsMountPoint *vmp);
int32_t (*stat)(struct VfsMountPoint *vmp, const char *path, IoctlStat *statbuf);
int32_t (*fetchdirent)(struct VfsMountPoint *vmp, const char *path, IoctlDirent *direntbuf, size_t idx);
int32_t (*stat)(struct VfsMountPoint *vmp, const char *path, FsStat *statbuf);
int32_t (*fetchdirent)(struct VfsMountPoint *vmp, const char *path, FsDirent *direntbuf, size_t idx);
int32_t (*mkdir)(struct VfsMountPoint *vmp, const char *path);
union {
@ -72,8 +72,8 @@ int32_t vfs_unmount(char *mountpoint);
int32_t vfs_mount(char *mountpoint, int32_t fstype, StoreDev *backingsd, bool format);
void vfs_close(VfsObj *vobj);
VfsObj *vfs_open(char *mountpoint, const char *path, uint32_t flags);
int32_t vfs_stat(char *mountpoint, const char *path, IoctlStat *stat);
int32_t vfs_fetchdirent(char *mountpoint, const char *path, IoctlDirent *direntbuf, size_t idx);
int32_t vfs_stat(char *mountpoint, const char *path, FsStat *stat);
int32_t vfs_fetchdirent(char *mountpoint, const char *path, FsDirent *direntbuf, size_t idx);
int32_t vfs_mkdir(char *mountpoint, const char *path);
#endif // VFS_VFS_H_