Skip to content

Commit b50a608

Browse files
Seanimeoer
Sean
authored andcommitted
refactor: remove unused import
1 parent 1aa38b2 commit b50a608

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/api/server/sync_io.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,22 @@ impl<F: FileSystem + Sync> Server<F> {
5959
}
6060

6161
#[cfg(feature = "fusedev")]
62+
/// Send a resend notification message to the kernel via FUSE. This function should be invoked as part of
63+
/// the crash recovery routine. Given that FUSE initialization does not occur again during recovery,
64+
/// the capability to support resend notifications may not be automatically detected. It is the responsibility
65+
/// of the upper layers to verify and persist the kernel's support for this feature upon the initial FUSE setup.
6266
pub fn notify_resend<S: BitmapSlice>(
6367
&self,
6468
mut w: FuseDevWriter<'_, S>,
6569
) -> Result<()> {
6670
let mut buffer_writer = w.split_at(0).map_err(Error::FailedToSplitWriter)?;
67-
let mut header = OutHeader::default();
68-
header.unique = 0;
69-
header.error = NotifyOpcode::Resend as i32;
71+
let header = {
72+
OutHeader{
73+
unique: 0,
74+
error: NotifyOpcode::Resend as i32,
75+
..Default::default()
76+
}
77+
};
7078
buffer_writer
7179
.write_obj(header)
7280
.map_err(Error::FailedToWrite)?;

tests/passthrough/src/main.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use fuse_backend_rs::transport::FuseDevWriter;
2-
use fuse_backend_rs::transport::Writer;
31
use log::{error, info, warn, LevelFilter};
42
use std::env;
53
use std::fs;
@@ -13,7 +11,6 @@ use signal_hook::{consts::TERM_SIGNALS, iterator::Signals};
1311
use fuse_backend_rs::api::{server::Server, Vfs, VfsOptions};
1412
use fuse_backend_rs::passthrough::{Config, PassthroughFs};
1513
use fuse_backend_rs::transport::{FuseChannel, FuseSession};
16-
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
1714

1815
use simple_logger::SimpleLogger;
1916

@@ -63,7 +60,9 @@ impl Daemon {
6360
se.mount().unwrap();
6461

6562
se.with_writer(|writer| {
66-
self.server.notify_resend(writer).unwrap();
63+
self.server
64+
.notify_resend(writer)
65+
.unwrap_or_else(|e| println!("failed to send resend notification {}", e));
6766
});
6867

6968
for _ in 0..self.thread_cnt {

0 commit comments

Comments
 (0)