Protect busy VfsObjs during opening and deleting

This commit is contained in:
2025-11-10 20:23:03 +01:00
parent a349154545
commit 7e3b162591
4 changed files with 73 additions and 1 deletions

View File

@ -30,7 +30,9 @@ enum {
#define VFS_PATH_MAX 1024
typedef struct VfsObj {
struct VfsObj *next;
SpinLock spinlock;
char path[VFS_MOUNTPOINT_LABEL_MAX+1+VFS_PATH_MAX];
void *extra;
size_t extrasize;
struct VfsMountPoint *vmp;
@ -40,6 +42,13 @@ typedef struct VfsObj {
void (*cleanup)(struct VfsObj *vobj);
} VfsObj;
typedef struct {
SpinLock spinlock;
VfsObj *vobjs;
} VfsBusyObjs;
extern VfsBusyObjs VFS_BUSY_VOBJS;
typedef struct VfsMountPoint {
int _hshtbstate;
char label[VFS_MOUNTPOINT_LABEL_MAX];