mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
File metadata for CPMFS works.
This commit is contained in:
@@ -82,6 +82,32 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getMetadata()
|
||||
{
|
||||
mount();
|
||||
|
||||
unsigned usedBlocks = _dirBlocks;
|
||||
for (int d = 0; d < _config.dir_entries(); d++)
|
||||
{
|
||||
auto entry = getEntry(d);
|
||||
if (!entry)
|
||||
continue;
|
||||
|
||||
for (unsigned block : entry->allocation_map)
|
||||
{
|
||||
if (block)
|
||||
usedBlocks++;
|
||||
}
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> attributes;
|
||||
attributes[VOLUME_NAME] = "";
|
||||
attributes[TOTAL_BLOCKS] = fmt::format("{}", _filesystemBlocks);
|
||||
attributes[USED_BLOCKS] = fmt::format("{}", usedBlocks);
|
||||
attributes[BLOCK_SIZE] = fmt::format("{}", _config.block_size());
|
||||
return attributes;
|
||||
}
|
||||
|
||||
FilesystemStatus check()
|
||||
{
|
||||
return FS_OK;
|
||||
|
||||
Reference in New Issue
Block a user