kernel/fs: Don't store the mount cookie in the KPartition.
Nothing uses it. If needed, it can be retrieved through the volume (mount) ID.
This commit is contained in:
@@ -31,7 +31,6 @@ typedef struct partition_data {
|
||||
uint32 status;
|
||||
uint32 flags;
|
||||
dev_t volume; // [sys]
|
||||
void *mount_cookie; // [sys]
|
||||
char *name; // max: B_OS_NAME_LENGTH
|
||||
char *content_name; //
|
||||
char *type; //
|
||||
|
||||
@@ -125,9 +125,6 @@ public:
|
||||
void SetVolumeID(dev_t volumeID);
|
||||
dev_t VolumeID() const;
|
||||
|
||||
void SetMountCookie(void *cookie);
|
||||
void *MountCookie() const;
|
||||
|
||||
// Parameters
|
||||
|
||||
status_t SetParameters(const char *parameters);
|
||||
@@ -207,7 +204,6 @@ protected:
|
||||
void FireTypeChanged(const char *type);
|
||||
void FireIDChanged(partition_id id);
|
||||
void FireVolumeIDChanged(dev_t volumeID);
|
||||
void FireMountCookieChanged(void *cookie);
|
||||
void FireParametersChanged(const char *parameters);
|
||||
void FireContentParametersChanged(const char *parameters);
|
||||
void FireChildAdded(KPartition *child, int32 index);
|
||||
|
||||
@@ -28,7 +28,6 @@ public:
|
||||
virtual void TypeChanged(KPartition *partition, const char *type);
|
||||
virtual void IDChanged(KPartition *partition, partition_id id);
|
||||
virtual void VolumeIDChanged(KPartition *partition, dev_t volumeID);
|
||||
virtual void MountCookieChanged(KPartition *partition, void *cookie);
|
||||
virtual void ParametersChanged(KPartition *partition,
|
||||
const char *parameters);
|
||||
virtual void ContentParametersChanged(KPartition *partition,
|
||||
|
||||
@@ -80,7 +80,6 @@ KPartition::KPartition(partition_id id)
|
||||
fPartitionData.status = B_PARTITION_UNRECOGNIZED;
|
||||
fPartitionData.flags = B_PARTITION_BUSY;
|
||||
fPartitionData.volume = -1;
|
||||
fPartitionData.mount_cookie = NULL;
|
||||
fPartitionData.name = NULL;
|
||||
fPartitionData.content_name = NULL;
|
||||
fPartitionData.type = NULL;
|
||||
@@ -811,23 +810,6 @@ KPartition::VolumeID() const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
KPartition::SetMountCookie(void* cookie)
|
||||
{
|
||||
if (fPartitionData.mount_cookie != cookie) {
|
||||
fPartitionData.mount_cookie = cookie;
|
||||
FireMountCookieChanged(cookie);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void*
|
||||
KPartition::MountCookie() const
|
||||
{
|
||||
return fPartitionData.mount_cookie;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
KPartition::SetParameters(const char* parameters)
|
||||
{
|
||||
@@ -1537,18 +1519,6 @@ KPartition::FireVolumeIDChanged(dev_t volumeID)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
KPartition::FireMountCookieChanged(void* cookie)
|
||||
{
|
||||
if (fListeners) {
|
||||
for (ListenerSet::Iterator it = fListeners->Begin();
|
||||
it != fListeners->End(); ++it) {
|
||||
(*it)->MountCookieChanged(this, cookie);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
KPartition::FireParametersChanged(const char* parameters)
|
||||
{
|
||||
|
||||
@@ -86,12 +86,6 @@ KPartitionListener::VolumeIDChanged(KPartition *partition, dev_t volumeID)
|
||||
{
|
||||
}
|
||||
|
||||
// MountCookieChanged
|
||||
void
|
||||
KPartitionListener::MountCookieChanged(KPartition *partition, void *cookie)
|
||||
{
|
||||
}
|
||||
|
||||
// ParametersChanged
|
||||
void
|
||||
KPartitionListener::ParametersChanged(KPartition *partition,
|
||||
|
||||
@@ -7672,9 +7672,8 @@ fs_mount(char* path, const char* device, const char* fsName, uint32 flags,
|
||||
inc_vnode_ref_count(sRoot);
|
||||
}
|
||||
|
||||
// supply the partition (if any) with the mount cookie and mark it mounted
|
||||
// supply the partition (if any) with the mount ID and mark it mounted
|
||||
if (partition) {
|
||||
partition->SetMountCookie(mount->volume->private_volume);
|
||||
partition->SetVolumeID(mount->id);
|
||||
|
||||
// keep a partition reference as long as the partition is mounted
|
||||
@@ -7917,7 +7916,6 @@ fs_unmount(char* path, dev_t mountID, uint32 flags, bool kernel)
|
||||
// dereference the partition and mark it unmounted
|
||||
if (partition) {
|
||||
partition->SetVolumeID(-1);
|
||||
partition->SetMountCookie(NULL);
|
||||
|
||||
if (mount->owns_file_device)
|
||||
KDiskDeviceManager::Default()->DeleteFileDevice(partition->ID());
|
||||
|
||||
Reference in New Issue
Block a user