summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/VirtualFileSystem.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-05-30 18:58:59 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-30 18:58:59 +0200
commit393851418b01f55052ad2f486ae808c959b7e3a4 (patch)
tree39380411926e9fcc3ac147d3125126371da0db44 /Kernel/FileSystem/VirtualFileSystem.h
parent4cb87b17536d64656e3f842a408d00c4072afc9b (diff)
downloadserenity-393851418b01f55052ad2f486ae808c959b7e3a4.zip
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.
Diffstat (limited to 'Kernel/FileSystem/VirtualFileSystem.h')
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.h b/Kernel/FileSystem/VirtualFileSystem.h
index 0dbef2bb36..16cd257ac7 100644
--- a/Kernel/FileSystem/VirtualFileSystem.h
+++ b/Kernel/FileSystem/VirtualFileSystem.h
@@ -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;