diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-21 14:48:00 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-21 14:48:00 +0100 |
commit | 43075e5878e4ef6e12c9cd94c96d0954239125f4 (patch) | |
tree | e03e616841221aaa13d25f04729a77ebaace9e1a /Kernel/Ext2FileSystem.cpp | |
parent | 7d288aafb25f44a63cf1e4c3e262b4906bc12b21 (diff) | |
download | serenity-43075e5878e4ef6e12c9cd94c96d0954239125f4.zip |
Add a simple /bin/df which gathers its info from /proc/df.
Diffstat (limited to 'Kernel/Ext2FileSystem.cpp')
-rw-r--r-- | Kernel/Ext2FileSystem.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Kernel/Ext2FileSystem.cpp b/Kernel/Ext2FileSystem.cpp index 4ef19c48bc..f4a7f452be 100644 --- a/Kernel/Ext2FileSystem.cpp +++ b/Kernel/Ext2FileSystem.cpp @@ -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; +} |