mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 15:58:47 +00:00
Kernel: Add FIBMAP ioctl to Ext2FileSystem
FIBMAP is a linux ioctl that gives the location on disk of a specific block of a file
This commit is contained in:
parent
e8aae033f1
commit
c0e88b9710
Notes:
sideshowbarker
2024-07-18 22:43:13 +09:00
Author: https://github.com/petelliott
Commit: c0e88b9710
Pull-request: https://github.com/SerenityOS/serenity/pull/5187
6 changed files with 53 additions and 1 deletions
|
@ -1694,6 +1694,19 @@ KResult Ext2FSInode::truncate(u64 size)
|
|||
return KSuccess;
|
||||
}
|
||||
|
||||
KResultOr<int> Ext2FSInode::get_block_address(int index)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
|
||||
if (m_block_list.is_empty())
|
||||
m_block_list = fs().block_list_for_inode(m_raw_inode);
|
||||
|
||||
if (index < 0 || (size_t)index >= m_block_list.size())
|
||||
return 0;
|
||||
|
||||
return m_block_list[index];
|
||||
}
|
||||
|
||||
unsigned Ext2FS::total_block_count() const
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue