Struct oramfs::Oramfs [−][src]
pub struct Oramfs<'a> { pub args: &'a ORAMConfig, pub oram_size: u64, pub oram: Box<dyn BaseORAM + 'a>, }
Expand description
ORAMFS holds the ORAM, and some parameters
Fields
args: &'a ORAMConfig
oram_size: u64
oram: Box<dyn BaseORAM + 'a>
Implementations
Create a new ORAMFS
Compute practical parameters for a given ORAM size
Read length
bytes starting at offset offset
.
Split larger reads into smaller reads of length equal to the ORAM block size, and reassemble the bytes read with the multiple smaller read operations before returning. Return the bytes read.
Trait Implementations
Implement the FUSE operations necessary to get the ORAMFS working
Initialize filesystem. Called before any other filesystem method. Read more
Look up a directory entry by name and get its attributes.
fn setattr(
&mut self,
_req: &Request<'_>,
ino: u64,
_mode: Option<u32>,
_uid: Option<u32>,
_gid: Option<u32>,
_size: Option<u64>,
_atime: Option<Timespec>,
_mtime: Option<Timespec>,
_fh: Option<u64>,
_crtime: Option<Timespec>,
_chgtime: Option<Timespec>,
_bkuptime: Option<Timespec>,
_flags: Option<u32>,
reply: ReplyAttr
)
fn setattr(
&mut self,
_req: &Request<'_>,
ino: u64,
_mode: Option<u32>,
_uid: Option<u32>,
_gid: Option<u32>,
_size: Option<u64>,
_atime: Option<Timespec>,
_mtime: Option<Timespec>,
_fh: Option<u64>,
_crtime: Option<Timespec>,
_chgtime: Option<Timespec>,
_bkuptime: Option<Timespec>,
_flags: Option<u32>,
reply: ReplyAttr
)
Set file attributes.
Open a file. Open flags (with the exception of O_CREAT, O_EXCL, O_NOCTTY and O_TRUNC) are available in flags. Filesystem may store an arbitrary file handle (pointer, index, etc) in fh, and use this in other all other file operations (read, write, flush, release, fsync). Filesystem may also implement stateless file I/O and not store anything in fh. There are also some flags (direct_io, keep_cache) which the filesystem may set, to change the way the file is opened. See fuse_file_info structure in <fuse_common.h> for more details. Read more
Read data. Read should send exactly the number of bytes requested except on EOF or error, otherwise the rest of the data will be substituted with zeroes. An exception to this is when the file has been opened in ‘direct_io’ mode, in which case the return value of the read system call will reflect the return value of this operation. fh will contain the value set by the open method, or will be undefined if the open method didn’t set any value. Read more
Write data. Write should return exactly the number of bytes requested except on error. An exception to this is when the file has been opened in ‘direct_io’ mode, in which case the return value of the write system call will reflect the return value of this operation. fh will contain the value set by the open method, or will be undefined if the open method didn’t set any value. Read more
Flush method. This is called on each close() of the opened file. Since file descriptors can be duplicated (dup, dup2, fork), for one open call there may be many flush calls. Filesystems shouldn’t assume that flush will always be called after some writes, or that if will be called at all. fh will contain the value set by the open method, or will be undefined if the open method didn’t set any value. NOTE: the name of the method is misleading, since (unlike fsync) the filesystem is not forced to flush pending writes. One reason to flush data, is if the filesystem wants to return write errors. If the filesystem supports file locking operations (setlk, getlk) it should remove all locks belonging to ‘lock_owner’. Read more
Release an open file. Release is called when there are no more references to an open file: all file descriptors are closed and all memory mappings are unmapped. For every open call there will be exactly one release call. The filesystem may reply with an error, but error values are not returned to close() or munmap() which triggered the release. fh will contain the value set by the open method, or will be undefined if the open method didn’t set any value. flags will contain the same flags as for open. Read more
Synchronize file contents. If the datasync parameter is non-zero, then only the user data should be flushed, not the meta data. Read more
Read directory. Send a buffer filled using buffer.fill(), with size not exceeding the requested size. Send an empty buffer on end of stream. fh will contain the value set by the opendir method, or will be undefined if the opendir method didn’t set any value. Read more
Get an extended attribute.
If size
is 0, the size of the value should be sent with reply.size()
.
If size
is not 0, and the value fits, send it with reply.data()
, or
reply.error(ERANGE)
if it doesn’t. Read more
Check file access permissions. This will be called for the access() system call. If the ‘default_permissions’ mount option is given, this method is not called. This method is not called under Linux kernel versions 2.4.x Read more
Clean up filesystem. Called on filesystem exit. Read more
Forget about an inode. The nlookup parameter indicates the number of lookups previously performed on this inode. If the filesystem implements inode lifetimes, it is recommended that inodes acquire a single reference on each lookup, and lose nlookup references on each forget. The filesystem may ignore forget calls, if the inodes don’t need to have a limited lifetime. On unmount it is not guaranteed, that all referenced inodes will receive a forget message. Read more
Create file node. Create a regular file, character device, block device, fifo or socket node. Read more
Create a directory.
Remove a file.
Remove a directory.
Create a symbolic link.
Rename a file.
Create a hard link.
Open a directory. Filesystem may store an arbitrary file handle (pointer, index, etc) in fh, and use this in other all other directory stream operations (readdir, releasedir, fsyncdir). Filesystem may also implement stateless directory I/O and not store anything in fh, though that makes it impossible to implement standard conforming directory stream operations in case the contents of the directory can change between opendir and releasedir. Read more
fn releasedir(
&mut self,
_req: &Request<'_>,
_ino: u64,
_fh: u64,
_flags: u32,
reply: ReplyEmpty
)
fn releasedir(
&mut self,
_req: &Request<'_>,
_ino: u64,
_fh: u64,
_flags: u32,
reply: ReplyEmpty
)
Release an open directory. For every opendir call there will be exactly one releasedir call. fh will contain the value set by the opendir method, or will be undefined if the opendir method didn’t set any value. Read more
Synchronize directory contents. If the datasync parameter is set, then only the directory contents should be flushed, not the meta data. fh will contain the value set by the opendir method, or will be undefined if the opendir method didn’t set any value. Read more
Get file system statistics.
Set an extended attribute.
List extended attribute names.
If size
is 0, the size of the value should be sent with reply.size()
.
If size
is not 0, and the value fits, send it with reply.data()
, or
reply.error(ERANGE)
if it doesn’t. Read more
Remove an extended attribute.
Create and open a file. If the file does not exist, first create it with the specified mode, and then open it. Open flags (with the exception of O_NOCTTY) are available in flags. Filesystem may store an arbitrary file handle (pointer, index, etc) in fh, and use this in other all other file operations (read, write, flush, release, fsync). There are also some flags (direct_io, keep_cache) which the filesystem may set, to change the way the file is opened. See fuse_file_info structure in <fuse_common.h> for more details. If this method is not implemented or under Linux kernel versions earlier than 2.6.15, the mknod() and open() methods will be called instead. Read more
Test for a POSIX file lock.
Acquire, modify or release a POSIX file lock. For POSIX threads (NPTL) there’s a 1-1 relation between pid and owner, but otherwise this is not always the case. For checking lock ownership, ‘fi->owner’ must be used. The l_pid field in ‘struct flock’ should only be used to fill in this field in getlk(). Note: if the locking methods are not implemented, the kernel will still allow file locking to work locally. Hence these are only interesting for network filesystems and similar. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Oramfs<'a>
impl<'a> !UnwindSafe for Oramfs<'a>