From 5c699c6735366a34a01a5007f2e7c4ddde27f022 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 21 Sep 2003 18:25:42 +0000 Subject: [PATCH] Add a field mount_cookie to the partition_data structure and respective setter/getter methods to the KPartition class. If a partition is mounted, the field will contain the cookie the FS's mount() hook passed back to the VFS. This way the FS has access to its internal data structures. We need the cooperation of the VFS to get the cookie. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4776 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/disk_device_manager/KPartition.h | 3 +++ .../disk_device_manager/disk_device_manager.h | 1 + .../core/disk_device_manager/KPartition.cpp | 15 +++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/headers/private/kernel/disk_device_manager/KPartition.h b/headers/private/kernel/disk_device_manager/KPartition.h index 4dbda759f8..dfa249c3d0 100644 --- a/headers/private/kernel/disk_device_manager/KPartition.h +++ b/headers/private/kernel/disk_device_manager/KPartition.h @@ -106,6 +106,9 @@ public: void SetVolumeID(dev_t volumeID); dev_t VolumeID() const; + void SetMountCookie(void *cookie); + void *MountCookie() const; + virtual status_t Mount(uint32 mountFlags, const char *parameters); virtual status_t Unmount(); diff --git a/headers/private/kernel/disk_device_manager/disk_device_manager.h b/headers/private/kernel/disk_device_manager/disk_device_manager.h index 7d7c4d7465..6342af1c9b 100644 --- a/headers/private/kernel/disk_device_manager/disk_device_manager.h +++ b/headers/private/kernel/disk_device_manager/disk_device_manager.h @@ -28,6 +28,7 @@ typedef struct partition_data { uint32 status; // [sys] uint32 flags; dev_t volume; // [sys] + void *mount_cookie; // [sys] char *name; // max: B_OS_NAME_LENGTH char *content_name; // char *type; // diff --git a/src/kernel/core/disk_device_manager/KPartition.cpp b/src/kernel/core/disk_device_manager/KPartition.cpp index a76015939d..1e1e6ab270 100644 --- a/src/kernel/core/disk_device_manager/KPartition.cpp +++ b/src/kernel/core/disk_device_manager/KPartition.cpp @@ -49,6 +49,7 @@ KPartition::KPartition(partition_id id) fPartitionData.status = B_PARTITION_UNRECOGNIZED; fPartitionData.flags = B_PARTITION_BUSY | B_PARTITION_DESCENDANT_BUSY; fPartitionData.volume = -1; + fPartitionData.mount_cookie = NULL; fPartitionData.name = NULL; fPartitionData.content_name = NULL; fPartitionData.type = NULL; @@ -503,6 +504,20 @@ KPartition::VolumeID() const return fPartitionData.volume; } +// SetMountCookie +void +KPartition::SetMountCookie(void *cookie) +{ + fPartitionData.mount_cookie = cookie; +} + +// MountCookie +void * +KPartition::MountCookie() const +{ + return fPartitionData.mount_cookie; +} + // Mount status_t KPartition::Mount(uint32 mountFlags, const char *parameters)