vfs_delete() implement deleting files
This commit is contained in:
@ -117,6 +117,16 @@ int32_t littlefs_mkdir(struct VfsMountPoint *vmp, const char *path) {
|
||||
return E_OK;
|
||||
}
|
||||
|
||||
int32_t littlefs_delete(struct VfsMountPoint *vmp, const char *path) {
|
||||
spinlock_acquire(&vmp->spinlock);
|
||||
int ok = lfs_remove(&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) {
|
||||
|
||||
Reference in New Issue
Block a user