mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 18:22:45 +00:00 
			
		
		
		
	Kernel/SysFS: Rename Devices code folder => DeviceIdentifiers
This folder in the SysFS code represents everything related to /sys/dev, which is a directory meant to be a convenient interface to track all IDs of all block and character devices (ID = major:minor numbers).
This commit is contained in:
		
							parent
							
								
									4ad437f3a7
								
							
						
					
					
						commit
						6ff1aeb64d
					
				
					 12 changed files with 31 additions and 31 deletions
				
			
		|  | @ -147,10 +147,10 @@ set(KERNEL_SOURCES | |||
|     FileSystem/SysFS/Subsystems/Bus/USB/BusDirectory.cpp | ||||
|     FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp | ||||
|     FileSystem/SysFS/Subsystems/Bus/Directory.cpp | ||||
|     FileSystem/SysFS/Subsystems/Devices/BlockDevicesDirectory.cpp | ||||
|     FileSystem/SysFS/Subsystems/Devices/CharacterDevicesDirectory.cpp | ||||
|     FileSystem/SysFS/Subsystems/Devices/DeviceComponent.cpp | ||||
|     FileSystem/SysFS/Subsystems/Devices/Directory.cpp | ||||
|     FileSystem/SysFS/Subsystems/DeviceIdentifiers/BlockDevicesDirectory.cpp | ||||
|     FileSystem/SysFS/Subsystems/DeviceIdentifiers/CharacterDevicesDirectory.cpp | ||||
|     FileSystem/SysFS/Subsystems/DeviceIdentifiers/DeviceComponent.cpp | ||||
|     FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.cpp | ||||
|     FileSystem/SysFS/Subsystems/Firmware/BIOS/Component.cpp | ||||
|     FileSystem/SysFS/Subsystems/Firmware/BIOS/Directory.cpp | ||||
|     FileSystem/SysFS/Subsystems/Firmware/Directory.cpp | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ | |||
| #include <Kernel/FileSystem/DeviceFileTypes.h> | ||||
| #include <Kernel/FileSystem/File.h> | ||||
| #include <Kernel/FileSystem/SysFS/Registry.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/DeviceComponent.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/DeviceComponent.h> | ||||
| #include <Kernel/UnixTypes.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
|  |  | |||
|  | @ -10,7 +10,7 @@ | |||
| #include <Kernel/FileSystem/Inode.h> | ||||
| #include <Kernel/FileSystem/SysFS/Component.h> | ||||
| #include <Kernel/FileSystem/SysFS/RootDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/DeviceComponent.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/DeviceComponent.h> | ||||
| #include <Kernel/Locking/MutexProtected.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ | |||
| #include <Kernel/FileSystem/SysFS/Registry.h> | ||||
| #include <Kernel/FileSystem/SysFS/RootDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Bus/Directory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/Directory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h> | ||||
| #include <Kernel/Sections.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
|  | @ -33,9 +33,9 @@ ErrorOr<void> SysFSRootDirectory::traverse_as_directory(FileSystemID fsid, Funct | |||
| SysFSRootDirectory::SysFSRootDirectory() | ||||
| { | ||||
|     auto buses_directory = SysFSBusDirectory::must_create(*this); | ||||
|     auto devices_directory = SysFSDevicesDirectory::must_create(*this); | ||||
|     auto device_identifiers_directory = SysFSDeviceIdentifiersDirectory::must_create(*this); | ||||
|     m_components.append(buses_directory); | ||||
|     m_components.append(devices_directory); | ||||
|     m_components.append(device_identifiers_directory); | ||||
|     m_buses_directory = buses_directory; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -5,16 +5,16 @@ | |||
|  */ | ||||
| 
 | ||||
| #include <Kernel/FileSystem/SysFS/Registry.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/BlockDevicesDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/BlockDevicesDirectory.h> | ||||
| #include <Kernel/Sections.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
| 
 | ||||
| NonnullRefPtr<SysFSBlockDevicesDirectory> SysFSBlockDevicesDirectory::must_create(SysFSDevicesDirectory const& devices_directory) | ||||
| NonnullRefPtr<SysFSBlockDevicesDirectory> SysFSBlockDevicesDirectory::must_create(SysFSDeviceIdentifiersDirectory const& devices_directory) | ||||
| { | ||||
|     return adopt_ref_if_nonnull(new SysFSBlockDevicesDirectory(devices_directory)).release_nonnull(); | ||||
| } | ||||
| SysFSBlockDevicesDirectory::SysFSBlockDevicesDirectory(SysFSDevicesDirectory const& devices_directory) | ||||
| SysFSBlockDevicesDirectory::SysFSBlockDevicesDirectory(SysFSDeviceIdentifiersDirectory const& devices_directory) | ||||
|     : SysFSDirectory(devices_directory) | ||||
| { | ||||
| } | ||||
|  | @ -7,19 +7,19 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <Kernel/FileSystem/SysFS/Component.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/Directory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
| 
 | ||||
| class SysFSBlockDevicesDirectory final : public SysFSDirectory { | ||||
| public: | ||||
|     virtual StringView name() const override { return "block"sv; } | ||||
|     static NonnullRefPtr<SysFSBlockDevicesDirectory> must_create(SysFSDevicesDirectory const&); | ||||
|     static NonnullRefPtr<SysFSBlockDevicesDirectory> must_create(SysFSDeviceIdentifiersDirectory const&); | ||||
|     virtual ErrorOr<void> traverse_as_directory(FileSystemID, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const override; | ||||
|     virtual RefPtr<SysFSComponent> lookup(StringView name) override; | ||||
| 
 | ||||
| private: | ||||
|     explicit SysFSBlockDevicesDirectory(SysFSDevicesDirectory const&); | ||||
|     explicit SysFSBlockDevicesDirectory(SysFSDeviceIdentifiersDirectory const&); | ||||
| }; | ||||
| 
 | ||||
| } | ||||
|  | @ -5,16 +5,16 @@ | |||
|  */ | ||||
| 
 | ||||
| #include <Kernel/FileSystem/SysFS/Registry.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/CharacterDevicesDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/CharacterDevicesDirectory.h> | ||||
| #include <Kernel/Sections.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
| 
 | ||||
| NonnullRefPtr<SysFSCharacterDevicesDirectory> SysFSCharacterDevicesDirectory::must_create(SysFSDevicesDirectory const& devices_directory) | ||||
| NonnullRefPtr<SysFSCharacterDevicesDirectory> SysFSCharacterDevicesDirectory::must_create(SysFSDeviceIdentifiersDirectory const& devices_directory) | ||||
| { | ||||
|     return adopt_ref_if_nonnull(new SysFSCharacterDevicesDirectory(devices_directory)).release_nonnull(); | ||||
| } | ||||
| SysFSCharacterDevicesDirectory::SysFSCharacterDevicesDirectory(SysFSDevicesDirectory const& devices_directory) | ||||
| SysFSCharacterDevicesDirectory::SysFSCharacterDevicesDirectory(SysFSDeviceIdentifiersDirectory const& devices_directory) | ||||
|     : SysFSDirectory(devices_directory) | ||||
| { | ||||
| } | ||||
|  | @ -7,19 +7,19 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <Kernel/FileSystem/SysFS/Component.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/Directory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
| 
 | ||||
| class SysFSCharacterDevicesDirectory final : public SysFSDirectory { | ||||
| public: | ||||
|     virtual StringView name() const override { return "char"sv; } | ||||
|     static NonnullRefPtr<SysFSCharacterDevicesDirectory> must_create(SysFSDevicesDirectory const&); | ||||
|     static NonnullRefPtr<SysFSCharacterDevicesDirectory> must_create(SysFSDeviceIdentifiersDirectory const&); | ||||
|     virtual ErrorOr<void> traverse_as_directory(FileSystemID, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const override; | ||||
|     virtual RefPtr<SysFSComponent> lookup(StringView name) override; | ||||
| 
 | ||||
| private: | ||||
|     explicit SysFSCharacterDevicesDirectory(SysFSDevicesDirectory const&); | ||||
|     explicit SysFSCharacterDevicesDirectory(SysFSDeviceIdentifiersDirectory const&); | ||||
| }; | ||||
| 
 | ||||
| } | ||||
|  | @ -5,7 +5,7 @@ | |||
|  */ | ||||
| 
 | ||||
| #include <Kernel/Devices/Device.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/DeviceComponent.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/DeviceComponent.h> | ||||
| #include <Kernel/Sections.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
|  | @ -5,21 +5,21 @@ | |||
|  */ | ||||
| 
 | ||||
| #include <Kernel/FileSystem/SysFS/RootDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/BlockDevicesDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/CharacterDevicesDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/Devices/Directory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/BlockDevicesDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/CharacterDevicesDirectory.h> | ||||
| #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h> | ||||
| #include <Kernel/Sections.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
| 
 | ||||
| UNMAP_AFTER_INIT NonnullRefPtr<SysFSDevicesDirectory> SysFSDevicesDirectory::must_create(SysFSRootDirectory const& root_directory) | ||||
| UNMAP_AFTER_INIT NonnullRefPtr<SysFSDeviceIdentifiersDirectory> SysFSDeviceIdentifiersDirectory::must_create(SysFSRootDirectory const& root_directory) | ||||
| { | ||||
|     auto devices_directory = adopt_ref_if_nonnull(new SysFSDevicesDirectory(root_directory)).release_nonnull(); | ||||
|     auto devices_directory = adopt_ref_if_nonnull(new SysFSDeviceIdentifiersDirectory(root_directory)).release_nonnull(); | ||||
|     devices_directory->m_components.append(SysFSBlockDevicesDirectory::must_create(*devices_directory)); | ||||
|     devices_directory->m_components.append(SysFSCharacterDevicesDirectory::must_create(*devices_directory)); | ||||
|     return devices_directory; | ||||
| } | ||||
| SysFSDevicesDirectory::SysFSDevicesDirectory(SysFSRootDirectory const& root_directory) | ||||
| SysFSDeviceIdentifiersDirectory::SysFSDeviceIdentifiersDirectory(SysFSRootDirectory const& root_directory) | ||||
|     : SysFSDirectory(root_directory) | ||||
| { | ||||
| } | ||||
|  | @ -11,13 +11,13 @@ | |||
| 
 | ||||
| namespace Kernel { | ||||
| 
 | ||||
| class SysFSDevicesDirectory final : public SysFSDirectory { | ||||
| class SysFSDeviceIdentifiersDirectory final : public SysFSDirectory { | ||||
| public: | ||||
|     virtual StringView name() const override { return "dev"sv; } | ||||
|     static NonnullRefPtr<SysFSDevicesDirectory> must_create(SysFSRootDirectory const&); | ||||
|     static NonnullRefPtr<SysFSDeviceIdentifiersDirectory> must_create(SysFSRootDirectory const&); | ||||
| 
 | ||||
| private: | ||||
|     explicit SysFSDevicesDirectory(SysFSRootDirectory const&); | ||||
|     explicit SysFSDeviceIdentifiersDirectory(SysFSRootDirectory const&); | ||||
| }; | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Liav A
						Liav A