Skip to content

Commit 12ce6ef

Browse files
timschumiawesomekling
authored andcommitted
Kernel+Userland: Remove the nfds entry from /sys/kernel/processes
`process.fds()` is protected by a Mutex, which causes issues when we try to acquire it while holding a Spinlock. Since nothing seems to use this value, let's just remove it entirely for now.
1 parent ce483fb commit 12ce6ef

File tree

4 files changed

+0
-5
lines changed

4 files changed

+0
-5
lines changed

Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ ErrorOr<void> SysFSOverallProcesses::try_generate(KBufferBuilder& builder)
8181
} else {
8282
TRY(process_object.add("tty"sv, ""));
8383
}
84-
TRY(process_object.add("nfds"sv, process.fds().with_shared([](auto& fds) { return fds.open_count(); })));
8584
TRY(process.name().with([&](auto& process_name) { return process_object.add("name"sv, process_name->view()); }));
8685
TRY(process_object.add("executable"sv, process.executable() ? TRY(process.executable()->try_serialize_absolute_path())->view() : ""sv));
8786

Userland/Libraries/LibCore/ProcessStatisticsReader.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ ErrorOr<AllProcessesStatistics> ProcessStatisticsReader::get_all(SeekableStream&
3636
process.uid = process_object.get_u32("uid"sv).value_or(0);
3737
process.gid = process_object.get_u32("gid"sv).value_or(0);
3838
process.ppid = process_object.get_u32("ppid"sv).value_or(0);
39-
process.nfds = process_object.get_u32("nfds"sv).value_or(0);
4039
process.kernel = process_object.get_bool("kernel"sv).value_or(false);
4140
process.name = process_object.get_deprecated_string("name"sv).value_or("");
4241
process.executable = process_object.get_deprecated_string("executable"sv).value_or("");

Userland/Libraries/LibCore/ProcessStatisticsReader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ struct ProcessStatistics {
4343
uid_t uid;
4444
gid_t gid;
4545
pid_t ppid;
46-
unsigned nfds;
4746
bool kernel;
4847
DeprecatedString name;
4948
DeprecatedString executable;

Userland/Utilities/top.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ struct ThreadData {
4646
uid_t uid;
4747
gid_t gid;
4848
pid_t ppid;
49-
unsigned nfds;
5049
DeprecatedString name;
5150
DeprecatedString tty;
5251
size_t amount_virtual;
@@ -105,7 +104,6 @@ static ErrorOr<Snapshot> get_snapshot()
105104
thread_data.uid = process.uid;
106105
thread_data.gid = process.gid;
107106
thread_data.ppid = process.ppid;
108-
thread_data.nfds = process.nfds;
109107
thread_data.name = process.name;
110108
thread_data.tty = process.tty;
111109
thread_data.amount_virtual = process.amount_virtual;

0 commit comments

Comments
 (0)