From 654b31efc61540870c9ff5a75ca64bbda45e93b0 Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Wed, 11 Mar 2026 00:32:33 -0700 Subject: [PATCH] bump to 0.1.0-alpha.5 --- Cargo.lock | 4 +-- libkernel/Cargo.toml | 2 +- libkernel/src/fs/filesystems/ext4/mod.rs | 35 ++++++++++++------------ 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c48629..fd134bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,9 +256,9 @@ dependencies = [ [[package]] name = "ext4plus" -version = "0.1.0-alpha.4" +version = "0.1.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4c717f942d8f2d0ba620e17afac4fd8c2c9ad315ca205d652bcd4c0503ed1b" +checksum = "866bc656467be17c403c70ab35ccb0f3294a7aaa6425c879b63d6aa878e3ffab" dependencies = [ "async-trait", "bitflags 2.11.0", diff --git a/libkernel/Cargo.toml b/libkernel/Cargo.toml index 310710e..f659541 100644 --- a/libkernel/Cargo.toml +++ b/libkernel/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] async-trait = { workspace = true } bitflags = { workspace = true } -ext4plus = { version = "0.1.0-alpha.4" } +ext4plus = "0.1.0-alpha.5" intrusive-collections = { version = "0.10.0", default-features = false } log = { workspace = true } object = { version = "0.38.0", default-features = false, features = ["core", "elf", "read_core"] } diff --git a/libkernel/src/fs/filesystems/ext4/mod.rs b/libkernel/src/fs/filesystems/ext4/mod.rs index ffa37bb..4a04046 100644 --- a/libkernel/src/fs/filesystems/ext4/mod.rs +++ b/libkernel/src/fs/filesystems/ext4/mod.rs @@ -31,9 +31,10 @@ use core::marker::PhantomData; use core::num::NonZeroU32; use core::ops::{Deref, DerefMut}; use core::time::Duration; -use ext4plus::{ - AsyncIterator, AsyncSkip, Dir, DirEntryName, Ext4, Ext4Read, Ext4Write, File, FollowSymlinks, - InodeCreationOptions, InodeFlags, InodeMode, Metadata, ReadDir, write_at, +use ext4plus::prelude::{ + AsyncIterator, AsyncSkip, Dir, DirEntryName, Ext4, Ext4Error, Ext4Read, Ext4Write, File, + FollowSymlinks, Inode as ExtInode, InodeCreationOptions, InodeFlags, InodeMode, Metadata, + PathBuf as ExtPathBuf, ReadDir, write_at, }; use log::error; @@ -59,13 +60,13 @@ impl Ext4Write for BlockBuffer { } } -impl From for KernelError { - fn from(err: ext4plus::Ext4Error) -> Self { +impl From for KernelError { + fn from(err: Ext4Error) -> Self { match err { - ext4plus::Ext4Error::NotFound => KernelError::Fs(FsError::NotFound), - ext4plus::Ext4Error::NotADirectory => KernelError::Fs(FsError::NotADirectory), - ext4plus::Ext4Error::AlreadyExists => KernelError::Fs(FsError::AlreadyExists), - ext4plus::Ext4Error::Corrupt(c) => { + Ext4Error::NotFound => KernelError::Fs(FsError::NotFound), + Ext4Error::NotADirectory => KernelError::Fs(FsError::NotADirectory), + Ext4Error::AlreadyExists => KernelError::Fs(FsError::AlreadyExists), + Ext4Error::Corrupt(c) => { error!("Corrupt EXT4 filesystem: {c}, likely a bug"); KernelError::Fs(FsError::InvalidFs) } @@ -146,11 +147,11 @@ impl DirStream for ReadDirWrapper { enum InodeInner { Regular(File), Directory(Dir), - Other(ext4plus::Inode), + Other(ExtInode), } impl InodeInner { - async fn new(inode: ext4plus::Inode, fs: &Ext4) -> Self { + async fn new(inode: ExtInode, fs: &Ext4) -> Self { match inode.file_type() { ext4plus::FileType::Regular => { InodeInner::Regular(File::open_inode(fs, inode).unwrap()) @@ -164,7 +165,7 @@ impl InodeInner { } impl Deref for InodeInner { - type Target = ext4plus::Inode; + type Target = ExtInode; fn deref(&self) -> &Self::Target { match self { @@ -189,7 +190,7 @@ pub struct Ext4Inode { fs_ref: Weak>, id: NonZeroU32, inner: Mutex, - path: ext4plus::PathBuf, + path: ExtPathBuf, } #[async_trait] @@ -377,7 +378,7 @@ where if inode.id().fs_id() != fs.id() { return Err(KernelError::Fs(FsError::CrossDevice)); } - let mut other_inode = ext4plus::Inode::read( + let mut other_inode = ExtInode::read( &fs.inner, (inode.id().inode_id() as u32).try_into().unwrap(), ) @@ -445,7 +446,7 @@ where let old_parent_id = old_parent.id(); let fs = self.fs_ref.upgrade().unwrap(); - let old_parent_inode = ext4plus::Inode::read( + let old_parent_inode = ExtInode::read( &fs.inner, (old_parent_id.inode_id() as u32).try_into().unwrap(), ) @@ -548,7 +549,7 @@ where .symlink( inner_dir, DirEntryName::try_from(name.as_bytes()).unwrap(), - ext4plus::PathBuf::new(target.as_str().as_bytes()), + ExtPathBuf::new(target.as_str().as_bytes()), 0, 0, Duration::from_secs(0), @@ -618,7 +619,7 @@ where fs_ref: self.this.clone(), id: root.index, inner: Mutex::new(InodeInner::new(root, &self.inner).await), - path: ext4plus::PathBuf::new("/"), + path: ExtPathBuf::new("/"), })) }