@@ -46,7 +46,7 @@ bitflags::bitflags! {
4646
4747pub trait FileSystem : Sync + Send {
4848 /// Returns an identifier which can be used to determine this file system.
49- fn get_name ( & self ) -> & [ u8 ] ;
49+ fn get_name ( & self ) -> & str ;
5050
5151 /// Mounts an instance of this file system from a `source`.
5252 /// Returns a reference to the mount point with an instance of this file system.
@@ -65,17 +65,14 @@ pub trait SuperBlock: Sync + Send + Any {
6565}
6666
6767/// A map of all known and registered file systems.
68- static FS_TABLE : SpinMutex < BTreeMap < & ' static [ u8 ] , & ' static dyn FileSystem > > =
68+ static FS_TABLE : SpinMutex < BTreeMap < & ' static str , & ' static dyn FileSystem > > =
6969 SpinMutex :: new ( BTreeMap :: new ( ) ) ;
7070
7171/// Registers a new file system.
7272pub fn register ( fs : & ' static dyn FileSystem ) {
7373 let name = fs. get_name ( ) ;
7474 FS_TABLE . lock ( ) . insert ( name, fs) ;
75- log ! (
76- "Registered new file system \" {}\" " ,
77- String :: from_utf8_lossy( name)
78- ) ;
75+ log ! ( "Registered new file system \" {name}\" " ) ;
7976}
8077
8178static MOUNTED_SUPERS : SpinMutex < Vec < Arc < dyn SuperBlock > > > = SpinMutex :: new ( Vec :: new ( ) ) ;
@@ -92,7 +89,7 @@ pub fn sync_all() -> EResult<()> {
9289}
9390
9491/// Mounts a file system at path `source` on `target`.
95- pub fn mount ( fs_name : & [ u8 ] , flags : MountFlags , arg : UserPtr < ( ) > ) -> EResult < Arc < Mount > > {
92+ pub fn mount ( fs_name : & str , flags : MountFlags , arg : UserPtr < ( ) > ) -> EResult < Arc < Mount > > {
9693 let fs = {
9794 let table = FS_TABLE . lock ( ) ;
9895 * table. get ( fs_name) . ok_or ( Errno :: ENODEV ) ?
0 commit comments