mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +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
|
@ -63,22 +63,22 @@ public:
|
|||
bool mount(RetainPtr<FS>&&, StringView path);
|
||||
|
||||
KResultOr<Retained<FileDescriptor>> open(RetainPtr<Device>&&, int options);
|
||||
KResultOr<Retained<FileDescriptor>> open(StringView path, int options, mode_t mode, Inode& base);
|
||||
KResultOr<Retained<FileDescriptor>> create(StringView path, int options, mode_t mode, Inode& base);
|
||||
KResult mkdir(StringView path, mode_t mode, Inode& base);
|
||||
KResult link(StringView old_path, StringView new_path, Inode& base);
|
||||
KResult unlink(StringView path, Inode& base);
|
||||
KResult symlink(StringView target, StringView linkpath, Inode& base);
|
||||
KResult rmdir(StringView path, Inode& base);
|
||||
KResult chmod(StringView path, mode_t, Inode& base);
|
||||
KResult chmod(Inode&, mode_t);
|
||||
KResult chown(StringView path, uid_t, gid_t, Inode& base);
|
||||
KResult access(StringView path, int mode, Inode& base);
|
||||
KResult stat(StringView path, int options, Inode& base, struct stat&);
|
||||
KResult utime(StringView path, Inode& base, time_t atime, time_t mtime);
|
||||
KResult rename(StringView oldpath, StringView newpath, Inode& base);
|
||||
KResult mknod(StringView path, mode_t, dev_t, Inode& base);
|
||||
KResultOr<Retained<Inode>> open_directory(StringView path, Inode& base);
|
||||
KResultOr<Retained<FileDescriptor>> open(StringView path, int options, mode_t mode, Custody& base);
|
||||
KResultOr<Retained<FileDescriptor>> create(StringView path, int options, mode_t mode, Custody& base);
|
||||
KResult mkdir(StringView path, mode_t mode, Custody& base);
|
||||
KResult link(StringView old_path, StringView new_path, Custody& base);
|
||||
KResult unlink(StringView path, Custody& base);
|
||||
KResult symlink(StringView target, StringView linkpath, Custody& base);
|
||||
KResult rmdir(StringView path, Custody& base);
|
||||
KResult chmod(StringView path, mode_t, Custody& base);
|
||||
KResult fchmod(Inode&, mode_t);
|
||||
KResult chown(StringView path, uid_t, gid_t, Custody& base);
|
||||
KResult access(StringView path, int mode, Custody& base);
|
||||
KResult stat(StringView path, int options, Custody& base, struct stat&);
|
||||
KResult utime(StringView path, Custody& base, time_t atime, time_t mtime);
|
||||
KResult rename(StringView oldpath, StringView newpath, Custody& base);
|
||||
KResult mknod(StringView path, mode_t, dev_t, Custody& base);
|
||||
KResultOr<Retained<Custody>> open_directory(StringView path, Custody& base);
|
||||
|
||||
void register_device(Device&);
|
||||
void unregister_device(Device&);
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
Device* get_device(unsigned major, unsigned minor);
|
||||
|
||||
Custody& root_custody();
|
||||
KResultOr<Retained<Custody>> resolve_path_to_custody(StringView path, Custody& base, int options = 0);
|
||||
KResultOr<Retained<Custody>> resolve_path_to_custody(StringView path, Custody& base, RetainPtr<Custody>* parent = nullptr, int options = 0);
|
||||
|
||||
private:
|
||||
friend class FileDescriptor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue