Allow dynamically borrowed mutex guard

This commit is contained in:
Zhang Junyang
2024-04-23 09:39:49 +08:00
committed by Tate, Hongliang Tian
parent 11e4984df2
commit d15b4d9115
4 changed files with 35 additions and 19 deletions

View File

@ -202,7 +202,7 @@ impl ExfatChain {
fn alloc_cluster_from_empty(
&mut self,
num_to_be_allocated: u32,
bitmap: &mut MutexGuard<'_, ExfatBitmap>,
bitmap: &mut MutexGuard<ExfatBitmap>,
sync_bitmap: bool,
) -> Result<ClusterID> {
// Search for a continuous chunk big enough
@ -228,7 +228,7 @@ impl ExfatChain {
&mut self,
num_to_be_allocated: u32,
sync: bool,
bitmap: &mut MutexGuard<'_, ExfatBitmap>,
bitmap: &mut MutexGuard<ExfatBitmap>,
) -> Result<ClusterID> {
let fs = self.fs();
let mut alloc_start_cluster = 0;
@ -255,7 +255,7 @@ impl ExfatChain {
start_physical_cluster: ClusterID,
drop_num: u32,
sync_bitmap: bool,
bitmap: &mut MutexGuard<'_, ExfatBitmap>,
bitmap: &mut MutexGuard<ExfatBitmap>,
) -> Result<()> {
let fs = self.fs();

View File

@ -325,7 +325,7 @@ impl ExfatFS {
self.super_block.cluster_size as usize * self.super_block.num_clusters as usize
}
pub(super) fn lock(&self) -> MutexGuard<'_, ()> {
pub(super) fn lock(&self) -> MutexGuard<()> {
self.mutex.lock()
}