mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
Kernel: Implement InodeFile::stat() and simplify FileDescription::stat()
This commit is contained in:
parent
675b0aee24
commit
cac94b1c16
Notes:
sideshowbarker
2024-07-18 12:39:22 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/cac94b1c16b Pull-request: https://github.com/SerenityOS/serenity/pull/7867
@ -110,9 +110,6 @@ Thread::FileBlocker::BlockFlags FileDescription::should_unblock(Thread::FileBloc
|
||||
KResult FileDescription::stat(::stat& buffer)
|
||||
{
|
||||
Locker locker(m_lock);
|
||||
// FIXME: This is a little awkward, why can't we always forward to File::stat()?
|
||||
if (m_inode)
|
||||
return metadata().stat(buffer);
|
||||
return m_file->stat(buffer);
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
virtual KResultOr<size_t> write(FileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
|
||||
virtual int ioctl(FileDescription&, unsigned request, FlatPtr arg) override;
|
||||
virtual KResultOr<Region*> mmap(Process&, FileDescription&, const Range&, u64 offset, int prot, bool shared) override;
|
||||
virtual KResult stat(::stat& buffer) const override { return inode().metadata().stat(buffer); }
|
||||
|
||||
virtual String absolute_path(const FileDescription&) const override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user