1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 23:25:08 +00:00

Add a simple /bin/df which gathers its info from /proc/df.

This commit is contained in:
Andreas Kling 2019-02-21 14:48:00 +01:00
parent 7d288aafb2
commit 43075e5878
8 changed files with 119 additions and 0 deletions

View file

@ -1359,3 +1359,27 @@ bool Ext2FSInode::chmod(mode_t mode, int& error)
set_metadata_dirty(true);
return true;
}
unsigned Ext2FS::total_block_count() const
{
LOCKER(m_lock);
return super_block().s_blocks_count;
}
unsigned Ext2FS::free_block_count() const
{
LOCKER(m_lock);
return super_block().s_free_blocks_count;
}
unsigned Ext2FS::total_inode_count() const
{
LOCKER(m_lock);
return super_block().s_inodes_count;
}
unsigned Ext2FS::free_inode_count() const
{
LOCKER(m_lock);
return super_block().s_free_inodes_count;
}