diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-07 09:36:51 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-07 09:36:51 +0200 |
commit | 08cd75ac4baa2814bb6154c3ad127957b3b03b7c (patch) | |
tree | 87d8bcc40d4bd536c02cbef49c91e5520a44594a /Kernel/FileSystem/ProcFS.cpp | |
parent | 69a6ce90df7e0f074a714e0938cfd526076e38a3 (diff) | |
download | serenity-08cd75ac4baa2814bb6154c3ad127957b3b03b7c.zip |
Kernel: Rename FileDescriptor to FileDescription.
After reading a bunch of POSIX specs, I've learned that a file descriptor
is the number that refers to a file description, not the description itself.
So this patch renames FileDescriptor to FileDescription, and Process now has
FileDescription* file_description(int fd).
Diffstat (limited to 'Kernel/FileSystem/ProcFS.cpp')
-rw-r--r-- | Kernel/FileSystem/ProcFS.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index b09b89e163..73aeb43743 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -1,7 +1,7 @@ #include "ProcFS.h" #include "Process.h" #include <Kernel/FileSystem/Custody.h> -#include <Kernel/FileSystem/FileDescriptor.h> +#include <Kernel/FileSystem/FileDescription.h> #include <Kernel/FileSystem/VirtualFileSystem.h> #include <Kernel/VM/MemoryManager.h> #include "StdLib.h" @@ -189,7 +189,7 @@ ByteBuffer procfs$pid_fds(InodeIdentifier identifier) return { }; StringBuilder builder; for (int i = 0; i < process.max_open_file_descriptors(); ++i) { - auto* descriptor = process.file_descriptor(i); + auto* descriptor = process.file_description(i); if (!descriptor) continue; builder.appendf("% 3u %s\n", i, descriptor->absolute_path().characters()); @@ -204,7 +204,7 @@ ByteBuffer procfs$pid_fd_entry(InodeIdentifier identifier) return { }; auto& process = handle->process(); int fd = to_fd(identifier); - auto* descriptor = process.file_descriptor(fd); + auto* descriptor = process.file_description(fd); if (!descriptor) return { }; return descriptor->absolute_path().to_byte_buffer(); @@ -835,7 +835,7 @@ InodeMetadata ProcFSInode::metadata() const return metadata; } -ssize_t ProcFSInode::read_bytes(off_t offset, ssize_t count, byte* buffer, FileDescriptor* descriptor) const +ssize_t ProcFSInode::read_bytes(off_t offset, ssize_t count, byte* buffer, FileDescription* descriptor) const { #ifdef PROCFS_DEBUG dbgprintf("ProcFS: read_bytes %u\n", index()); @@ -941,7 +941,7 @@ bool ProcFSInode::traverse_as_directory(Function<bool(const FS::DirectoryEntry&) return false; auto& process = handle->process(); for (int i = 0; i < process.max_open_file_descriptors(); ++i) { - auto* descriptor = process.file_descriptor(i); + auto* descriptor = process.file_description(i); if (!descriptor) continue; char name[16]; @@ -1027,7 +1027,7 @@ InodeIdentifier ProcFSInode::lookup(StringView name) { InterruptDisabler disabler; if (auto* process = Process::from_pid(to_pid(identifier()))) - fd_exists = process->file_descriptor(name_as_number); + fd_exists = process->file_description(name_as_number); } if (fd_exists) @@ -1041,7 +1041,7 @@ void ProcFSInode::flush_metadata() { } -ssize_t ProcFSInode::write_bytes(off_t offset, ssize_t size, const byte* buffer, FileDescriptor*) +ssize_t ProcFSInode::write_bytes(off_t offset, ssize_t size, const byte* buffer, FileDescription*) { auto* directory_entry = fs().get_directory_entry(identifier()); if (!directory_entry || !directory_entry->write_callback) |