summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-25 12:43:52 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-25 12:43:52 +0100
commit2cfcbdc735e7578a22ed2f9ae25492a72abe3f3f (patch)
treeffbb4403f13fe7d105951e965180638907f3662d /Kernel
parent0b957ed2b1cd6b4949c93c5b39b64b0caf060c12 (diff)
downloadserenity-2cfcbdc735e7578a22ed2f9ae25492a72abe3f3f.zip
AK: Add Retained<T>, like RetainPtr, but never null.
Also use some Clang attribute wizardry to get a warning for use-after-move.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/DevPtsFS.cpp4
-rw-r--r--Kernel/DevPtsFS.h4
-rw-r--r--Kernel/DiskBackedFileSystem.cpp3
-rw-r--r--Kernel/DiskBackedFileSystem.h4
-rw-r--r--Kernel/Ext2FileSystem.cpp4
-rw-r--r--Kernel/Ext2FileSystem.h4
-rw-r--r--Kernel/FIFO.cpp2
-rw-r--r--Kernel/FIFO.h2
-rw-r--r--Kernel/FileDescriptor.cpp17
-rw-r--r--Kernel/FileDescriptor.h12
-rw-r--r--Kernel/IDEDiskDevice.cpp2
-rw-r--r--Kernel/IDEDiskDevice.h2
-rw-r--r--Kernel/LocalSocket.cpp2
-rw-r--r--Kernel/LocalSocket.h2
-rw-r--r--Kernel/Makefile6
-rw-r--r--Kernel/MemoryManager.cpp14
-rw-r--r--Kernel/MemoryManager.h16
-rw-r--r--Kernel/ProcFS.cpp2
-rw-r--r--Kernel/ProcFS.h2
-rw-r--r--Kernel/SyntheticFileSystem.cpp10
-rw-r--r--Kernel/SyntheticFileSystem.h10
-rw-r--r--Kernel/init.cpp2
22 files changed, 63 insertions, 63 deletions
diff --git a/Kernel/DevPtsFS.cpp b/Kernel/DevPtsFS.cpp
index ee7cb2bddd..e4c9ac8e0e 100644
--- a/Kernel/DevPtsFS.cpp
+++ b/Kernel/DevPtsFS.cpp
@@ -11,7 +11,7 @@ DevPtsFS& DevPtsFS::the()
return *s_the;
}
-RetainPtr<DevPtsFS> DevPtsFS::create()
+Retained<DevPtsFS> DevPtsFS::create()
{
return adopt(*new DevPtsFS);
}
@@ -36,7 +36,7 @@ const char* DevPtsFS::class_name() const
return "DevPtsFS";
}
-RetainPtr<SynthFSInode> DevPtsFS::create_slave_pty_device_file(unsigned index)
+Retained<SynthFSInode> DevPtsFS::create_slave_pty_device_file(unsigned index)
{
auto file = adopt(*new SynthFSInode(*this, generate_inode_index()));
diff --git a/Kernel/DevPtsFS.h b/Kernel/DevPtsFS.h
index 33a08f0c70..2355523cda 100644
--- a/Kernel/DevPtsFS.h
+++ b/Kernel/DevPtsFS.h
@@ -11,7 +11,7 @@ public:
[[gnu::pure]] static DevPtsFS& the();
virtual ~DevPtsFS() override;
- static RetainPtr<DevPtsFS> create();
+ static Retained<DevPtsFS> create();
virtual bool initialize() override;
virtual const char* class_name() const override;
@@ -22,7 +22,7 @@ public:
private:
DevPtsFS();
- RetainPtr<SynthFSInode> create_slave_pty_device_file(unsigned index);
+ Retained<SynthFSInode> create_slave_pty_device_file(unsigned index);
HashTable<SlavePTY*> m_slave_ptys;
};
diff --git a/Kernel/DiskBackedFileSystem.cpp b/Kernel/DiskBackedFileSystem.cpp
index e258ed3624..5b79955230 100644
--- a/Kernel/DiskBackedFileSystem.cpp
+++ b/Kernel/DiskBackedFileSystem.cpp
@@ -44,10 +44,9 @@ Lockable<InlineLRUCache<BlockIdentifier, CachedBlock>>& block_cache()
return *s_cache;
}
-DiskBackedFS::DiskBackedFS(RetainPtr<DiskDevice>&& device)
+DiskBackedFS::DiskBackedFS(Retained<DiskDevice>&& device)
: m_device(move(device))
{
- ASSERT(m_device);
}
DiskBackedFS::~DiskBackedFS()
diff --git a/Kernel/DiskBackedFileSystem.h b/Kernel/DiskBackedFileSystem.h
index 58de06f924..75448d9c16 100644
--- a/Kernel/DiskBackedFileSystem.h
+++ b/Kernel/DiskBackedFileSystem.h
@@ -13,7 +13,7 @@ public:
size_t block_size() const { return m_block_size; }
protected:
- explicit DiskBackedFS(RetainPtr<DiskDevice>&&);
+ explicit DiskBackedFS(Retained<DiskDevice>&&);
void set_block_size(unsigned);
@@ -25,5 +25,5 @@ protected:
private:
size_t m_block_size { 0 };
- RetainPtr<DiskDevice> m_device;
+ Retained<DiskDevice> m_device;
};
diff --git a/Kernel/Ext2FileSystem.cpp b/Kernel/Ext2FileSystem.cpp
index 94c49b72d3..64a304e876 100644
--- a/Kernel/Ext2FileSystem.cpp
+++ b/Kernel/Ext2FileSystem.cpp
@@ -13,12 +13,12 @@
//#define EXT2_DEBUG
-RetainPtr<Ext2FS> Ext2FS::create(RetainPtr<DiskDevice>&& device)
+Retained<Ext2FS> Ext2FS::create(Retained<DiskDevice>&& device)
{
return adopt(*new Ext2FS(move(device)));
}
-Ext2FS::Ext2FS(RetainPtr<DiskDevice>&& device)
+Ext2FS::Ext2FS(Retained<DiskDevice>&& device)
: DiskBackedFS(move(device))
, m_lock("Ext2FS")
{
diff --git a/Kernel/Ext2FileSystem.h b/Kernel/Ext2FileSystem.h
index 0d6a4dd47b..6f1d8421d1 100644
--- a/Kernel/Ext2FileSystem.h
+++ b/Kernel/Ext2FileSystem.h
@@ -58,7 +58,7 @@ private:
class Ext2FS final : public DiskBackedFS {
friend class Ext2FSInode;
public:
- static RetainPtr<Ext2FS> create(RetainPtr<DiskDevice>&&);
+ static Retained <Ext2FS> create(Retained<DiskDevice>&&);
virtual ~Ext2FS() override;
virtual bool initialize() override;
@@ -71,7 +71,7 @@ private:
typedef unsigned BlockIndex;
typedef unsigned GroupIndex;
typedef unsigned InodeIndex;
- explicit Ext2FS(RetainPtr<DiskDevice>&&);
+ explicit Ext2FS(Retained<DiskDevice>&&);
const ext2_super_block& super_block() const;
const ext2_group_desc& group_descriptor(unsigned groupIndex) const;
diff --git a/Kernel/FIFO.cpp b/Kernel/FIFO.cpp
index 2fbe23286c..dfb991b001 100644
--- a/Kernel/FIFO.cpp
+++ b/Kernel/FIFO.cpp
@@ -3,7 +3,7 @@
//#define FIFO_DEBUG
-RetainPtr<FIFO> FIFO::create()
+Retained<FIFO> FIFO::create()
{
return adopt(*new FIFO);
}
diff --git a/Kernel/FIFO.h b/Kernel/FIFO.h
index fbe1a4157e..77a802afb3 100644
--- a/Kernel/FIFO.h
+++ b/Kernel/FIFO.h
@@ -11,7 +11,7 @@ public:
Neither, Reader, Writer
};
- static RetainPtr<FIFO> create();
+ static Retained<FIFO> create();
void open(Direction);
void close(Direction);
diff --git a/Kernel/FileDescriptor.cpp b/Kernel/FileDescriptor.cpp
index 7d842c4196..67085bd5cc 100644
--- a/Kernel/FileDescriptor.cpp
+++ b/Kernel/FileDescriptor.cpp
@@ -12,27 +12,27 @@
#include <Kernel/BlockDevice.h>
#include <Kernel/MemoryManager.h>
-RetainPtr<FileDescriptor> FileDescriptor::create(RetainPtr<Inode>&& inode)
+Retained<FileDescriptor> FileDescriptor::create(RetainPtr<Inode>&& inode)
{
return adopt(*new FileDescriptor(move(inode)));
}
-RetainPtr<FileDescriptor> FileDescriptor::create(RetainPtr<Device>&& device)
+Retained<FileDescriptor> FileDescriptor::create(RetainPtr<Device>&& device)
{
return adopt(*new FileDescriptor(move(device)));
}
-RetainPtr<FileDescriptor> FileDescriptor::create(RetainPtr<Socket>&& socket, SocketRole role)
+Retained<FileDescriptor> FileDescriptor::create(RetainPtr<Socket>&& socket, SocketRole role)
{
return adopt(*new FileDescriptor(move(socket), role));
}
-RetainPtr<FileDescriptor> FileDescriptor::create_pipe_writer(FIFO& fifo)
+Retained<FileDescriptor> FileDescriptor::create_pipe_writer(FIFO& fifo)
{
return adopt(*new FileDescriptor(fifo, FIFO::Writer));
}
-RetainPtr<FileDescriptor> FileDescriptor::create_pipe_reader(FIFO& fifo)
+Retained<FileDescriptor> FileDescriptor::create_pipe_reader(FIFO& fifo)
{
return adopt(*new FileDescriptor(fifo, FIFO::Reader));
}
@@ -80,7 +80,7 @@ void FileDescriptor::set_socket_role(SocketRole role)
m_socket->attach_fd(role);
}
-RetainPtr<FileDescriptor> FileDescriptor::clone()
+Retained<FileDescriptor> FileDescriptor::clone()
{
RetainPtr<FileDescriptor> descriptor;
if (is_fifo()) {
@@ -98,12 +98,11 @@ RetainPtr<FileDescriptor> FileDescriptor::clone()
descriptor = FileDescriptor::create(m_inode.copy_ref());
}
}
- if (!descriptor)
- return nullptr;
+ ASSERT(descriptor);
descriptor->m_current_offset = m_current_offset;
descriptor->m_is_blocking = m_is_blocking;
descriptor->m_file_flags = m_file_flags;
- return descriptor;
+ return *descriptor;
}
bool addition_would_overflow(off_t a, off_t b)
diff --git a/Kernel/FileDescriptor.h b/Kernel/FileDescriptor.h
index b069875d20..a20e8d6de8 100644
--- a/Kernel/FileDescriptor.h
+++ b/Kernel/FileDescriptor.h
@@ -18,14 +18,14 @@ class CharacterDevice;
class FileDescriptor : public Retainable<FileDescriptor> {
public:
- static RetainPtr<FileDescriptor> create(RetainPtr<Socket>&&, SocketRole = SocketRole::None);
- static RetainPtr<FileDescriptor> create(RetainPtr<Inode>&&);
- static RetainPtr<FileDescriptor> create(RetainPtr<Device>&&);
- static RetainPtr<FileDescriptor> create_pipe_writer(FIFO&);
- static RetainPtr<FileDescriptor> create_pipe_reader(FIFO&);
+ static Retained<FileDescriptor> create(RetainPtr<Socket>&&, SocketRole = SocketRole::None);
+ static Retained<FileDescriptor> create(RetainPtr<Inode>&&);
+ static Retained<FileDescriptor> create(RetainPtr<Device>&&);
+ static Retained<FileDescriptor> create_pipe_writer(FIFO&);
+ static Retained<FileDescriptor> create_pipe_reader(FIFO&);
~FileDescriptor();
- RetainPtr<FileDescriptor> clone();
+ Retained<FileDescriptor> clone();
int close();
diff --git a/Kernel/IDEDiskDevice.cpp b/Kernel/IDEDiskDevice.cpp
index d71a4780d9..b557a119cd 100644
--- a/Kernel/IDEDiskDevice.cpp
+++ b/Kernel/IDEDiskDevice.cpp
@@ -32,7 +32,7 @@ enum IDEStatus : byte {
ERR = (1 << 0),
};
-RetainPtr<IDEDiskDevice> IDEDiskDevice::create()
+Retained<IDEDiskDevice> IDEDiskDevice::create()
{
return adopt(*new IDEDiskDevice);
}
diff --git a/Kernel/IDEDiskDevice.h b/Kernel/IDEDiskDevice.h
index beaaca0d57..1f0424bb1e 100644
--- a/Kernel/IDEDiskDevice.h
+++ b/Kernel/IDEDiskDevice.h
@@ -7,7 +7,7 @@
class IDEDiskDevice final : public IRQHandler, public DiskDevice {
public:
- static RetainPtr<IDEDiskDevice> create();
+ static Retained<IDEDiskDevice> create();
virtual ~IDEDiskDevice() override;
// ^DiskDevice
diff --git a/Kernel/LocalSocket.cpp b/Kernel/LocalSocket.cpp
index 9073100c04..c8c6ec8a5b 100644
--- a/Kernel/LocalSocket.cpp
+++ b/Kernel/LocalSocket.cpp
@@ -4,7 +4,7 @@
#include <Kernel/VirtualFileSystem.h>
#include <LibC/errno_numbers.h>
-RetainPtr<LocalSocket> LocalSocket::create(int type)
+Retained<LocalSocket> LocalSocket::create(int type)
{
return adopt(*new LocalSocket(type));
}
diff --git a/Kernel/LocalSocket.h b/Kernel/LocalSocket.h
index 51ceaeccd8..7ad4abc8d0 100644
--- a/Kernel/LocalSocket.h
+++ b/Kernel/LocalSocket.h
@@ -7,7 +7,7 @@ class FileDescriptor;
class LocalSocket final : public Socket {
public:
- static RetainPtr<LocalSocket> create(int type);
+ static Retained<LocalSocket> create(int type);
virtual ~LocalSocket() override;
virtual bool bind(const sockaddr*, socklen_t, int& error) override;
diff --git a/Kernel/Makefile b/Kernel/Makefile
index 62df5aaa9e..b97bb78920 100644
--- a/Kernel/Makefile
+++ b/Kernel/Makefile
@@ -71,13 +71,15 @@ WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fal
FLAVOR_FLAGS = -mregparm=3 -fno-exceptions -fno-rtti
OPTIMIZATION_FLAGS = -Os
INCLUDE_FLAGS = -I.. -I.
+CLANG_FLAGS = -Wconsumed -m32 -ffreestanding -march=i686
#SUGGEST_FLAGS = -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override #-Wsuggest-attribute=noreturn
DEFINES = -DSERENITY -DKERNEL -DSANITIZE_PTRS
CXXFLAGS = -MMD -MP $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(KERNEL_FLAGS) $(FLAVOR_FLAGS) $(ARCH_FLAGS) $(STANDARD_FLAGS) $(SUGGEST_FLAGS) $(INCLUDE_FLAGS) $(DEFINES)
-CXX = ~/opt/cross/bin/i686-elf-g++
-LD = ~/opt/cross/bin/i686-elf-ld
+#CXX = clang $(CLANG_FLAGS)
+CXX = i686-elf-g++
+LD = i686-elf-ld
LDFLAGS = -T linker.ld
all: $(KERNEL) $(IMAGE) kernel.map
diff --git a/Kernel/MemoryManager.cpp b/Kernel/MemoryManager.cpp
index 1e41bfc445..9313b81b47 100644
--- a/Kernel/MemoryManager.cpp
+++ b/Kernel/MemoryManager.cpp
@@ -667,14 +667,14 @@ Region::~Region()
MM.unregister_region(*this);
}
-RetainPtr<PhysicalPage> PhysicalPage::create_eternal(PhysicalAddress paddr, bool supervisor)
+Retained<PhysicalPage> PhysicalPage::create_eternal(PhysicalAddress paddr, bool supervisor)
{
void* slot = kmalloc_eternal(sizeof(PhysicalPage));
new (slot) PhysicalPage(paddr, supervisor);
return adopt(*(PhysicalPage*)slot);
}
-RetainPtr<PhysicalPage> PhysicalPage::create(PhysicalAddress paddr, bool supervisor)
+Retained<PhysicalPage> PhysicalPage::create(PhysicalAddress paddr, bool supervisor)
{
void* slot = kmalloc(sizeof(PhysicalPage));
new (slot) PhysicalPage(paddr, supervisor, false);
@@ -702,23 +702,23 @@ void PhysicalPage::return_to_freelist()
#endif
}
-RetainPtr<VMObject> VMObject::create_file_backed(RetainPtr<Inode>&& inode)
+Retained<VMObject> VMObject::create_file_backed(RetainPtr<Inode>&& inode)
{
InterruptDisabler disabler;
if (inode->vmo())
- return static_cast<VMObject*>(inode->vmo());
+ return *inode->vmo();
auto vmo = adopt(*new VMObject(move(inode)));
vmo->inode()->set_vmo(*vmo);
return vmo;
}
-RetainPtr<VMObject> VMObject::create_anonymous(size_t size)
+Retained<VMObject> VMObject::create_anonymous(size_t size)
{
size = ceil_div(size, PAGE_SIZE) * PAGE_SIZE;
return adopt(*new VMObject(size));
}
-RetainPtr<VMObject> VMObject::create_for_physical_range(PhysicalAddress paddr, size_t size)
+Retained<VMObject> VMObject::create_for_physical_range(PhysicalAddress paddr, size_t size)
{
size = ceil_div(size, PAGE_SIZE) * PAGE_SIZE;
auto vmo = adopt(*new VMObject(paddr, size));
@@ -726,7 +726,7 @@ RetainPtr<VMObject> VMObject::create_for_physical_range(PhysicalAddress paddr, s
return vmo;
}
-RetainPtr<VMObject> VMObject::clone()
+Retained<VMObject> VMObject::clone()
{
return adopt(*new VMObject(*this));
}
diff --git a/Kernel/MemoryManager.h b/Kernel/MemoryManager.h
index ccdcf0b6ad..00bb2abfd8 100644
--- a/Kernel/MemoryManager.h
+++ b/Kernel/MemoryManager.h
@@ -48,8 +48,8 @@ public:
}
}
- static RetainPtr<PhysicalPage> create_eternal(PhysicalAddress, bool supervisor);
- static RetainPtr<PhysicalPage> create(PhysicalAddress, bool supervisor);
+ static Retained<PhysicalPage> create_eternal(PhysicalAddress, bool supervisor);
+ static Retained<PhysicalPage> create(PhysicalAddress, bool supervisor);
unsigned short retain_count() const { return m_retain_count; }
@@ -68,8 +68,8 @@ private:
class PageDirectory : public Retainable<PageDirectory> {
friend class MemoryManager;
public:
- static RetainPtr<PageDirectory> create() { return adopt(*new PageDirectory); }
- static RetainPtr<PageDirectory> create_at_fixed_address(PhysicalAddress paddr) { return adopt(*new PageDirectory(paddr)); }
+ static Retained<PageDirectory> create() { return adopt(*new PageDirectory); }
+ static Retained<PageDirectory> create_at_fixed_address(PhysicalAddress paddr) { return adopt(*new PageDirectory(paddr)); }
~PageDirectory();
dword cr3() const { return m_directory_page->paddr().get(); }
@@ -88,10 +88,10 @@ private:
class VMObject : public Retainable<VMObject>, public Weakable<VMObject> {
friend class MemoryManager;
public:
- static RetainPtr<VMObject> create_file_backed(RetainPtr<Inode>&&);
- static RetainPtr<VMObject> create_anonymous(size_t);
- static RetainPtr<VMObject> create_for_physical_range(PhysicalAddress, size_t);
- RetainPtr<VMObject> clone();
+ static Retained<VMObject> create_file_backed(RetainPtr<Inode>&&);
+ static Retained<VMObject> create_anonymous(size_t);
+ static Retained<VMObject> create_for_physical_range(PhysicalAddress, size_t);
+ Retained<VMObject> clone();
~VMObject();
bool is_anonymous() const { return m_anonymous; }
diff --git a/Kernel/ProcFS.cpp b/Kernel/ProcFS.cpp
index cbdff6f889..680c46b187 100644
--- a/Kernel/ProcFS.cpp
+++ b/Kernel/ProcFS.cpp
@@ -166,7 +166,7 @@ ProcFS& ProcFS::the()
return *s_the;
}
-RetainPtr<ProcFS> ProcFS::create()
+Retained<ProcFS> ProcFS::create()
{
return adopt(*new ProcFS);
}
diff --git a/Kernel/ProcFS.h b/Kernel/ProcFS.h
index c57e08fdd1..ad64feae41 100644
--- a/Kernel/ProcFS.h
+++ b/Kernel/ProcFS.h
@@ -14,7 +14,7 @@ public:
[[gnu::pure]] static ProcFS& the();
virtual ~ProcFS() override;
- static RetainPtr<ProcFS> create();
+ static Retained<ProcFS> create();
virtual bool initialize() override;
virtual const char* class_name() const override;
diff --git a/Kernel/SyntheticFileSystem.cpp b/Kernel/SyntheticFileSystem.cpp
index a94fcab773..1ed6e6eb50 100644
--- a/Kernel/SyntheticFileSystem.cpp
+++ b/Kernel/SyntheticFileSystem.cpp
@@ -5,7 +5,7 @@
//#define SYNTHFS_DEBUG
-RetainPtr<SynthFS> SynthFS::create()
+Retained<SynthFS> SynthFS::create()
{
return adopt(*new SynthFS);
}
@@ -34,7 +34,7 @@ bool SynthFS::initialize()
return true;
}
-RetainPtr<SynthFSInode> SynthFS::create_directory(String&& name)
+Retained<SynthFSInode> SynthFS::create_directory(String&& name)
{
auto file = adopt(*new SynthFSInode(*this, generate_inode_index()));
file->m_name = move(name);
@@ -46,7 +46,7 @@ RetainPtr<SynthFSInode> SynthFS::create_directory(String&& name)
return file;
}
-RetainPtr<SynthFSInode> SynthFS::create_text_file(String&& name, ByteBuffer&& contents, mode_t mode)
+Retained<SynthFSInode> SynthFS::create_text_file(String&& name, ByteBuffer&& contents, mode_t mode)
{
auto file = adopt(*new SynthFSInode(*this, generate_inode_index()));
file->m_data = contents;
@@ -59,7 +59,7 @@ RetainPtr<SynthFSInode> SynthFS::create_text_file(String&& name, ByteBuffer&& co
return file;
}
-RetainPtr<SynthFSInode> SynthFS::create_generated_file(String&& name, Function<ByteBuffer(SynthFSInode&)>&& generator, mode_t mode)
+Retained<SynthFSInode> SynthFS::create_generated_file(String&& name, Function<ByteBuffer(SynthFSInode&)>&& generator, mode_t mode)
{
auto file = adopt(*new SynthFSInode(*this, generate_inode_index()));
file->m_generator = move(generator);
@@ -72,7 +72,7 @@ RetainPtr<SynthFSInode> SynthFS::create_generated_file(String&& name, Function<B
return file;
}
-RetainPtr<SynthFSInode> SynthFS::create_generated_file(String&& name, Function<ByteBuffer(SynthFSInode&)>&& read_callback, Function<ssize_t(SynthFSInode&, const ByteBuffer&)>&& write_callback, mode_t mode)
+Retained<SynthFSInode> SynthFS::create_generated_file(String&& name, Function<ByteBuffer(SynthFSInode&)>&& read_callback, Function<ssize_t(SynthFSInode&, const ByteBuffer&)>&& write_callback, mode_t mode)
{
auto file = adopt(*new SynthFSInode(*this, generate_inode_index()));
file->m_generator = move(read_callback);
diff --git a/Kernel/SyntheticFileSystem.h b/Kernel/SyntheticFileSystem.h
index f1cc853785..cfe04180d7 100644
--- a/Kernel/SyntheticFileSystem.h
+++ b/Kernel/SyntheticFileSystem.h
@@ -9,7 +9,7 @@ class SynthFSInode;
class SynthFS : public FS {
public:
virtual ~SynthFS() override;
- static RetainPtr<SynthFS> create();
+ static Retained<SynthFS> create();
virtual bool initialize() override;
virtual const char* class_name() const override;
@@ -26,10 +26,10 @@ protected:
SynthFS();
- RetainPtr<SynthFSInode> create_directory(String&& name);
- RetainPtr<SynthFSInode> create_text_file(String&& name, ByteBuffer&&, mode_t = 0010644);
- RetainPtr<SynthFSInode> create_generated_file(String&& name, Function<ByteBuffer(SynthFSInode&)>&&, mode_t = 0100644);
- RetainPtr<SynthFSInode> create_generated_file(String&& name, Function<ByteBuffer(SynthFSInode&)>&&, Function<ssize_t(SynthFSInode&, const ByteBuffer&)>&&, mode_t = 0100644);
+ Retained<SynthFSInode> create_directory(String&& name);
+ Retained<SynthFSInode> create_text_file(String&& name, ByteBuffer&&, mode_t = 0010644);
+ Retained<SynthFSInode> create_generated_file(String&& name, Function<ByteBuffer(SynthFSInode&)>&&, mode_t = 0100644);
+ Retained<SynthFSInode> create_generated_file(String&& name, Function<ByteBuffer(SynthFSInode&)>&&, Function<ssize_t(SynthFSInode&, const ByteBuffer&)>&&, mode_t = 0100644);
InodeIdentifier add_file(RetainPtr<SynthFSInode>&&, InodeIndex parent = RootInodeIndex);
bool remove_file(InodeIndex);
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index 05e2c0a32e..bbabc84acf 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -149,7 +149,7 @@ VFS* vfs;
new BXVGADevice;
- auto new_procfs = ProcFS::create();
+ Retained<ProcFS> new_procfs = ProcFS::create();
new_procfs->initialize();
auto devptsfs = DevPtsFS::create();