Remove VFS object reference counting

This commit is contained in:
2025-09-05 15:10:25 +02:00
parent 90266f044b
commit ca92a0e6a8
4 changed files with 1 additions and 9 deletions

View File

@ -74,7 +74,6 @@ struct VfsObj *littlefs_open(struct VfsMountPoint *vmp, const char *path, uint32
} }
hal_memset(vobj, 0, sizeof(*vobj)); hal_memset(vobj, 0, sizeof(*vobj));
spinlock_init(&vobj->spinlock); spinlock_init(&vobj->spinlock);
vobj->refs++;
int lfs_flags = 0; int lfs_flags = 0;
lfs_file_t *file = dlmalloc(sizeof(*file)); lfs_file_t *file = dlmalloc(sizeof(*file));

View File

@ -107,14 +107,8 @@ VfsObj *vfs_open(char *mountpoint, const char *path, uint32_t flags) {
} }
void vfs_close(VfsObj *vobj) { void vfs_close(VfsObj *vobj) {
if (vobj->refs < 0) {
return;
}
vobj->refs--;
if (vobj->refs == 0) {
vobj->cleanup(vobj); vobj->cleanup(vobj);
} }
}
void vfs_init(void) { void vfs_init(void) {
hal_memset(&VFS_TABLE, 0, sizeof(VFS_TABLE)); hal_memset(&VFS_TABLE, 0, sizeof(VFS_TABLE));

View File

@ -39,7 +39,6 @@ typedef struct VfsStat {
typedef struct VfsObj { typedef struct VfsObj {
SpinLock spinlock; SpinLock spinlock;
int32_t refs;
void *extra; void *extra;
size_t extrasize; size_t extrasize;
struct VfsMountPoint *vmp; struct VfsMountPoint *vmp;

Binary file not shown.