本文整理汇总了C++中Volume::CountBlocks方法的典型用法代码示例。如果您正苦于以下问题:C++ Volume::CountBlocks方法的具体用法?C++ Volume::CountBlocks怎么用?C++ Volume::CountBlocks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Volume
的用法示例。
在下文中一共展示了Volume::CountBlocks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
// reiserfs_read_fs_info
static status_t
reiserfs_read_fs_info(fs_volume* fs, struct fs_info *info)
{
FUNCTION_START();
Volume *volume = (Volume*)fs->private_volume;
info->flags = B_FS_IS_PERSISTENT | B_FS_IS_READONLY;
info->block_size = volume->GetBlockSize();
info->io_size = kOptimalIOSize;
info->total_blocks = volume->CountBlocks();
info->free_blocks = volume->CountFreeBlocks();
strlcpy(info->device_name, volume->GetDeviceName(),
sizeof(info->device_name));
strlcpy(info->volume_name, volume->GetName(), sizeof(info->volume_name));
return B_OK;
}
示例2: strdup
// reiserfs_scan_partition
static status_t
reiserfs_scan_partition(int fd, partition_data *partition, void *_cookie)
{
Volume* volume = (Volume*)_cookie;
partition->status = B_PARTITION_VALID;
partition->flags |= B_PARTITION_FILE_SYSTEM;
partition->content_size = volume->CountBlocks()
* volume->GetBlockSize();
partition->block_size = volume->GetBlockSize();
volume->UpdateName(partition->id);
// must be done after setting the content size
partition->content_name = strdup(volume->GetName());
if (partition->content_name == NULL)
return B_NO_MEMORY;
return B_OK;
}