Hello user process
This commit is contained in:
@ -18,6 +18,7 @@ VfsTable VFS_TABLE;
|
||||
|
||||
void vfs_init_kvfs(VfsMountPoint *mp) {
|
||||
mp->read = &kvfs_read;
|
||||
mp->stat = &kvfs_stat;
|
||||
mp->write = &kvfs_write;
|
||||
mp->remove = &kvfs_remove;
|
||||
mp->check = &kvfs_check;
|
||||
@ -52,6 +53,7 @@ void vfs_init_littlefs(VfsMountPoint *mp) {
|
||||
}
|
||||
|
||||
mp->read = &littlefs_read;
|
||||
mp->stat = &littlefs_stat;
|
||||
mp->write = &littlefs_write;
|
||||
mp->remove = &littlefs_remove;
|
||||
mp->check = &littlefs_check;
|
||||
@ -123,6 +125,20 @@ int32_t vfs_read(char *mountpoint, const char *path, uint8_t *const buffer, size
|
||||
return mp->read(mp, path, buffer, n, off);
|
||||
}
|
||||
|
||||
int32_t vfs_stat(char *mountpoint, const char *path, VfsStat *stat) {
|
||||
VfsMountPoint *mp = NULL;
|
||||
|
||||
spinlock_acquire(&VFS_TABLE.spinlock);
|
||||
HSHTB_GET(&VFS_TABLE, mountpoints, mountpoint, label, mp);
|
||||
spinlock_release(&VFS_TABLE.spinlock);
|
||||
|
||||
if (mp == NULL) {
|
||||
return E_NOENTRY;
|
||||
}
|
||||
|
||||
return mp->stat(mp, path, stat);
|
||||
}
|
||||
|
||||
int32_t vfs_create(char *mountpoint, const char *path, int32_t type) {
|
||||
VfsMountPoint *mp = NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user