Skip to content

Commit

Permalink
Added comments and renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
john-sharratt authored and theduke committed Aug 7, 2024
1 parent 6e02a96 commit b8c5c6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/wasix/src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,13 @@ impl WasiFs {
}
}

pub fn clear_free_fd_list(&self) {
/// We need to clear the freed FD list when the journal is replayed as it
/// will close lots of file descriptors which will fill the list. We clear
/// the list and allocate new FD's instead.
///
/// This should only be used when the file descriptors are being managed
/// externally (e.g. journals)
pub(crate) fn clear_freed_fd_list(&self) {
let mut freed_fds = self.freed_fds.write().unwrap();
freed_fds.clear();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/wasix/src/syscalls/journal/restore_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub unsafe fn restore_snapshot(

// Reset the freed FD's so that none of them will be reused after
// the journal resumes
runner.ctx.data().state().fs.clear_free_fd_list();
runner.ctx.data().state().fs.clear_freed_fd_list();

// Once we get to this point we are no longer replaying the journal
// and need to clear this flag, the reason is that restoring the
Expand Down

0 comments on commit b8c5c6e

Please sign in to comment.