Skip to content

Commit

Permalink
Merge rename() & rename2() methods
Browse files Browse the repository at this point in the history
This is how libfuse handles it, and it reduces implementor complexity
  • Loading branch information
cberner committed Nov 15, 2020
1 parent ef0a689 commit 2e9968d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
1 change: 1 addition & 0 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ impl Filesystem for SimpleFS {
name: &OsStr,
new_parent: u64,
new_name: &OsStr,
_flags: u32,
reply: ReplyEmpty,
) {
let name_str = if let Some(value) = name.to_str() {
Expand Down
13 changes: 0 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,6 @@ pub trait Filesystem {

/// Rename a file.
fn rename(
&mut self,
_req: &Request<'_>,
_parent: u64,
_name: &OsStr,
_newparent: u64,
_newname: &OsStr,
reply: ReplyEmpty,
) {
reply.error(ENOSYS);
}

/// Rename a file.
fn rename2(
&mut self,
_req: &Request<'_>,
_parent: u64,
Expand Down
3 changes: 2 additions & 1 deletion src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ impl<'a> Request<'a> {
&name,
arg.newdir,
&newname,
0,
self.reply(),
);
}
Expand Down Expand Up @@ -541,7 +542,7 @@ impl<'a> Request<'a> {
}
#[cfg(feature = "abi-7-23")]
ll::Operation::Rename2 { arg, name, newname } => {
se.filesystem.rename2(
se.filesystem.rename(
self,
self.request.nodeid(),
name,
Expand Down

0 comments on commit 2e9968d

Please sign in to comment.