Struct nydus_service::FsCacheHandler
source · pub struct FsCacheHandler { /* private fields */ }
Expand description
Handler to cooperate with Linux fscache driver to manage cached blob objects.
The FsCacheHandler
create a communication channel with the Linux fscache driver, configure
the communication session and serves all requests from the fscache driver.
Implementations§
source§impl FsCacheHandler
impl FsCacheHandler
sourcepub fn new(
path: &str,
dir: &str,
tag: Option<&str>,
blob_cache_mgr: Arc<BlobCacheMgr>,
threads: usize
) -> Result<Self>
pub fn new( path: &str, dir: &str, tag: Option<&str>, blob_cache_mgr: Arc<BlobCacheMgr>, threads: usize ) -> Result<Self>
Create a new instance of FsCacheHandler.
sourcepub fn working_threads(&self) -> usize
pub fn working_threads(&self) -> usize
Get number of working threads to service fscache requests.
sourcepub fn run_loop(&self) -> Result<()>
pub fn run_loop(&self) -> Result<()>
Run the event loop to handle all requests from kernel fscache driver.
This method should only be invoked by a single thread, which will poll the fscache fd and dispatch requests from fscache fd to other working threads.
sourcepub fn cull_cache(&self, blob_id: String) -> Result<()>
pub fn cull_cache(&self, blob_id: String) -> Result<()>
Reclaim unused facache objects.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for FsCacheHandler
impl Send for FsCacheHandler
impl Sync for FsCacheHandler
impl Unpin for FsCacheHandler
impl UnwindSafe for FsCacheHandler
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more