Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions fs/rustezfs/ezfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl RustEzFs {
}

fn iget(sb: &SuperBlock<Self>, ino: usize) -> Result<ARef<INode<Self>>> {
pr_info!("iget(ino={ino})\n");
// pr_info!("iget(ino={ino})\n");

if !Self::inode_allocated(sb, ino)? {
return Err(ENOENT);
Expand Down Expand Up @@ -326,7 +326,6 @@ impl FileSystem for RustEzFs {
sb: &mut SuperBlock<Self, New>,
mapper: Option<Mapper<Self>>,
) -> Result<Self::Data> {
pr_info!("fill_super()\n");
let Some(mapper) = mapper else {
return Err(EINVAL);
};
Expand All @@ -349,7 +348,6 @@ impl FileSystem for RustEzFs {
}

fn init_root(sb: &SuperBlock<Self>) -> Result<dentry::Root<Self>> {
pr_info!("init_root()\n");
let inode = Self::iget(sb, EZFS_ROOT_INODE_NUMBER)?;
dentry::Root::try_new(inode)
}
Expand All @@ -367,7 +365,7 @@ impl kernel::inode::Operations for RustEzFs {
let dir_entry = Self::find_dir_entry(parent, &dentry)?;

let inode = if let Some(entry) = dir_entry {
pr_info!("Inode found: {:?}\n", entry.inode_no());
// pr_info!("Inode found: {:?}\n", entry.inode_no());
Some(Self::iget(sb, entry.inode_no().try_into()?)?)
} else {
None
Expand Down Expand Up @@ -753,10 +751,6 @@ impl iomap::Operations for RustEzFs {
};

match case_type {
WriteCase::New => {
pr_info!("adding to an empty file\n");
return Err(EIO);
}
WriteCase::Within => {}
WriteCase::Extend => {
for i in ez_blk_count..blocks_needed {
Expand All @@ -766,7 +760,7 @@ impl iomap::Operations for RustEzFs {

map.set_flags(iomap::map_flags::NEW);
}
WriteCase::Move => {
WriteCase::New | WriteCase::Move => {
// Let's try to find a region of sequential free blocks
// of size `blocks_needed` to move our file to
let mut curr_block = 0;
Expand Down
3 changes: 0 additions & 3 deletions rust/kernel/folio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ impl DerefMut for MapGuardMut<'_> {

impl Drop for MapGuardMut<'_> {
fn drop(&mut self) {
pr_info!("Dropped guard, set pag dirty and unmapped\n");
// SAFETY: A `MapGuard` instance is only created when `kmap` succeeds, so it's ok to unmap
// it when the guard is dropped.
unsafe {
Expand All @@ -226,13 +225,11 @@ impl Drop for MapGuardMut<'_> {
// SAFETY: `raw_lock` calls folio_lock, which actually locks the folio.
unsafe impl<S> Lockable for Folio<S> {
fn raw_lock(&self) {
pr_info!("Locked folio\n");
// SAFETY: The folio is valid because the shared reference implies a non-zero refcount.
unsafe { bindings::folio_lock(self.0.get()) }
}

unsafe fn unlock(&self) {
pr_info!("unlocked folio\n");
// SAFETY: The safety requirements guarantee that the folio is locked.
unsafe { bindings::folio_unlock(self.0.get()) }
}
Expand Down
2 changes: 0 additions & 2 deletions rust/kernel/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ impl<T: FileSystem + ?Sized> Ops<T> {
kiocb: *mut bindings::kiocb,
iter: *mut bindings::iov_iter,
) -> isize {
pr_info!("read_iter_callback\n");
return unsafe { bindings::generic_file_read_iter(kiocb, iter) };
}

Expand All @@ -739,7 +738,6 @@ impl<T: FileSystem + ?Sized> Ops<T> {
iter: *mut bindings::iov_iter,
) -> isize {
from_result(|| {
pr_info!("write_iter_callback\n");
// SAFETY: The caller provides a valid `struct kiocb` associated with a
// `<T>` file.
let kiocb = unsafe { Kiocb::from_raw(kiocb) };
Expand Down