mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 19:07:35 +00:00
Kernel/ProcFS: Remove unused ProcFSExposedComponent::entries_count()
This commit is contained in:
parent
d686d2ef18
commit
6fae2a5f9e
3 changed files with 0 additions and 33 deletions
|
@ -123,7 +123,6 @@ public:
|
||||||
void plug(USB::Device&);
|
void plug(USB::Device&);
|
||||||
void unplug(USB::Device&);
|
void unplug(USB::Device&);
|
||||||
|
|
||||||
virtual KResultOr<size_t> entries_count() const override;
|
|
||||||
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
||||||
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
|
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
|
||||||
|
|
||||||
|
@ -136,11 +135,6 @@ private:
|
||||||
mutable SpinLock<u8> m_lock;
|
mutable SpinLock<u8> m_lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
KResultOr<size_t> ProcFSUSBBusDirectory::entries_count() const
|
|
||||||
{
|
|
||||||
ScopedSpinLock lock(m_lock);
|
|
||||||
return m_device_nodes.size_slow();
|
|
||||||
}
|
|
||||||
KResult ProcFSUSBBusDirectory::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
KResult ProcFSUSBBusDirectory::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
||||||
{
|
{
|
||||||
ScopedSpinLock lock(m_lock);
|
ScopedSpinLock lock(m_lock);
|
||||||
|
|
|
@ -47,7 +47,6 @@ private:
|
||||||
|
|
||||||
class ProcFSExposedComponent : public RefCounted<ProcFSExposedComponent> {
|
class ProcFSExposedComponent : public RefCounted<ProcFSExposedComponent> {
|
||||||
public:
|
public:
|
||||||
virtual KResultOr<size_t> entries_count() const { VERIFY_NOT_REACHED(); };
|
|
||||||
StringView name() const { return m_name->view(); }
|
StringView name() const { return m_name->view(); }
|
||||||
virtual KResultOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, FileDescription*) const { VERIFY_NOT_REACHED(); }
|
virtual KResultOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, FileDescription*) const { VERIFY_NOT_REACHED(); }
|
||||||
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const { VERIFY_NOT_REACHED(); }
|
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const { VERIFY_NOT_REACHED(); }
|
||||||
|
@ -88,7 +87,6 @@ class ProcFSExposedDirectory
|
||||||
friend class ProcFSComponentRegistry;
|
friend class ProcFSComponentRegistry;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual KResultOr<size_t> entries_count() const override { return m_components.size(); };
|
|
||||||
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
||||||
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
|
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
|
||||||
void add_component(const ProcFSExposedComponent&);
|
void add_component(const ProcFSExposedComponent&);
|
||||||
|
|
|
@ -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,
|
// therefore, we don't use m_components so when we are done with the ProcFSThreadStack object,
|
||||||
// It should be deleted (as soon as possible)
|
// It should be deleted (as soon as possible)
|
||||||
public:
|
public:
|
||||||
virtual KResultOr<size_t> entries_count() const override;
|
|
||||||
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
||||||
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
|
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
|
||||||
|
|
||||||
|
@ -87,18 +86,6 @@ private:
|
||||||
mutable Mutex m_lock;
|
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
|
KResult ProcFSProcessStacks::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
||||||
{
|
{
|
||||||
Locker locker(m_lock);
|
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,
|
// therefore, we don't use m_components so when we are done with the ProcFSProcessFileDescription object,
|
||||||
// It should be deleted (as soon as possible)
|
// It should be deleted (as soon as possible)
|
||||||
public:
|
public:
|
||||||
virtual KResultOr<size_t> entries_count() const override;
|
|
||||||
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
||||||
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
|
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
|
||||||
|
|
||||||
|
@ -196,17 +182,6 @@ private:
|
||||||
mutable Mutex m_lock;
|
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
|
KResult ProcFSProcessFileDescriptions::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
||||||
{
|
{
|
||||||
Locker locker(m_lock);
|
Locker locker(m_lock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue