本文整理汇总了C++中KPartition::Parent方法的典型用法代码示例。如果您正苦于以下问题:C++ KPartition::Parent方法的具体用法?C++ KPartition::Parent怎么用?C++ KPartition::Parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPartition
的用法示例。
在下文中一共展示了KPartition::Parent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: locker
status_t
_user_move_partition(partition_id partitionID, int32* changeCounter,
partition_id childID, int32* childChangeCounter, off_t newOffset,
partition_id* descendantIDs, int32* descendantChangeCounters,
int32 descendantCount)
{
#if 0
KDiskDeviceManager *manager = KDiskDeviceManager::Default();
// get the partition
KPartition *partition = manager->WriteLockPartition(partitionID);
if (!partition)
return B_ENTRY_NOT_FOUND;
PartitionRegistrar registrar1(partition, true);
PartitionRegistrar registrar2(partition->Device(), true);
DeviceWriteLocker locker(partition->Device(), true);
// check the new offset
if (newOffset == partition->Offset())
return B_OK;
off_t proposedOffset = newOffset;
status_t error = validate_move_partition(partition, changeCounter,
&proposedOffset, true);
if (error != B_OK)
return error;
if (proposedOffset != newOffset)
return B_BAD_VALUE;
// new offset is fine -- move the thing
off_t moveBy = newOffset - partition->Offset();
move_descendants(partition, moveBy);
partition->Changed(B_PARTITION_CHANGED_OFFSET);
// implicit partitioning system changes
error = partition->Parent()->DiskSystem()->ShadowPartitionChanged(
partition->Parent(), partition, B_PARTITION_MOVE_CHILD);
if (error != B_OK)
return error;
// implicit descendants' content disk system changes
return move_descendants_contents(partition);
#endif
return B_BAD_VALUE;
}