mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
Kernel: Replace "Folder" => "Directory" everywhere
Folders are a GUI concept, file systems have directories. :^)
This commit is contained in:
parent
5ec3f5433e
commit
805319ed30
13 changed files with 165 additions and 165 deletions
|
@ -33,7 +33,7 @@ UNMAP_AFTER_INIT void ProcFSComponentsRegistrar::initialize()
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT ProcFSComponentsRegistrar::ProcFSComponentsRegistrar()
|
||||
: m_root_folder(ProcFSRootFolder::must_create())
|
||||
: m_root_folder(ProcFSRootDirectory::must_create())
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ const ProcFSBusDirectory& ProcFSComponentsRegistrar::buses_folder() const
|
|||
return *m_root_folder->m_buses_folder;
|
||||
}
|
||||
|
||||
void ProcFSComponentsRegistrar::register_new_bus_folder(ProcFSExposedFolder& new_bus_folder)
|
||||
void ProcFSComponentsRegistrar::register_new_bus_folder(ProcFSExposedDirectory& new_bus_folder)
|
||||
{
|
||||
VERIFY(!m_root_folder->m_buses_folder.is_null());
|
||||
m_root_folder->m_buses_folder->m_components.append(new_bus_folder);
|
||||
|
@ -51,7 +51,7 @@ void ProcFSComponentsRegistrar::register_new_bus_folder(ProcFSExposedFolder& new
|
|||
void ProcFSComponentsRegistrar::register_new_process(Process& new_process)
|
||||
{
|
||||
Locker locker(m_lock);
|
||||
m_root_folder->m_process_folders.append(ProcFSProcessFolder::create(new_process));
|
||||
m_root_folder->m_process_folders.append(ProcFSProcessDirectory::create(new_process));
|
||||
}
|
||||
|
||||
void ProcFSComponentsRegistrar::unregister_process(Process& deleted_process)
|
||||
|
@ -59,8 +59,8 @@ void ProcFSComponentsRegistrar::unregister_process(Process& deleted_process)
|
|||
auto process_folder = m_root_folder->process_folder_for(deleted_process).release_nonnull();
|
||||
process_folder->prepare_for_deletion();
|
||||
process_folder->m_list_node.remove();
|
||||
dbgln_if(PROCFS_DEBUG, "ProcFSExposedFolder ref_count now: {}", process_folder->ref_count());
|
||||
// Note: Let's ensure we are the last holder of the ProcFSProcessFolder object before it can be deleted for good
|
||||
dbgln_if(PROCFS_DEBUG, "ProcFSExposedDirectory ref_count now: {}", process_folder->ref_count());
|
||||
// Note: Let's ensure we are the last holder of the ProcFSProcessDirectory object before it can be deleted for good
|
||||
VERIFY(process_folder->ref_count() == 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ UNMAP_AFTER_INIT void SysFSComponentRegistry::initialize()
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT SysFSComponentRegistry::SysFSComponentRegistry()
|
||||
: m_root_folder(SysFSRootFolder::create())
|
||||
: m_root_folder(SysFSRootDirectory::create())
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,12 @@ UNMAP_AFTER_INIT void SysFSComponentRegistry::register_new_component(SysFSCompon
|
|||
m_root_folder->m_components.append(component);
|
||||
}
|
||||
|
||||
NonnullRefPtr<SysFSRootFolder> SysFSRootFolder::create()
|
||||
NonnullRefPtr<SysFSRootDirectory> SysFSRootDirectory::create()
|
||||
{
|
||||
return adopt_ref(*new (nothrow) SysFSRootFolder);
|
||||
return adopt_ref(*new (nothrow) SysFSRootDirectory);
|
||||
}
|
||||
|
||||
KResult SysFSRootFolder::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
||||
KResult SysFSRootDirectory::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
||||
{
|
||||
Locker locker(SysFSComponentRegistry::the().get_lock());
|
||||
callback({ ".", { fsid, component_index() }, 0 });
|
||||
|
@ -53,7 +53,7 @@ KResult SysFSRootFolder::traverse_as_directory(unsigned fsid, Function<bool(File
|
|||
return KSuccess;
|
||||
}
|
||||
|
||||
SysFSRootFolder::SysFSRootFolder()
|
||||
SysFSRootDirectory::SysFSRootDirectory()
|
||||
: SysFSDirectory(".")
|
||||
{
|
||||
}
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
class SysFSRootFolder final : public SysFSDirectory {
|
||||
class SysFSRootDirectory final : public SysFSDirectory {
|
||||
friend class SysFSComponentRegistry;
|
||||
|
||||
public:
|
||||
static NonnullRefPtr<SysFSRootFolder> create();
|
||||
static NonnullRefPtr<SysFSRootDirectory> create();
|
||||
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
||||
|
||||
private:
|
||||
SysFSRootFolder();
|
||||
SysFSRootDirectory();
|
||||
};
|
||||
|
||||
class SysFSComponentRegistry {
|
||||
|
@ -37,7 +37,7 @@ public:
|
|||
|
||||
private:
|
||||
Lock m_lock;
|
||||
NonnullRefPtr<SysFSRootFolder> m_root_folder;
|
||||
NonnullRefPtr<SysFSRootDirectory> m_root_folder;
|
||||
};
|
||||
|
||||
class SysFS final : public FileSystem {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue