Skip to content

Commit

Permalink
Kernel+Userland: Remove shared buffers (shbufs)
Browse files Browse the repository at this point in the history
All users of this mechanism have been switched to anonymous files and
passing file descriptors with sendfd()/recvfd().

Shbufs got us where we are today, but it's time we say good-bye to them
and welcome a much more idiomatic replacement. :^)
  • Loading branch information
awesomekling committed Jan 17, 2021
1 parent 2cd1677 commit bf07190
Show file tree
Hide file tree
Showing 28 changed files with 2 additions and 1,022 deletions.
6 changes: 0 additions & 6 deletions AK/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ constexpr bool debug_scheduler_runnable = true;
constexpr bool debug_scheduler_runnable = false;
#endif

#ifdef SHARED_BUFFER_DEBUG
constexpr bool debug_shared_buffer = true;
#else
constexpr bool debug_shared_buffer = false;
#endif

#ifdef THREAD_DEBUG
constexpr bool debug_thread = true;
#else
Expand Down
2 changes: 0 additions & 2 deletions AK/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class JsonArray;
class JsonObject;
class JsonValue;
class LogStream;
class SharedBuffer;
class StackInfo;
class String;
class StringBuilder;
Expand Down Expand Up @@ -169,7 +168,6 @@ using AK::OutputStream;
using AK::OwnPtr;
using AK::ReadonlyBytes;
using AK::RefPtr;
using AK::SharedBuffer;
using AK::SinglyLinkedList;
using AK::Span;
using AK::StackInfo;
Expand Down
168 changes: 0 additions & 168 deletions AK/SharedBuffer.cpp

This file was deleted.

68 changes: 0 additions & 68 deletions AK/SharedBuffer.h

This file was deleted.

1 change: 0 additions & 1 deletion Base/usr/share/man/man2/pledge.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ If the process later attempts to use any system functionality it has previously
* `dpath`: Creating new device files
* `chown`: Changing file owner/group
* `fattr`: Changing file attributes/permissions
* `shared_buffer`: Shared memory buffers (\*)
* `chroot`: The [`chroot(2)`](chroot.md) syscall (\*)
* `video`: May use [`ioctl(2)`](ioctl.md) and [`mmap(2)`](mmap.md) on framebuffer video devices
* `settime`: Changing the system time and date
Expand Down
28 changes: 0 additions & 28 deletions Base/usr/share/man/man2/shbuf_allow_pid.md

This file was deleted.

27 changes: 0 additions & 27 deletions Base/usr/share/man/man2/shbuf_create.md

This file was deleted.

4 changes: 0 additions & 4 deletions Kernel/API/Syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ namespace Kernel {
S(accept) \
S(listen) \
S(connect) \
S(shbuf_create) \
S(shbuf_allow_pid) \
S(shbuf_get) \
S(shbuf_release) \
S(link) \
S(chown) \
S(fchmod) \
Expand Down
2 changes: 0 additions & 2 deletions Kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ set(KERNEL_SOURCES
RTC.cpp
Random.cpp
Scheduler.cpp
SharedBuffer.cpp
StdLib.cpp
Syscall.cpp
Syscalls/anon_create.cpp
Expand Down Expand Up @@ -157,7 +156,6 @@ set(KERNEL_SOURCES
Syscalls/setkeymap.cpp
Syscalls/setpgid.cpp
Syscalls/setuid.cpp
Syscalls/shbuf.cpp
Syscalls/shutdown.cpp
Syscalls/sigaction.cpp
Syscalls/socket.cpp
Expand Down
1 change: 0 additions & 1 deletion Kernel/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class RangeAllocator;
class Region;
class Scheduler;
class SchedulerPerProcessorData;
class SharedBuffer;
class Socket;
template<typename BaseType>
class SpinLock;
Expand Down
3 changes: 1 addition & 2 deletions Kernel/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
#include <Kernel/PerformanceEventBuffer.h>
#include <Kernel/Process.h>
#include <Kernel/RTC.h>
#include <Kernel/SharedBuffer.h>
#include <Kernel/StdLib.h>
#include <Kernel/TTY/TTY.h>
#include <Kernel/Thread.h>
#include <Kernel/VM/AnonymousVMObject.h>
#include <Kernel/VM/PageDirectory.h>
#include <Kernel/VM/PrivateInodeVMObject.h>
#include <Kernel/VM/ProcessPagingScope.h>
Expand Down Expand Up @@ -644,7 +644,6 @@ void Process::finalize()

m_dead = true;

disown_all_shared_buffers();
{
// FIXME: PID/TID BUG
if (auto parent_thread = Thread::from_tid(m_ppid.value())) {
Expand Down
Loading

0 comments on commit bf07190

Please sign in to comment.