Commit graph

23615 commits

Author SHA1 Message Date
Andreas Kling
0afccb560b Kernel: Remove some duplicate forward declarations 2021-07-11 15:15:57 +02:00
Andreas Kling
b2cd9b2c88 Kernel: Remove pointless ref-counting from PhysicalRegion
These are not multiple-owner objects and have no use for ref-counting.
Make them simple value types instead (not eternal heap-allocated.)
2021-07-11 15:15:57 +02:00
Max Wipfli
29d53cbee2 Kernel: Return correct error numbers for the mkdir syscall
Previously, VirtualFileSystem::mkdir() would always return ENOENT if
no parent custody was returned by resolve_path(). This is incorrect when
e.g. the user has no search permission in a component of the path
prefix (=> EACCES), or if on component of the path prefix is a file (=>
ENOTDIR). This patch fixes that behavior.
2021-07-11 14:59:57 +02:00
Andreas Kling
25e850ebb1 Kernel: Remove krealloc()
This was only used by a single class (AK::ByteBuffer) in the kernel
and not in an OOM-safe way.

Now that ByteBuffer no longer uses it, there's no need for the kernel
heap to burden itself with supporting this.
2021-07-11 14:14:51 +02:00
Andreas Kling
966880eb45 AK: Don't use realloc() in AK::ByteBuffer
This class is the only reason we have to support krealloc() in the
kernel heap, something which adds a lot of complexity.

Let's move towards a simpler path and do malloc+memset in the
ByteBuffer code (where we know the sizes anyway.)
2021-07-11 14:14:51 +02:00
Andreas Kling
0718bd264c Kernel: Remove some no-longer-needed C library functions
Now that we no longer demangle symbols in the kernel, we don't need to
provide stuff like malloc(), memchr(), free(), etc to the demangler.
2021-07-11 14:14:51 +02:00
Andreas Kling
f684742f15 Kernel: VERIFY_NOT_REACHED in un-sized operator delete
All deletes in kernel code should now be of known size. :^)
2021-07-11 14:14:51 +02:00
Andreas Kling
43d7a7f274 Kernel: Use kfree_sized() in KString 2021-07-11 14:14:51 +02:00
Andreas Kling
c1e902acd9 AK: Use kfree_sized() in AK::Vector 2021-07-11 14:14:51 +02:00
Andreas Kling
c68c3fa69c AK: Use kfree_sized() in AK::StringImpl 2021-07-11 14:14:51 +02:00
Andreas Kling
3aabace9f5 AK: Use kfree_sized() in AK::HashTable 2021-07-11 14:14:51 +02:00
Andreas Kling
05a00c3978 AK: Use kfree_sized() in AK::ByteBuffer 2021-07-11 14:14:51 +02:00
Andreas Kling
6950dd220b AK: Use kfree_sized() in AK::Bitmap 2021-07-11 14:14:51 +02:00
Andreas Kling
875afb35c3 AK: Make kfree_sized() forward to kfree() in non-kernel code for now 2021-07-11 14:14:51 +02:00
Andreas Kling
d38b4e4665 Kernel: Add kfree_sized(), kfree() with a known allocation size
C++14 gave us sized operator delete, but we haven't been taking
advantage of it. Let's get to a point where it can help us by
adding kfree_sized(void*, size_t).
2021-07-11 14:14:51 +02:00
Andreas Kling
98080497d2 Kernel: Use Forward.h headers more 2021-07-11 14:14:51 +02:00
Adam Hodgen
47bfd366a8 LibWeb: Fix syntax for Table test
The parser fixes this by inserting the <tr> tags, but for this test it's
better to have perfect syntax - we're not testing the parser here.
2021-07-11 14:14:01 +02:00
Adam Hodgen
3e46e8fea8 LibWeb: Fix HTMLTable Element attributes
`Element::tag_name` return an uppercase version of the tag name. However
the `Web::HTML::TagNames` values are all lowercase.

This change fixes that using `Element::local_name`, which returns a
lowercase value.
2021-07-11 14:14:01 +02:00
LuK1337
99013ac3d5 LibTTF: Port width calculation changes from BitmapFont 2021-07-11 14:12:59 +02:00
LuK1337
c0f9adabd6 LibGfx: Try to get TTF font when query is not in name->font map
This change allows us to select TTF fonts in display settings again :^)
2021-07-11 14:12:47 +02:00
Timothy
c03353e7ca TextEditor: Show an error message when opening a file failed 2021-07-11 14:11:53 +02:00
Gunnar Beutner
71840c1bf4 TextEditor: Open files with ReadOnly when we're just reading them 2021-07-11 14:11:53 +02:00
Gunnar Beutner
c343e9a4fd TextEditor: Avoid calling realpath()
We can't use realpath() at that point because we've already called
unveil(nullptr, nullptr).
2021-07-11 14:11:53 +02:00
Karol Kosek
a90c484d4b Pong: Only paint areas that needs to be updated 2021-07-11 14:11:26 +02:00
Max Wipfli
9ab528ff5c Kernel: Make KLexicalPath::basename() more compliant
This removes some assertions from KLexicalPath::basename() by supporting
paths with trailing slashes, empty paths, paths consisting of only
slashes and paths with ending "." and ".." segments.
2021-07-11 14:10:58 +02:00
Adam Hodgen
a3638639a1 TextEditor: Show an error dialog when failing to open/save a file 2021-07-11 09:46:50 +02:00
Adam Hodgen
643ecfee73 FileSystemAccessServer: Return user_picked_value even on error
If a user picks a file which can't be opened for some reason, we should
still return the value, so client applications can report the error
along with the chosen filepath.
2021-07-11 09:46:50 +02:00
Andreas Kling
c9f6786e8b Kernel: Make various T::class_name() and similar return StringView
Instead of returning char const*, we can also give you a StringView.
2021-07-11 01:46:59 +02:00
Andreas Kling
fa9111ac46 Kernel: Rename ProcFSComponentsRegistrar => ProcFSComponentRegistry
This matches the formatting used in SysFS.
2021-07-11 01:40:26 +02:00
Andreas Kling
c1143e1bae Kernel: Remove friend classes from ProcFSComponentsRegistrar 2021-07-11 01:39:51 +02:00
Andreas Kling
358a7cc448 Kernel: Rename SysFS related classes in BIOS code
Give them names that sound related to SysFS.
2021-07-11 01:38:01 +02:00
Andreas Kling
84ae2b6f00 Kernel: Use nested namespace declarations in ACPI code 2021-07-11 01:36:30 +02:00
Andreas Kling
b1c68dd235 Kernel: Rename SysFS related classes in ACPI code
Give them names that sound related to SysFS.
2021-07-11 01:35:17 +02:00
Andreas Kling
805319ed30 Kernel: Replace "Folder" => "Directory" everywhere
Folders are a GUI concept, file systems have directories. :^)
2021-07-11 01:33:40 +02:00
Andreas Kling
5ec3f5433e Kernel: Rename SysFS related classes in PCI code
Give them names that sound related to SysFS.
2021-07-11 01:31:48 +02:00
Andreas Kling
c74b3a310f Kernel: Remove pointless lock/unlock in SysFS constructor 2021-07-11 01:18:20 +02:00
Andreas Kling
a9decf5aa6 Kernel: Remove all friend declarations from SysFSComponentRegistry
Let them access the class using public API instead.
2021-07-11 01:17:57 +02:00
Andreas Kling
d40ea1a0a8 Kernel: Move SystemExposed.* => FileSystem/SysFSComponent.* 2021-07-11 01:14:53 +02:00
Andreas Kling
807aadbe6e Kernel: Remove some dead code and unused includes in SysFS files 2021-07-11 01:13:24 +02:00
Andreas Kling
98acebf56b Kernel: Move SysFS forward declarations to FileSystem/Forward.h 2021-07-11 01:09:48 +02:00
Andreas Kling
60a7a9d523 Kernel: Rename SystemExposedFolder => SysFSDirectory
"Folder" is a GUI concept, let's call this "Directory".
Also, "System" is completely generic, so let's be more specific and
call this "SysFS..."
2021-07-11 01:07:27 +02:00
Andreas Kling
517170a986 Kernel: Rename SystemExposedComponent => SysFSComponent 2021-07-11 01:06:27 +02:00
Andreas Kling
27244eb0ee Kernel: Rename SystemRegistrar => SysFSComponentRegistry 2021-07-11 01:05:26 +02:00
Andreas Kling
ea8578bf11 Kernel: Remove unnecessary includes in FileSystem.{cpp,h} 2021-07-11 01:01:54 +02:00
Andreas Kling
55c6e08c9e Kernel: Remove unnecessary String allocation in SystemExposedFolder 2021-07-11 00:58:23 +02:00
Andreas Kling
66f483b1a1 Kerne: Switch SysFS to east-const style 2021-07-11 00:56:53 +02:00
Andreas Kling
7a4e6257b7 Kernel: Switch Custody to east-const style 2021-07-11 00:51:38 +02:00
Andreas Kling
4238e2e9be Kernel: Only allow looking up Mounts by InodeIdentifier
Let's simplify the interface by not allowing lookup by Inode&.
2021-07-11 00:51:06 +02:00
Andreas Kling
6a27de2d94 Kernel: Make VirtualFileSystem::Mount a top-level class
And move it to its own compilation unit.
2021-07-11 00:51:06 +02:00
Andreas Kling
79552c91d5 Kernel: Rename BlockBasedFS => BlockBasedFileSystem 2021-07-11 00:34:36 +02:00