Should have waited a few more minutes... Renamed the methods {B,K}Partition::Is{Mountable,Partitionable}() to Contains{File,Partitioning}System(). Similar change for the respective flags (B_PARTITION_{MOUNTABLE,PARTITIONABLE}).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3899 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -68,8 +68,8 @@ public:
|
|||||||
|
|
||||||
void SetFlags(uint32 flags); // comprises the ones below
|
void SetFlags(uint32 flags); // comprises the ones below
|
||||||
uint32 Flags() const;
|
uint32 Flags() const;
|
||||||
bool IsMountable() const;
|
bool ContainsFileSystem() const;
|
||||||
bool IsPartitionable() const;
|
bool ContainsPartitioningSystem() const;
|
||||||
bool IsReadOnly() const;
|
bool IsReadOnly() const;
|
||||||
bool IsMounted() const;
|
bool IsMounted() const;
|
||||||
|
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ typedef int32 disk_job_id;
|
|||||||
|
|
||||||
// partition flags
|
// partition flags
|
||||||
enum {
|
enum {
|
||||||
B_PARTITION_IS_DEVICE = 0x01,
|
B_PARTITION_IS_DEVICE = 0x01,
|
||||||
B_PARTITION_MOUNTABLE = 0x02,
|
B_PARTITION_FILE_SYSTEM = 0x02,
|
||||||
B_PARTITION_PARTITIONABLE = 0x04,
|
B_PARTITION_PARTITIONING_SYSTEM = 0x04,
|
||||||
B_PARTITION_READ_ONLY = 0x08,
|
B_PARTITION_READ_ONLY = 0x08,
|
||||||
B_PARTITION_MOUNTED = 0x10, // needed?
|
B_PARTITION_MOUNTED = 0x10, // needed?
|
||||||
B_PARTITION_BUSY = 0x20,
|
B_PARTITION_BUSY = 0x20,
|
||||||
B_PARTITION_DESCENDANT_BUSY = 0x40,
|
B_PARTITION_DESCENDANT_BUSY = 0x40,
|
||||||
};
|
};
|
||||||
|
|
||||||
// partition statuses
|
// partition statuses
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ public:
|
|||||||
int32 Index() const; // 0 for devices
|
int32 Index() const; // 0 for devices
|
||||||
uint32 Status() const;
|
uint32 Status() const;
|
||||||
|
|
||||||
bool IsMountable() const;
|
bool ContainsFileSystem() const;
|
||||||
bool IsPartitionable() const;
|
bool ContainsPartitioningSystem() const;
|
||||||
|
|
||||||
bool IsDevice() const;
|
bool IsDevice() const;
|
||||||
bool IsReadOnly() const;
|
bool IsReadOnly() const;
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ bfs_scan_partition(int fd, partition_data *partition, void *cookie)
|
|||||||
superBlock = (disk_super_block*)cookie;
|
superBlock = (disk_super_block*)cookie;
|
||||||
// fill in the partition_data structure
|
// fill in the partition_data structure
|
||||||
partition->status = B_PARTITION_VALID;
|
partition->status = B_PARTITION_VALID;
|
||||||
partition->flags |= B_PARTITION_MOUNTABLE;
|
partition->flags |= B_PARTITION_FILE_SYSTEM;
|
||||||
partition->block_size = superBlock->block_size;
|
partition->block_size = superBlock->block_size;
|
||||||
partition->content_name = strdup(superBlock->name);
|
partition->content_name = strdup(superBlock->name);
|
||||||
partition->content_type = strdup(kPartitionTypeBFS);
|
partition->content_type = strdup(kPartitionTypeBFS);
|
||||||
|
|||||||
@@ -483,7 +483,8 @@ pm_scan_partition(int fd, partition_data *partition, void *cookie)
|
|||||||
PartitionMap *map = (PartitionMap*)cookie;
|
PartitionMap *map = (PartitionMap*)cookie;
|
||||||
// fill in the partition_data structure
|
// fill in the partition_data structure
|
||||||
partition->status = B_PARTITION_VALID;
|
partition->status = B_PARTITION_VALID;
|
||||||
partition->flags |= B_PARTITION_PARTITIONABLE | B_PARTITION_READ_ONLY;
|
partition->flags |= B_PARTITION_PARTITIONING_SYSTEM
|
||||||
|
| B_PARTITION_READ_ONLY;
|
||||||
// TODO: Update when write functionality is implemented.
|
// TODO: Update when write functionality is implemented.
|
||||||
// (no content_name and content_parameters)
|
// (no content_name and content_parameters)
|
||||||
partition->content_type = strdup(kPartitionTypeIntel);
|
partition->content_type = strdup(kPartitionTypeIntel);
|
||||||
@@ -625,7 +626,8 @@ ep_scan_partition(int fd, partition_data *partition, void *cookie)
|
|||||||
PrimaryPartition *primary = (PrimaryPartition*)partition->cookie;
|
PrimaryPartition *primary = (PrimaryPartition*)partition->cookie;
|
||||||
// fill in the partition_data structure
|
// fill in the partition_data structure
|
||||||
partition->status = B_PARTITION_VALID;
|
partition->status = B_PARTITION_VALID;
|
||||||
partition->flags |= B_PARTITION_PARTITIONABLE | B_PARTITION_READ_ONLY;
|
partition->flags |= B_PARTITION_PARTITIONING_SYSTEM
|
||||||
|
| B_PARTITION_READ_ONLY;
|
||||||
// TODO: Update when write functionality is implemented.
|
// TODO: Update when write functionality is implemented.
|
||||||
// (no content_name and content_parameters)
|
// (no content_name and content_parameters)
|
||||||
partition->content_type = strdup(kPartitionTypeIntelExtended);
|
partition->content_type = strdup(kPartitionTypeIntelExtended);
|
||||||
|
|||||||
@@ -305,18 +305,18 @@ KPartition::Flags() const
|
|||||||
return fPartitionData.flags;
|
return fPartitionData.flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsMountable
|
// ContainsFileSystem
|
||||||
bool
|
bool
|
||||||
KPartition::IsMountable() const
|
KPartition::ContainsFileSystem() const
|
||||||
{
|
{
|
||||||
return (fPartitionData.flags & B_PARTITION_MOUNTABLE);
|
return (fPartitionData.flags & B_PARTITION_FILE_SYSTEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsPartitionable
|
// ContainsPartitioningSystem
|
||||||
bool
|
bool
|
||||||
KPartition::IsPartitionable() const
|
KPartition::ContainsPartitioningSystem() const
|
||||||
{
|
{
|
||||||
return (fPartitionData.flags & B_PARTITION_PARTITIONABLE);
|
return (fPartitionData.flags & B_PARTITION_PARTITIONING_SYSTEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsReadOnly
|
// IsReadOnly
|
||||||
@@ -681,9 +681,9 @@ KPartition::SetDiskSystem(KDiskSystem *diskSystem)
|
|||||||
// update concerned partition flags
|
// update concerned partition flags
|
||||||
if (fDiskSystem) {
|
if (fDiskSystem) {
|
||||||
if (fDiskSystem->IsFileSystem())
|
if (fDiskSystem->IsFileSystem())
|
||||||
SetFlags(Flags() | B_PARTITION_MOUNTABLE);
|
SetFlags(Flags() | B_PARTITION_FILE_SYSTEM);
|
||||||
else
|
else
|
||||||
SetFlags(Flags() | B_PARTITION_PARTITIONABLE);
|
SetFlags(Flags() | B_PARTITION_PARTITIONING_SYSTEM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ BDiskDeviceRoster::VisitEachMountablePartition(BDiskDeviceVisitor *visitor,
|
|||||||
if (visitor) {
|
if (visitor) {
|
||||||
struct MountablePartitionFilter : public PartitionFilter {
|
struct MountablePartitionFilter : public PartitionFilter {
|
||||||
virtual bool Filter(BPartition *partition)
|
virtual bool Filter(BPartition *partition)
|
||||||
{ return partition->IsMountable(); }
|
{ return partition->ContainsFileSystem(); }
|
||||||
} filter;
|
} filter;
|
||||||
PartitionFilterVisitor filterVisitor(visitor, &filter);
|
PartitionFilterVisitor filterVisitor(visitor, &filter);
|
||||||
terminatedEarly
|
terminatedEarly
|
||||||
@@ -376,7 +376,7 @@ BDiskDeviceRoster::VisitEachPartitionablePartition(BDiskDeviceVisitor *visitor,
|
|||||||
if (visitor) {
|
if (visitor) {
|
||||||
struct PartitionablePartitionFilter : public PartitionFilter {
|
struct PartitionablePartitionFilter : public PartitionFilter {
|
||||||
virtual bool Filter(BPartition *partition)
|
virtual bool Filter(BPartition *partition)
|
||||||
{ return partition->IsPartitionable(); }
|
{ return partition->ContainsPartitioningSystem(); }
|
||||||
} filter;
|
} filter;
|
||||||
PartitionFilterVisitor filterVisitor(visitor, &filter);
|
PartitionFilterVisitor filterVisitor(visitor, &filter);
|
||||||
terminatedEarly
|
terminatedEarly
|
||||||
|
|||||||
@@ -90,20 +90,20 @@ BPartition::Status() const
|
|||||||
return (fPartitionData ? fPartitionData->status : 0);
|
return (fPartitionData ? fPartitionData->status : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsMountable
|
// ContainsFileSystem
|
||||||
bool
|
bool
|
||||||
BPartition::IsMountable() const
|
BPartition::ContainsFileSystem() const
|
||||||
{
|
{
|
||||||
return (fPartitionData
|
return (fPartitionData
|
||||||
&& (fPartitionData->flags & B_PARTITION_MOUNTABLE));
|
&& (fPartitionData->flags & B_PARTITION_FILE_SYSTEM));
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsPartitionable
|
// ContainsPartitioningSystem
|
||||||
bool
|
bool
|
||||||
BPartition::IsPartitionable() const
|
BPartition::ContainsPartitioningSystem() const
|
||||||
{
|
{
|
||||||
return (fPartitionData
|
return (fPartitionData
|
||||||
&& (fPartitionData->flags & B_PARTITION_PARTITIONABLE));
|
&& (fPartitionData->flags & B_PARTITION_PARTITIONING_SYSTEM));
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsDevice
|
// IsDevice
|
||||||
|
|||||||
@@ -52,8 +52,9 @@ public:
|
|||||||
printf(" block size: %lu\n", partition->BlockSize());
|
printf(" block size: %lu\n", partition->BlockSize());
|
||||||
printf(" index: %ld\n", partition->Index());
|
printf(" index: %ld\n", partition->Index());
|
||||||
printf(" status: %lu\n", partition->Status());
|
printf(" status: %lu\n", partition->Status());
|
||||||
printf(" mountable: %d\n", partition->IsMountable());
|
printf(" file system: %d\n", partition->ContainsFileSystem());
|
||||||
printf(" partitionable: %d\n", partition->IsPartitionable());
|
printf(" part. system: %d\n",
|
||||||
|
partition->ContainsPartitioningSystem());
|
||||||
printf(" device: %d\n", partition->IsDevice());
|
printf(" device: %d\n", partition->IsDevice());
|
||||||
printf(" read only: %d\n", partition->IsReadOnly());
|
printf(" read only: %d\n", partition->IsReadOnly());
|
||||||
printf(" mounted: %d\n", partition->IsMounted());
|
printf(" mounted: %d\n", partition->IsMounted());
|
||||||
|
|||||||
Reference in New Issue
Block a user