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
This commit is contained in:
Ingo Weinhold
2003-09-21 18:25:42 +00:00
parent 1470102500
commit 5c699c6735
3 changed files with 19 additions and 0 deletions
@@ -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();
@@ -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; //
@@ -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)