Working port of Little FS
This commit is contained in:
@ -33,6 +33,7 @@ StoreDev *storedev_create(int32_t sdtype, void *extra) {
|
||||
sd->cleanup = &ramsd_cleanup;
|
||||
sd->read = &ramsd_read;
|
||||
sd->write = &ramsd_write;
|
||||
sd->capacity = &ramsd_capacity;
|
||||
|
||||
int32_t err = sd->init(sd, extra);
|
||||
if (err != E_OK) {
|
||||
@ -53,5 +54,10 @@ int32_t storedev_delete(StoreDev *sd) {
|
||||
spinlock_acquire(&STOREDEV_LIST.spinlock);
|
||||
LL_REMOVE(STOREDEV_LIST.head, sd);
|
||||
int32_t err = sd->cleanup(sd);
|
||||
if (err < 0) {
|
||||
spinlock_release(&STOREDEV_LIST.spinlock);
|
||||
return err;
|
||||
}
|
||||
spinlock_release(&STOREDEV_LIST.spinlock);
|
||||
return E_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user