lib: Add epoch-based SMR

This commit is contained in:
2026-11-01 21:06:48 +01:00
parent 3ff068e944
commit 7c04530681
24 changed files with 1059 additions and 84 deletions
+5 -1
View File
@@ -224,6 +224,10 @@ void vfs_file_ref(struct vfs_file* file) {
refcount_inc(&file->rc);
}
static void file_free(struct epoch_head* head) {
mem_free(containerof(head, struct vfs_file, epoch));
}
void vfs_file_unref(struct vfs_file* file) {
if (!refcount_dec(&file->rc))
return;
@@ -234,7 +238,7 @@ void vfs_file_unref(struct vfs_file* file) {
vfs_path_drop(file->path);
vfs_node_unref(file->vnode);
mem_free(file->absolute_path);
mem_free(file);
epoch_call(&file->epoch, file_free);
}
struct vfs_path vfs_path_clone(struct vfs_path path) {