From b1a58597b94bdc047e3587cf730577210db6aefb Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Thu, 19 Feb 2009 01:16:07 +0000 Subject: [PATCH] Add a new fs_volume op all_layers_mounted() that is called when all layers have been mounted. This is to allow layered filesystems to setup internal data that requires all the sub/super volumes to be available. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29248 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/drivers/fs_interface.h | 1 + src/system/kernel/fs/vfs.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/headers/os/drivers/fs_interface.h b/headers/os/drivers/fs_interface.h index fb4a8ac737..2b65cce789 100644 --- a/headers/os/drivers/fs_interface.h +++ b/headers/os/drivers/fs_interface.h @@ -107,6 +107,7 @@ struct fs_volume_ops { status_t (*rewind_query)(fs_volume *volume, void *cookie); /* support for FS layers */ + status_t (*all_layers_mounted)(fs_volume *volume); status_t (*create_sub_vnode)(fs_volume *volume, ino_t id, fs_vnode *vnode); status_t (*delete_sub_vnode)(fs_volume *volume, fs_vnode *vnode); }; diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 654cfc3fcd..f4baa9270a 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -7023,6 +7023,13 @@ fs_mount(char* path, const char* device, const char* fsName, uint32 flags, volume = volume->super_volume; } + + volume = mount->volume; + while (volume) { + if (volume->ops->all_layers_mounted != NULL) + volume->ops->all_layers_mounted(volume); + volume = volume->super_volume; + } } // the root node is supposed to be owned by the file system - it must