// 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; }
// 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; }