Add Debug support for some fs components

This commit is contained in:
LI Qing
2023-08-04 12:00:22 +08:00
committed by Tate, Hongliang Tian
parent acfbc7efdc
commit 55267f0d81
10 changed files with 100 additions and 1 deletions

View File

@ -13,6 +13,7 @@ use crate::fs::utils::{
use crate::prelude::*;
use jinux_rights::Rights;
#[derive(Debug)]
pub struct InodeHandle<R = Rights>(Arc<InodeHandle_>, R);
struct InodeHandle_ {
@ -119,6 +120,17 @@ impl InodeHandle_ {
}
}
impl Debug for InodeHandle_ {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("InodeHandle_")
.field("dentry", &self.dentry)
.field("offset", &self.offset())
.field("access_mode", &self.access_mode())
.field("status_flags", &self.status_flags())
.finish()
}
}
/// Methods for both dyn and static
impl<R> InodeHandle<R> {
pub fn dentry(&self) -> &Arc<Dentry> {