kubkon opened PR #1395 from mut-cleanup to master:
Until now, several syscalls including
fd_pwriteetc. were relying on mutating&mut Entryby mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::Filein Rust's libstd are also implemented for&std::fs::File. In part, this will prepare us to handleEntrys behind anRcandRefCellcombo.While here, I've also modified
OsHandlein BSD to includeRefCell<Option<Dir>>rather thanOption<Mutex<Dir>>as was until now. WhileRefCellcould easily be replaced withRefCell, since going multithreading will require a lot of (probably even) conceptual changes towasi-common, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swapped mutability for interior mutability in places.
kubkon requested alexcrichton and iximeow for a review on PR #1395.
kubkon requested alexcrichton and iximeow for a review on PR #1395.
kubkon edited PR #1395 from mut-cleanup to master:
Until now, several syscalls including
fd_pwriteetc. were relying on mutating&mut Entryby mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::Filein Rust's libstd are also implemented for&std::fs::File. In part, this will prepare us to handleEntrys behind anRcandRefCellcombo.While here, I've also modified
OsHandlein BSD to includeRefCell<Option<Dir>>rather thanOption<Mutex<Dir>>as was until now. WhileRefCellcould easily be replaced withMutex, since going multithreading will require a lot of (probably even) conceptual changes towasi-common, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swapped mutability for interior mutability in places.
kubkon edited PR #1395 from mut-cleanup to master:
Until now, several syscalls including
fd_pwriteetc. were relying on mutating&mut Entryby mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::Filein Rust's libstd are also implemented for&std::fs::File. In part, this will prepare us to handleEntrys behind anRcandRefCellcombo.While here, I've also modified
OsHandlein BSD to includeRefCell<Option<Dir>>rather thanOption<Mutex<Dir>>as was until now. WhileRefCellcould easily be replaced withMutex, since going multithreading will require a lot of conceptual changes towasi-common, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swapped mutability for interior mutability in places.
kubkon edited PR #1395 from mut-cleanup to master:
Until now, several syscalls including
fd_pwriteetc. were relying on mutating&mut Entryby mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::Filein Rust's libstd are also implemented for&std::fs::File. In part, this will prepare us to handleEntrys behind anRcandRefCellcombo.While here, I've also modified
OsHandlein BSD to includeRefCell<Option<Dir>>rather thanOption<Mutex<Dir>>as was until now. WhileRefCellcould easily be replaced withMutex, since going multithreading will require a lot of conceptual changes towasi-common, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swaps mutability for interior mutability in places.
kubkon edited PR #1395 from mut-cleanup to master:
Until now, several syscalls including
fd_pwriteetc. were relying on mutating&mut Entryby mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::Filein Rust's libstd are also implemented for&std::fs::File. In part, this will prepare us to handleEntrys behind anRcandRefCellcombo.While here, I've also modified
OsHandlein BSD to includeRefCell<Option<Dir>>rather thanOption<Mutex<Dir>>as was until now. WhileRefCellcould easily be replaced withMutex, since going multithreading will require a lot of conceptual changes towasi-common, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swaps mutability for interior mutability in a handful of places.
Last updated: Dec 13 2025 at 21:03 UTC