ioctl() IOCTL_MKDIR command, vfs_mkdir()

This commit is contained in:
2025-10-04 01:38:41 +02:00
parent b72f3ee00d
commit 26517e8e28
6 changed files with 46 additions and 0 deletions

View File

@ -107,6 +107,16 @@ int32_t littlefs_stat(struct VfsMountPoint *vmp, const char *path, IoctlStat *st
return E_OK;
}
int32_t littlefs_mkdir(struct VfsMountPoint *vmp, const char *path) {
spinlock_acquire(&vmp->spinlock);
int ok = lfs_mkdir(&vmp->fs.littlefs.instance, path);
spinlock_release(&vmp->spinlock);
if (ok < 0) {
return E_BADIO;
}
return E_OK;
}
struct VfsObj *littlefs_open(struct VfsMountPoint *vmp, const char *path, uint32_t flags) {
VfsObj *vobj = dlmalloc(sizeof(*vobj));
if (vobj == NULL) {