Remove clean_for_close/flush in FileLike

This commit is contained in:
Ruihan Li
2024-07-23 19:21:03 +08:00
committed by Tate, Hongliang Tian
parent f57dcd814a
commit c320552ae1
5 changed files with 24 additions and 25 deletions

View File

@ -54,10 +54,6 @@ pub trait FileLike: Pollable + Send + Sync + Any {
return_errno_with_message!(Errno::EINVAL, "resize is not supported");
}
fn flush(&self) -> Result<()> {
Ok(())
}
fn metadata(&self) -> Metadata {
panic!("metadata unsupported");
}
@ -102,11 +98,6 @@ pub trait FileLike: Pollable + Send + Sync + Any {
return_errno_with_message!(Errno::ESPIPE, "seek is not supported");
}
fn clean_for_close(&self) -> Result<()> {
self.flush()?;
Ok(())
}
fn register_observer(
&self,
observer: Weak<dyn Observer<IoEvents>>,