mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
Kernel: Rename "descriptor" to "description" where appropriate.
Now that FileDescription is called that, variables of that type should not be called "descriptor". This is kinda wordy but we'll get used to it.
This commit is contained in:
@@ -13,32 +13,32 @@ InodeFile::~InodeFile()
|
||||
{
|
||||
}
|
||||
|
||||
ssize_t InodeFile::read(FileDescription& descriptor, byte* buffer, ssize_t count)
|
||||
ssize_t InodeFile::read(FileDescription& description, byte* buffer, ssize_t count)
|
||||
{
|
||||
return m_inode->read_bytes(descriptor.offset(), count, buffer, &descriptor);
|
||||
return m_inode->read_bytes(description.offset(), count, buffer, &description);
|
||||
}
|
||||
|
||||
ssize_t InodeFile::write(FileDescription& descriptor, const byte* data, ssize_t count)
|
||||
ssize_t InodeFile::write(FileDescription& description, const byte* data, ssize_t count)
|
||||
{
|
||||
return m_inode->write_bytes(descriptor.offset(), count, data, &descriptor);
|
||||
return m_inode->write_bytes(description.offset(), count, data, &description);
|
||||
}
|
||||
|
||||
KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& descriptor, VirtualAddress preferred_vaddr, size_t offset, size_t size, int prot)
|
||||
KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& description, VirtualAddress preferred_vaddr, size_t offset, size_t size, int prot)
|
||||
{
|
||||
ASSERT(offset == 0);
|
||||
// FIXME: If PROT_EXEC, check that the underlying file system isn't mounted noexec.
|
||||
InterruptDisabler disabler;
|
||||
auto* region = process.allocate_file_backed_region(preferred_vaddr, size, inode(), descriptor.absolute_path(), prot);
|
||||
auto* region = process.allocate_file_backed_region(preferred_vaddr, size, inode(), description.absolute_path(), prot);
|
||||
if (!region)
|
||||
return KResult(-ENOMEM);
|
||||
return region;
|
||||
}
|
||||
|
||||
String InodeFile::absolute_path(const FileDescription& descriptor) const
|
||||
String InodeFile::absolute_path(const FileDescription& description) const
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
ASSERT(descriptor.custody());
|
||||
return descriptor.absolute_path();
|
||||
ASSERT(description.custody());
|
||||
return description.absolute_path();
|
||||
}
|
||||
|
||||
KResult InodeFile::truncate(off_t size)
|
||||
|
||||
Reference in New Issue
Block a user