From 60f2ef17be7b98a2a30b95e6a7a33a2bde8e17e5 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 13 Jul 2008 12:47:08 +0000 Subject: [PATCH] * Added "partition_id partition" field to fs_volume, so that file systems can get the partition they reside on easily. * Updated TODO. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26401 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/drivers/fs_interface.h | 1 + src/system/kernel/fs/vfs.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/headers/os/drivers/fs_interface.h b/headers/os/drivers/fs_interface.h index 299e779231..14227120f6 100644 --- a/headers/os/drivers/fs_interface.h +++ b/headers/os/drivers/fs_interface.h @@ -54,6 +54,7 @@ typedef struct fs_vnode_ops fs_vnode_ops; struct fs_volume { dev_t id; + partition_id partition; int32 layer; void* private_volume; fs_volume_ops* ops; diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 98b8eb339d..2ea6919d5d 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -6284,7 +6284,7 @@ fs_mount(char *path, const char *device, const char *fsName, uint32 flags, // Write lock the partition's device. For the time being, we keep the lock // until we're done mounting -- not nice, but ensure, that no-one is // interfering. - // TODO: Find a better solution. + // TODO: Just mark the partition busy while mounting! KDiskDevice *diskDevice = NULL; if (partition) { diskDevice = ddm->WriteLockDevice(partition->Device()->ID()); @@ -6364,6 +6364,7 @@ fs_mount(char *path, const char *device, const char *fsName, uint32 flags, mount->owns_file_device = false; mount->volume->id = mount->id; + mount->volume->partition = partition != NULL ? partition->ID() : -1; mount->volume->layer = 0; mount->volume->private_volume = NULL; mount->volume->ops = NULL;