Ext2FS: Support shrinking inode to a smaller size.

Factor out inode resizing into a separate Ext2FSInode::resize() function.
This is then called both from write_bytes() and truncate().
This patch finally implements freeing of blocks when an inode shrinks.
This commit is contained in:
Andreas Kling 2019-04-28 22:07:25 +02:00
commit 899f6a5de2
Notes: sideshowbarker 2024-07-19 14:33:34 +09:00
2 changed files with 50 additions and 30 deletions

View file

@ -45,6 +45,7 @@ private:
virtual KResult truncate(off_t) override;
void populate_lookup_cache() const;
bool resize(qword);
Ext2FS& fs();
const Ext2FS& fs() const;