diff options
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/SysFS.cpp | 9 | ||||
-rw-r--r-- | Kernel/FileSystem/SysFS.h | 1 | ||||
-rw-r--r-- | Kernel/FileSystem/SysFSComponent.h | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/Kernel/FileSystem/SysFS.cpp b/Kernel/FileSystem/SysFS.cpp index bedf3d6353..cc26614663 100644 --- a/Kernel/FileSystem/SysFS.cpp +++ b/Kernel/FileSystem/SysFS.cpp @@ -182,9 +182,14 @@ KResult SysFSInode::chown(UserID, GroupID) return EPERM; } -KResult SysFSInode::truncate(u64) +KResult SysFSInode::set_mtime(time_t time) { - return EPERM; + return m_associated_component->set_mtime(time); +} + +KResult SysFSInode::truncate(u64 size) +{ + return m_associated_component->truncate(size); } KResultOr<NonnullRefPtr<SysFSDirectoryInode>> SysFSDirectoryInode::try_create(SysFS const& sysfs, SysFSComponent const& component) diff --git a/Kernel/FileSystem/SysFS.h b/Kernel/FileSystem/SysFS.h index 886c31eeb9..4b8bf05c94 100644 --- a/Kernel/FileSystem/SysFS.h +++ b/Kernel/FileSystem/SysFS.h @@ -146,6 +146,7 @@ protected: virtual KResult chmod(mode_t) override; virtual KResult chown(UserID, GroupID) override; virtual KResult truncate(u64) override; + virtual KResult set_mtime(time_t); virtual KResult attach(OpenFileDescription& description) override final; virtual void did_seek(OpenFileDescription&, off_t) override final; diff --git a/Kernel/FileSystem/SysFSComponent.h b/Kernel/FileSystem/SysFSComponent.h index c6711a3c47..30f1c66ebb 100644 --- a/Kernel/FileSystem/SysFSComponent.h +++ b/Kernel/FileSystem/SysFSComponent.h @@ -30,6 +30,8 @@ public: virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const { VERIFY_NOT_REACHED(); } virtual RefPtr<SysFSComponent> lookup(StringView) { VERIFY_NOT_REACHED(); }; virtual mode_t permissions() const; + virtual KResult truncate(u64) { return EPERM; } + virtual KResult set_mtime(time_t) { return ENOTIMPL; } virtual KResultOr<size_t> write_bytes(off_t, size_t, UserOrKernelBuffer const&, OpenFileDescription*) { return EROFS; } virtual KResult refresh_data(OpenFileDescription&) const { return KSuccess; } |