summary refs log tree commit diff
path: root/ripple/fossil
diff options
context:
space:
mode:
authoredef <edef@unfathomable.blue>2022-04-15 21:41:25 +0000
committeredef <edef@unfathomable.blue>2022-04-15 21:41:25 +0000
commita9e5a698f9c052d102711e539c87a9b9f6d0c233 (patch)
tree198eede7a52ebde7c274d8f17029ba656cb36755 /ripple/fossil
parent43b662bdd466131882d312802bb6e6c0d788950d (diff)
ripple/fossil/mount: move writing methods into their own section
Change-Id: Ia5b63f3be625c738c58a915bc46114cac7acc0a5
Diffstat (limited to 'ripple/fossil')
-rw-r--r--ripple/fossil/src/bin/mount.rs332
1 files changed, 167 insertions, 165 deletions
diff --git a/ripple/fossil/src/bin/mount.rs b/ripple/fossil/src/bin/mount.rs
index f37c7db..e6971a2 100644
--- a/ripple/fossil/src/bin/mount.rs
+++ b/ripple/fossil/src/bin/mount.rs
@@ -159,27 +159,6 @@ impl fuser::Filesystem for Filesystem {
 		}
 	}
 
-	fn setattr(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_ino: u64,
-		_mode: Option<u32>,
-		_uid: Option<u32>,
-		_gid: Option<u32>,
-		_size: Option<u64>,
-		_atime: Option<fuser::TimeOrNow>,
-		_mtime: Option<fuser::TimeOrNow>,
-		_ctime: Option<std::time::SystemTime>,
-		_fh: Option<u64>,
-		_crtime: Option<std::time::SystemTime>,
-		_chgtime: Option<std::time::SystemTime>,
-		_bkuptime: Option<std::time::SystemTime>,
-		_flags: Option<u32>,
-		reply: fuser::ReplyAttr,
-	) {
-		reply.error(EROFS);
-	}
-
 	fn readlink(&mut self, _req: &fuser::Request<'_>, ino: u64, reply: fuser::ReplyData) {
 		match self.find(ino) {
 			Some(memtree::Node::Link { target }) => reply.data(target.as_bytes()),
@@ -188,86 +167,6 @@ impl fuser::Filesystem for Filesystem {
 		}
 	}
 
-	fn mknod(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_parent: u64,
-		_name: &std::ffi::OsStr,
-		_mode: u32,
-		_umask: u32,
-		_rdev: u32,
-		reply: fuser::ReplyEntry,
-	) {
-		reply.error(EROFS);
-	}
-
-	fn mkdir(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_parent: u64,
-		_name: &std::ffi::OsStr,
-		_mode: u32,
-		_umask: u32,
-		reply: fuser::ReplyEntry,
-	) {
-		reply.error(EROFS);
-	}
-
-	fn unlink(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_parent: u64,
-		_name: &std::ffi::OsStr,
-		reply: fuser::ReplyEmpty,
-	) {
-		reply.error(EROFS);
-	}
-
-	fn rmdir(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_parent: u64,
-		_name: &std::ffi::OsStr,
-		reply: fuser::ReplyEmpty,
-	) {
-		reply.error(EROFS);
-	}
-
-	fn symlink(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_parent: u64,
-		_name: &std::ffi::OsStr,
-		_link: &std::path::Path,
-		reply: fuser::ReplyEntry,
-	) {
-		reply.error(EROFS);
-	}
-
-	fn rename(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_parent: u64,
-		_name: &std::ffi::OsStr,
-		_newparent: u64,
-		_newname: &std::ffi::OsStr,
-		_flags: u32,
-		reply: fuser::ReplyEmpty,
-	) {
-		reply.error(EROFS);
-	}
-
-	fn link(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_ino: u64,
-		_newparent: u64,
-		_newname: &std::ffi::OsStr,
-		reply: fuser::ReplyEntry,
-	) {
-		reply.error(EROFS);
-	}
-
 	fn open(&mut self, _req: &fuser::Request<'_>, _ino: u64, _flags: i32, reply: fuser::ReplyOpen) {
 		reply.opened(0, 0);
 	}
@@ -300,21 +199,6 @@ impl fuser::Filesystem for Filesystem {
 		}
 	}
 
-	fn write(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_ino: u64,
-		_fh: u64,
-		_offset: i64,
-		_data: &[u8],
-		_write_flags: u32,
-		_flags: i32,
-		_lock_owner: Option<u64>,
-		reply: fuser::ReplyWrite,
-	) {
-		reply.error(EROFS);
-	}
-
 	fn flush(
 		&mut self,
 		_req: &fuser::Request<'_>,
@@ -456,19 +340,6 @@ impl fuser::Filesystem for Filesystem {
 		reply.statfs(0, 0, 0, 0, 0, 512, 255, 0);
 	}
 
-	fn setxattr(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_ino: u64,
-		_name: &std::ffi::OsStr,
-		_value: &[u8],
-		_flags: i32,
-		_position: u32,
-		reply: fuser::ReplyEmpty,
-	) {
-		reply.error(EROFS);
-	}
-
 	fn getxattr(
 		&mut self,
 		_req: &fuser::Request<'_>,
@@ -490,34 +361,11 @@ impl fuser::Filesystem for Filesystem {
 		reply.error(ENOSYS);
 	}
 
-	fn removexattr(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_ino: u64,
-		_name: &std::ffi::OsStr,
-		reply: fuser::ReplyEmpty,
-	) {
-		reply.error(EROFS);
-	}
-
 	fn access(&mut self, _req: &fuser::Request<'_>, ino: u64, mask: i32, reply: fuser::ReplyEmpty) {
 		debug!("[Not Implemented] access(ino: {:#x?}, mask: {})", ino, mask);
 		reply.error(ENOSYS);
 	}
 
-	fn create(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_parent: u64,
-		_name: &std::ffi::OsStr,
-		_mode: u32,
-		_umask: u32,
-		_flags: i32,
-		reply: fuser::ReplyCreate,
-	) {
-		reply.error(EROFS);
-	}
-
 	fn getlk(
 		&mut self,
 		_req: &fuser::Request<'_>,
@@ -574,19 +422,6 @@ impl fuser::Filesystem for Filesystem {
 		reply.error(ENOSYS);
 	}
 
-	fn fallocate(
-		&mut self,
-		_req: &fuser::Request<'_>,
-		_ino: u64,
-		_fh: u64,
-		_offset: i64,
-		_length: i64,
-		_mode: i32,
-		reply: fuser::ReplyEmpty,
-	) {
-		reply.error(EROFS);
-	}
-
 	fn lseek(
 		&mut self,
 		_req: &fuser::Request<'_>,
@@ -603,6 +438,173 @@ impl fuser::Filesystem for Filesystem {
 		reply.error(ENOSYS);
 	}
 
+	// read-write methods
+
+	fn setattr(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_ino: u64,
+		_mode: Option<u32>,
+		_uid: Option<u32>,
+		_gid: Option<u32>,
+		_size: Option<u64>,
+		_atime: Option<fuser::TimeOrNow>,
+		_mtime: Option<fuser::TimeOrNow>,
+		_ctime: Option<std::time::SystemTime>,
+		_fh: Option<u64>,
+		_crtime: Option<std::time::SystemTime>,
+		_chgtime: Option<std::time::SystemTime>,
+		_bkuptime: Option<std::time::SystemTime>,
+		_flags: Option<u32>,
+		reply: fuser::ReplyAttr,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn mknod(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_mode: u32,
+		_umask: u32,
+		_rdev: u32,
+		reply: fuser::ReplyEntry,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn mkdir(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_mode: u32,
+		_umask: u32,
+		reply: fuser::ReplyEntry,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn unlink(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		reply: fuser::ReplyEmpty,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn rmdir(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		reply: fuser::ReplyEmpty,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn symlink(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_link: &std::path::Path,
+		reply: fuser::ReplyEntry,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn rename(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_newparent: u64,
+		_newname: &std::ffi::OsStr,
+		_flags: u32,
+		reply: fuser::ReplyEmpty,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn link(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_ino: u64,
+		_newparent: u64,
+		_newname: &std::ffi::OsStr,
+		reply: fuser::ReplyEntry,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn write(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_ino: u64,
+		_fh: u64,
+		_offset: i64,
+		_data: &[u8],
+		_write_flags: u32,
+		_flags: i32,
+		_lock_owner: Option<u64>,
+		reply: fuser::ReplyWrite,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn setxattr(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_ino: u64,
+		_name: &std::ffi::OsStr,
+		_value: &[u8],
+		_flags: i32,
+		_position: u32,
+		reply: fuser::ReplyEmpty,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn removexattr(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_ino: u64,
+		_name: &std::ffi::OsStr,
+		reply: fuser::ReplyEmpty,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn create(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_mode: u32,
+		_umask: u32,
+		_flags: i32,
+		reply: fuser::ReplyCreate,
+	) {
+		reply.error(EROFS);
+	}
+
+	fn fallocate(
+		&mut self,
+		_req: &fuser::Request<'_>,
+		_ino: u64,
+		_fh: u64,
+		_offset: i64,
+		_length: i64,
+		_mode: i32,
+		reply: fuser::ReplyEmpty,
+	) {
+		reply.error(EROFS);
+	}
+
 	fn copy_file_range(
 		&mut self,
 		_req: &fuser::Request<'_>,