summaryrefslogtreecommitdiff
path: root/Kernel/VirtualFileSystem.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-21 13:26:40 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-21 13:26:40 +0100
commit7d288aafb25f44a63cf1e4c3e262b4906bc12b21 (patch)
treed35e02d7a9441889cab5d3455e12a341f3110a0d /Kernel/VirtualFileSystem.h
parentb6115ee5b7aaccc6c8597534cc64d339e038f578 (diff)
downloadserenity-7d288aafb25f44a63cf1e4c3e262b4906bc12b21.zip
Kernel: Add link() syscall to create hard links.
This accidentally grew into a little bit of VFS cleanup as well. Also add a simple /bin/ln implementation to exercise it.
Diffstat (limited to 'Kernel/VirtualFileSystem.h')
-rw-r--r--Kernel/VirtualFileSystem.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/VirtualFileSystem.h b/Kernel/VirtualFileSystem.h
index f5b57c98a0..ca822ce5fa 100644
--- a/Kernel/VirtualFileSystem.h
+++ b/Kernel/VirtualFileSystem.h
@@ -66,6 +66,7 @@ public:
RetainPtr<FileDescriptor> open(const String& path, int& error, int options, mode_t mode, Inode& base);
RetainPtr<FileDescriptor> create(const String& path, int& error, int options, mode_t mode, Inode& base);
bool mkdir(const String& path, mode_t mode, Inode& base, int& error);
+ bool link(const String& old_path, const String& new_path, Inode& base, int& error);
bool unlink(const String& path, Inode& base, int& error);
bool rmdir(const String& path, Inode& base, int& error);
bool chmod(const String& path, mode_t, Inode& base, int& error);
@@ -96,6 +97,7 @@ private:
void traverse_directory_inode(Inode&, Function<bool(const FS::DirectoryEntry&)>);
InodeIdentifier resolve_path(const String& path, InodeIdentifier base, int& error, int options = 0, InodeIdentifier* parent_id = nullptr);
+ RetainPtr<Inode> resolve_path_to_inode(const String& path, Inode& base, int& error, RetainPtr<Inode>* parent_id = nullptr);
InodeIdentifier resolve_symbolic_link(InodeIdentifier base, Inode& symlink_inode, int& error);
Mount* find_mount_for_host(InodeIdentifier);