david
پوش کردن به feat/driver/serial-wakers در david/eonix
82470afc34 driver, serial: correct async wait impl
Previously, we use the WaitList to sleep and wakeup in the worker task.
Replace the implementation with wakers.
Signed-off-by: greatbridf <greatbridf@icloud.com>
19f9ef3351 vfs: rework the vfs subsystem with async
Inode and superblock rework:
Remove old Inode trait as it used to undertake too much responsibility.
The new method use three new traits: InodeOps is used to acquire generic
inode attributes. InodeFileOps and InodeDirOps handle file and directory
requests respectively. All the three have async fn trait methods and
don't need to be ?Sized. Then, we implement Inode, InodeFile and
InodeDir for the implementors of the three "Ops" traits, erasing their
actual type and provide generic dyn interface by wrapping the futures in
boxes. We should provide an io worker? or some io context with an
allocator for futures to reduce the overhead of io requests, or come up
with some better ideas?
For inode usage, we introduce InodeRef and InodeUse. InodeRef is a
simple wrapper for Weak<impl Inode> and InodeUse for Arc<impl Inode>.
This helps us use them better as we can't define impls for Arc<dyn
Inode>'s as they are foreign types. We also provide some more helper
methods for them.
After the change, we don't impose ANY structural restriction except for
the spinlock wrapped InodeInfo. The InodeInfo struct design might need
rethinking but the current implementation seems to be fine aside from
unnecessary locks when we try to access some of its fields but this
shouldn't be a VERY big problem and very urgent...
Similar changes are also made to superblock traits and types. But for
the superblock objects, we use a SuperBlockComplex struct to store
common fields such as whether the superblock is read only, their device
id and so on. Also the structs have a superblock rwsem inside. But we
haven't decided how to use that (such as whether we should acquire the
lock and pass it to the inode methods) and even whether they should
exist and be there. This will need further thinking so we put this off
for now...
Filesystem rework:
Rework tmpfs, fatfs and procfs with the new technology mentioned above,
leaving the old ext4 unchanged. The current implementation of ext4 uses
some "random" library from the "camp". Its code hasn't been fully
reviewed for time reasons but seems to be rather "problematic"... We
might rewrite the whole module later and the page cache subsystem
requires fully reworking as well. So we put this work off as well.
Block device and other parts rework:
Wraps PageCacheBackend, MountCreator and BlockRequestQueue with
async_trait to provide dyn compatible async functions. Dentry walking
functions are also put to the heap since they are recursive functions...
This has similar problems to the inode traits, ugly solution. Further
optimization is required.
Signed-off-by: greatbridf <greatbridf@icloud.com>
755b006871 Merge pull request #58 from greatbridf/fix/termios-buffer-overflow
syscall: fix struct termios definitions
2967de5de3 syscall: fix struct termios definitions
Fixes the buffer overflow caused by the wrong struct size.
Signed-off-by: greatbridf <greatbridf@icloud.com>
(cherry picked from commit de12291ceebab608e6ff89bf9e41a3ab479f19ce)
Signed-off-by: greatbridf <greatbridf@icloud.com>
2fc31b7eb3 Merge pull request #59 from greatbridf/fix/loongarch64-boot
fix(hal): fix loongarch's boot fault
5 روز پیش