mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +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:
committed by
Andreas Kling
parent
a9946a99f2
commit
6af2418de7
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user