File tree Expand file tree Collapse file tree 6 files changed +34
-8
lines changed Expand file tree Collapse file tree 6 files changed +34
-8
lines changed Original file line number Diff line number Diff line change 3
3
use self :: file:: File ;
4
4
use self :: lock:: { LockObject , Mtx } ;
5
5
use self :: malloc:: Malloc ;
6
- use self :: mount:: { Filesystem , Mount } ;
6
+ use self :: mount:: { Filesystem , FsStats , Mount } ;
7
7
use self :: pcpu:: Pcpu ;
8
8
use self :: socket:: Socket ;
9
9
use self :: thread:: Thread ;
@@ -47,6 +47,7 @@ impl okf::Kernel for Kernel {
47
47
48
48
type File = File ;
49
49
type Filesystem = Filesystem ;
50
+ type FsStats = FsStats ;
50
51
type LockObject = LockObject ;
51
52
type Malloc = Malloc ;
52
53
type Mount = Mount ;
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ pub struct Mount {
13
13
fs : * mut Filesystem ,
14
14
pad3 : [ u8 ; 0x38 ] ,
15
15
flags : u64 ,
16
+ pad4 : [ u8 ; 0x20 ] ,
17
+ stats : FsStats ,
16
18
}
17
19
18
20
impl okf:: mount:: Mount < Kernel > for Mount {
@@ -35,6 +37,10 @@ impl okf::mount::Mount<Kernel> for Mount {
35
37
unsafe fn flags ( & self ) -> u64 {
36
38
self . flags
37
39
}
40
+
41
+ fn stats ( & self ) -> * mut FsStats {
42
+ & self . stats as * const FsStats as * mut FsStats
43
+ }
38
44
}
39
45
40
46
/// Implementation of [`okf::mount::Filesystem`] for 11.00.
@@ -49,3 +55,11 @@ impl okf::mount::Filesystem for Filesystem {
49
55
self . name . as_ptr ( )
50
56
}
51
57
}
58
+
59
+ /// Implementation of [`okf::mount::FsStats`] for 11.00.
60
+ #[ repr( C ) ]
61
+ pub struct FsStats {
62
+ pad : [ u8 ; 0x1d8 ] ,
63
+ }
64
+
65
+ impl okf:: mount:: FsStats for FsStats { }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use self::fd::OpenFlags;
4
4
use self :: file:: File ;
5
5
use self :: lock:: { LockObject , Mtx } ;
6
6
use self :: malloc:: { Malloc , MallocFlags } ;
7
- use self :: mount:: { Filesystem , Mount } ;
7
+ use self :: mount:: { Filesystem , FsStats , Mount } ;
8
8
use self :: pcpu:: Pcpu ;
9
9
use self :: queue:: TailQueue ;
10
10
use self :: socket:: { SockAddr , Socket } ;
@@ -55,6 +55,7 @@ pub trait Kernel: MappedKernel {
55
55
56
56
type File : File ;
57
57
type Filesystem : Filesystem ;
58
+ type FsStats : FsStats ;
58
59
type LockObject : LockObject ;
59
60
type Malloc : Malloc ;
60
61
type Mount : Mount < Self > ;
Original file line number Diff line number Diff line change
1
+ use core:: ffi:: c_char;
2
+
3
+ /// Represents `vfsconf` structure.
4
+ pub trait Filesystem : Sized {
5
+ /// Returns `vfc_name`.
6
+ fn name ( & self ) -> * const c_char ;
7
+ }
Original file line number Diff line number Diff line change
1
+ pub use self :: fs:: * ;
2
+ pub use self :: stats:: * ;
1
3
use crate :: queue:: TailQueueEntry ;
2
4
use crate :: Kernel ;
3
- use core:: ffi:: c_char;
5
+
6
+ mod fs;
7
+ mod stats;
4
8
5
9
/// Represents `mount` structure.
6
10
pub trait Mount < K : Kernel > : Sized {
@@ -27,10 +31,7 @@ pub trait Mount<K: Kernel>: Sized {
27
31
/// # Safety
28
32
/// [`Mount::mtx()`] must be locked.
29
33
unsafe fn flags ( & self ) -> u64 ;
30
- }
31
34
32
- /// Represents `vfsconf` structure.
33
- pub trait Filesystem : Sized {
34
- /// Returns `vfc_name`.
35
- fn name ( & self ) -> * const c_char ;
35
+ /// Returns `mnt_stat`.
36
+ fn stats ( & self ) -> * mut K :: FsStats ;
36
37
}
Original file line number Diff line number Diff line change
1
+ /// Represents `statfs` structure.
2
+ pub trait FsStats : Sized { }
You can’t perform that action at this time.
0 commit comments