1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

Kernel/ProcFS: Remove unused ProcFSExposedComponent::entries_count()

This commit is contained in:
Andreas Kling 2021-07-17 23:23:01 +02:00
parent d686d2ef18
commit 6fae2a5f9e
3 changed files with 0 additions and 33 deletions

View file

@ -61,7 +61,6 @@ class ProcFSProcessStacks final : public ProcFSExposedDirectory {
// therefore, we don't use m_components so when we are done with the ProcFSThreadStack object,
// It should be deleted (as soon as possible)
public:
virtual KResultOr<size_t> entries_count() const override;
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
@ -87,18 +86,6 @@ private:
mutable Mutex m_lock;
};
KResultOr<size_t> ProcFSProcessStacks::entries_count() const
{
Locker locker(m_lock);
auto parent_folder = m_process_folder.strong_ref();
if (parent_folder.is_null())
return KResult(EINVAL);
auto process = parent_folder->associated_process();
if (process.is_null())
return KResult(ESRCH);
return process->thread_count();
}
KResult ProcFSProcessStacks::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
{
Locker locker(m_lock);
@ -171,7 +158,6 @@ class ProcFSProcessFileDescriptions final : public ProcFSExposedDirectory {
// therefore, we don't use m_components so when we are done with the ProcFSProcessFileDescription object,
// It should be deleted (as soon as possible)
public:
virtual KResultOr<size_t> entries_count() const override;
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
@ -196,17 +182,6 @@ private:
mutable Mutex m_lock;
};
KResultOr<size_t> ProcFSProcessFileDescriptions::entries_count() const
{
Locker locker(m_lock);
auto parent_folder = m_process_folder.strong_ref();
if (parent_folder.is_null())
return KResult(EINVAL);
auto process = parent_folder->associated_process();
if (process.is_null())
return KResult(ESRCH);
return process->fds().open_count();
}
KResult ProcFSProcessFileDescriptions::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
{
Locker locker(m_lock);