* More shadow partition support.
* Writing disk device/partition data into userland buffer added. * Migration of some definitions into <DiskDeviceDefs.h> header. * Small bug fixes. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3882 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,16 +8,11 @@
|
||||
#include "KPhysicalPartition.h"
|
||||
#include "RWLocker.h"
|
||||
|
||||
// disk device flags
|
||||
// TODO: move to another header (must be accessible from userland API impl.)
|
||||
enum {
|
||||
B_DISK_DEVICE_REMOVABLE = 0x01,
|
||||
B_DISK_DEVICE_HAS_MEDIA = 0x02,
|
||||
};
|
||||
|
||||
namespace BPrivate {
|
||||
namespace DiskDevice {
|
||||
|
||||
class UserDataWriter;
|
||||
|
||||
class KDiskDevice : public KPhysicalPartition {
|
||||
public:
|
||||
KDiskDevice(partition_id id = -1);
|
||||
@@ -69,6 +64,8 @@ public:
|
||||
void SetShadowOwner(team_id team);
|
||||
team_id ShadowOwner() const;
|
||||
|
||||
void WriteUserData(UserDataWriter &writer, bool shadow);
|
||||
|
||||
virtual void Dump(bool deep = true, int32 level = 0);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -7,21 +7,13 @@
|
||||
|
||||
#include "disk_device_manager.h"
|
||||
|
||||
// partition flags
|
||||
// TODO: move to another header (must be accessible from userland API impl.)
|
||||
enum {
|
||||
B_PARTITION_IS_DEVICE = 0x01,
|
||||
B_PARTITION_MOUNTABLE = 0x02,
|
||||
B_PARTITION_PARTITIONABLE = 0x04,
|
||||
B_PARTITION_READ_ONLY = 0x08,
|
||||
B_PARTITION_MOUNTED = 0x10, // needed?
|
||||
B_PARTITION_BUSY = 0x20,
|
||||
B_PARTITION_DESCENDANT_BUSY = 0x40,
|
||||
};
|
||||
struct user_partition_data;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace DiskDevice {
|
||||
|
||||
class UserDataWriter;
|
||||
|
||||
class KDiskDevice;
|
||||
class KDiskSystem;
|
||||
class KPhysicalPartition;
|
||||
@@ -142,9 +134,9 @@ public:
|
||||
|
||||
virtual status_t CreateShadowPartition(); // creates a complete tree
|
||||
virtual void DeleteShadowPartition(); // deletes ...
|
||||
virtual KShadowPartition *ShadowPartition() = 0;
|
||||
virtual KShadowPartition *ShadowPartition() const = 0;
|
||||
virtual bool IsShadowPartition() const = 0;
|
||||
virtual KPhysicalPartition *PhysicalPartition() = 0;
|
||||
virtual KPhysicalPartition *PhysicalPartition() const = 0;
|
||||
|
||||
// DiskSystem
|
||||
|
||||
@@ -161,6 +153,8 @@ public:
|
||||
void SetContentCookie(void *cookie);
|
||||
void *ContentCookie() const;
|
||||
|
||||
void WriteUserData(UserDataWriter &writer, user_partition_data *data);
|
||||
|
||||
virtual void Dump(bool deep, int32 level);
|
||||
|
||||
private:
|
||||
|
||||
@@ -35,9 +35,9 @@ public:
|
||||
|
||||
virtual status_t CreateShadowPartition(); // creates a complete tree
|
||||
virtual void DeleteShadowPartition(); // deletes ...
|
||||
virtual KShadowPartition *ShadowPartition();
|
||||
virtual KShadowPartition *ShadowPartition() const;
|
||||
virtual bool IsShadowPartition() const;
|
||||
virtual KPhysicalPartition *PhysicalPartition();
|
||||
virtual KPhysicalPartition *PhysicalPartition() const;
|
||||
|
||||
// DiskSystem
|
||||
|
||||
|
||||
@@ -22,10 +22,12 @@ public:
|
||||
|
||||
// Shadow Partition
|
||||
|
||||
virtual KShadowPartition *ShadowPartition();
|
||||
virtual KShadowPartition *ShadowPartition() const;
|
||||
virtual bool IsShadowPartition() const;
|
||||
void SetPhysicalPartition(KPhysicalPartition *partition);
|
||||
virtual KPhysicalPartition *PhysicalPartition();
|
||||
void UnsetPhysicalPartition();
|
||||
virtual KPhysicalPartition *PhysicalPartition() const;
|
||||
|
||||
void SyncWithPhysicalPartition();
|
||||
|
||||
virtual void Dump(bool deep, int32 level);
|
||||
|
||||
|
||||
@@ -7,20 +7,13 @@
|
||||
#ifndef _DISK_DEVICE_MANAGER_H
|
||||
#define _DISK_DEVICE_MANAGER_H
|
||||
|
||||
#include <DiskDeviceDefs.h>
|
||||
#include <Drivers.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// TODO: These don't belong here. partition_id and disk_job_id are
|
||||
// public (exposed by the userland API), while disk_system_id is at least
|
||||
// known to the userland API, but probably exposed as well, as type of a
|
||||
// private member variable of BDiskSystem.
|
||||
typedef int32 partition_id;
|
||||
typedef int32 disk_system_id;
|
||||
typedef int32 disk_job_id;
|
||||
|
||||
// C API partition representation
|
||||
typedef struct partition_data {
|
||||
partition_id id;
|
||||
|
||||
Reference in New Issue
Block a user