mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
FileSystem: Port most of the code over to using custodies.
The current working directory is now stored as a custody. Likewise for a process executable file. This unbreaks /proc/PID/fd which has not been working since we made the filesystem bigger. This still needs a bunch of work, for instance when renaming or removing a file somewhere, we have to update the relevant custody links.
This commit is contained in:
parent
4cb87b1753
commit
393851418b
11 changed files with 280 additions and 220 deletions
|
@ -233,8 +233,8 @@ public:
|
|||
template<typename T>
|
||||
bool validate_write_typed(T* value, size_t count = 1) { return validate_write(value, sizeof(T) * count); }
|
||||
|
||||
Inode& cwd_inode();
|
||||
Inode* executable_inode() { return m_executable.ptr(); }
|
||||
Custody& cwd_custody();
|
||||
Custody* executable_custody() { return m_executable_custody.ptr(); }
|
||||
|
||||
int number_of_open_file_descriptors() const;
|
||||
int max_open_file_descriptors() const { return m_max_open_file_descriptors; }
|
||||
|
@ -273,7 +273,7 @@ private:
|
|||
friend class Scheduler;
|
||||
friend class Region;
|
||||
|
||||
Process(String&& name, uid_t, gid_t, pid_t ppid, RingLevel, RetainPtr<Inode>&& cwd = nullptr, RetainPtr<Inode>&& executable = nullptr, TTY* = nullptr, Process* fork_parent = nullptr);
|
||||
Process(String&& name, uid_t, gid_t, pid_t ppid, RingLevel, RetainPtr<Custody>&& cwd = nullptr, RetainPtr<Custody>&& executable = nullptr, TTY* = nullptr, Process* fork_parent = nullptr);
|
||||
|
||||
Range allocate_range(LinearAddress, size_t);
|
||||
|
||||
|
@ -319,8 +319,8 @@ private:
|
|||
byte m_termination_status { 0 };
|
||||
byte m_termination_signal { 0 };
|
||||
|
||||
RetainPtr<Inode> m_cwd;
|
||||
RetainPtr<Inode> m_executable;
|
||||
RetainPtr<Custody> m_executable_custody;
|
||||
RetainPtr<Custody> m_cwd_custody;
|
||||
|
||||
TTY* m_tty { nullptr };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue