mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
Kernel: Pass a Custody instead of Inode to VFS methods
VFS no longer deals with inodes in public API, only with custodies and file descriptions. Talk directly to the file system if you need to operate on a inode. In most cases you actually want to go though VFS, to get proper permission check and other niceties. For this to work, you have to provide a custody, which describes *how* you have opened the inode, not just what the inode is.
This commit is contained in:
parent
a9946a99f2
commit
6af2418de7
Notes:
sideshowbarker
2024-07-19 06:01:12 +09:00
Author: https://github.com/bugaevc
Commit: 6af2418de7
Pull-request: https://github.com/SerenityOS/serenity/pull/2430
Reviewed-by: https://github.com/alimpfard
3 changed files with 12 additions and 10 deletions
|
@ -100,13 +100,15 @@ KResult InodeFile::truncate(u64 size)
|
|||
KResult InodeFile::chown(FileDescription& description, uid_t uid, gid_t gid)
|
||||
{
|
||||
ASSERT(description.inode() == m_inode);
|
||||
return VFS::the().chown(*m_inode, uid, gid);
|
||||
ASSERT(description.custody());
|
||||
return VFS::the().chown(*description.custody(), uid, gid);
|
||||
}
|
||||
|
||||
KResult InodeFile::chmod(FileDescription& description, mode_t mode)
|
||||
{
|
||||
ASSERT(description.inode() == m_inode);
|
||||
return VFS::the().chmod(*m_inode, mode);
|
||||
ASSERT(description.custody());
|
||||
return VFS::the().chmod(*description.custody(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue