lib: Add epoch-based SMR
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user