#ifndef __ZVFS_FS_GLOBAL_H__
#define __ZVFS_FS_GLOBAL_H__

#include <pthread.h>
#include <stdatomic.h>
#include <stdint.h>

struct zvfs_inode;
struct zvfs_path_entry;
struct zvfs_open_file;

struct zvfs_fs {
    struct zvfs_inode      *inode_table;  /* blob_id → inode            */
    struct zvfs_path_entry *path_cache;   /* path    → inode（运行时缓存）*/
    struct zvfs_open_file  *fd_table;     /* fd      → openfile          */

    pthread_mutex_t         inode_mu;
    pthread_mutex_t         path_mu;
    pthread_mutex_t         fd_mu;
};

struct strace {
    

};

extern struct zvfs_fs g_fs;

int  zvfs_fs_init(void);
int  zvfs_fs_destroy(void);

int  zvfs_xattr_write_blob_id(int fd, uint64_t blob_id);
int  zvfs_xattr_read_blob_id(int fd, uint64_t *blob_id_out);

#endif // __ZVFS_FS_GLOBAL_H__
