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:
Ingo Weinhold 2003-07-08 17:38:45 +00:00
parent 55bf93d80d
commit c54d68a84e
9 changed files with 35 additions and 32 deletions

View File

@ -68,8 +68,8 @@ public:
void SetFlags(uint32 flags); // comprises the ones below
uint32 Flags() const;
bool IsMountable() const;
bool IsPartitionable() const;
bool ContainsFileSystem() const;
bool ContainsPartitioningSystem() const;
bool IsReadOnly() const;
bool IsMounted() const;

View File

@ -18,13 +18,13 @@ typedef int32 disk_job_id;
// partition flags
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,
B_PARTITION_IS_DEVICE = 0x01,
B_PARTITION_FILE_SYSTEM = 0x02,
B_PARTITION_PARTITIONING_SYSTEM = 0x04,
B_PARTITION_READ_ONLY = 0x08,
B_PARTITION_MOUNTED = 0x10, // needed?
B_PARTITION_BUSY = 0x20,
B_PARTITION_DESCENDANT_BUSY = 0x40,
};
// partition statuses

View File

@ -29,8 +29,8 @@ public:
int32 Index() const; // 0 for devices
uint32 Status() const;
bool IsMountable() const;
bool IsPartitionable() const;
bool ContainsFileSystem() const;
bool ContainsPartitioningSystem() const;
bool IsDevice() const;
bool IsReadOnly() const;

View File

@ -390,7 +390,7 @@ bfs_scan_partition(int fd, partition_data *partition, void *cookie)
superBlock = (disk_super_block*)cookie;
// fill in the partition_data structure
partition->status = B_PARTITION_VALID;
partition->flags |= B_PARTITION_MOUNTABLE;
partition->flags |= B_PARTITION_FILE_SYSTEM;
partition->block_size = superBlock->block_size;
partition->content_name = strdup(superBlock->name);
partition->content_type = strdup(kPartitionTypeBFS);

View File

@ -483,7 +483,8 @@ pm_scan_partition(int fd, partition_data *partition, void *cookie)
PartitionMap *map = (PartitionMap*)cookie;
// fill in the partition_data structure
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.
// (no content_name and content_parameters)
partition->content_type = strdup(kPartitionTypeIntel);
@ -625,7 +626,8 @@ ep_scan_partition(int fd, partition_data *partition, void *cookie)
PrimaryPartition *primary = (PrimaryPartition*)partition->cookie;
// fill in the partition_data structure
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.
// (no content_name and content_parameters)
partition->content_type = strdup(kPartitionTypeIntelExtended);

View File

@ -305,18 +305,18 @@ KPartition::Flags() const
return fPartitionData.flags;
}
// IsMountable
// ContainsFileSystem
bool
KPartition::IsMountable() const
KPartition::ContainsFileSystem() const
{
return (fPartitionData.flags & B_PARTITION_MOUNTABLE);
return (fPartitionData.flags & B_PARTITION_FILE_SYSTEM);
}
// IsPartitionable
// ContainsPartitioningSystem
bool
KPartition::IsPartitionable() const
KPartition::ContainsPartitioningSystem() const
{
return (fPartitionData.flags & B_PARTITION_PARTITIONABLE);
return (fPartitionData.flags & B_PARTITION_PARTITIONING_SYSTEM);
}
// IsReadOnly
@ -681,9 +681,9 @@ KPartition::SetDiskSystem(KDiskSystem *diskSystem)
// update concerned partition flags
if (fDiskSystem) {
if (fDiskSystem->IsFileSystem())
SetFlags(Flags() | B_PARTITION_MOUNTABLE);
SetFlags(Flags() | B_PARTITION_FILE_SYSTEM);
else
SetFlags(Flags() | B_PARTITION_PARTITIONABLE);
SetFlags(Flags() | B_PARTITION_PARTITIONING_SYSTEM);
}
}

View File

@ -316,7 +316,7 @@ BDiskDeviceRoster::VisitEachMountablePartition(BDiskDeviceVisitor *visitor,
if (visitor) {
struct MountablePartitionFilter : public PartitionFilter {
virtual bool Filter(BPartition *partition)
{ return partition->IsMountable(); }
{ return partition->ContainsFileSystem(); }
} filter;
PartitionFilterVisitor filterVisitor(visitor, &filter);
terminatedEarly
@ -376,7 +376,7 @@ BDiskDeviceRoster::VisitEachPartitionablePartition(BDiskDeviceVisitor *visitor,
if (visitor) {
struct PartitionablePartitionFilter : public PartitionFilter {
virtual bool Filter(BPartition *partition)
{ return partition->IsPartitionable(); }
{ return partition->ContainsPartitioningSystem(); }
} filter;
PartitionFilterVisitor filterVisitor(visitor, &filter);
terminatedEarly

View File

@ -90,20 +90,20 @@ BPartition::Status() const
return (fPartitionData ? fPartitionData->status : 0);
}
// IsMountable
// ContainsFileSystem
bool
BPartition::IsMountable() const
BPartition::ContainsFileSystem() const
{
return (fPartitionData
&& (fPartitionData->flags & B_PARTITION_MOUNTABLE));
&& (fPartitionData->flags & B_PARTITION_FILE_SYSTEM));
}
// IsPartitionable
// ContainsPartitioningSystem
bool
BPartition::IsPartitionable() const
BPartition::ContainsPartitioningSystem() const
{
return (fPartitionData
&& (fPartitionData->flags & B_PARTITION_PARTITIONABLE));
&& (fPartitionData->flags & B_PARTITION_PARTITIONING_SYSTEM));
}
// IsDevice

View File

@ -52,8 +52,9 @@ public:
printf(" block size: %lu\n", partition->BlockSize());
printf(" index: %ld\n", partition->Index());
printf(" status: %lu\n", partition->Status());
printf(" mountable: %d\n", partition->IsMountable());
printf(" partitionable: %d\n", partition->IsPartitionable());
printf(" file system: %d\n", partition->ContainsFileSystem());
printf(" part. system: %d\n",
partition->ContainsPartitioningSystem());
printf(" device: %d\n", partition->IsDevice());
printf(" read only: %d\n", partition->IsReadOnly());
printf(" mounted: %d\n", partition->IsMounted());