Trait fuse3::path::prelude::PathFilesystem[][src]

pub trait PathFilesystem {
    type DirEntryStream: Stream<Item = Result<DirectoryEntry>> + Send;
    type DirEntryPlusStream: Stream<Item = Result<DirectoryEntryPlus>> + Send;
Show methods #[must_use] fn init<'life0, 'async_trait>(
        &'life0 self,
        req: Request
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn destroy<'life0, 'async_trait>(
        &'life0 self,
        req: Request
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn getlk<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        lock_owner: u64,
        start: u64,
        end: u64,
        type: u32,
        pid: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyLock>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn setlk<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        lock_owner: u64,
        start: u64,
        end: u64,
        type: u32,
        pid: u32,
        block: bool
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; #[must_use] fn lookup<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        name: &'life2 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn forget<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        nlookup: u64
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn getattr<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: Option<u64>,
        flags: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyAttr>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn setattr<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: Option<u64>,
        set_attr: SetAttr
    ) -> Pin<Box<dyn Future<Output = Result<ReplyAttr>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn readlink<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<ReplyData>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn symlink<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        name: &'life2 OsStr,
        link_path: &'life3 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn mknod<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        name: &'life2 OsStr,
        mode: u32,
        rdev: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn mkdir<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        name: &'life2 OsStr,
        mode: u32,
        umask: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn unlink<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        name: &'life2 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn rmdir<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        name: &'life2 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn rename<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        req: Request,
        origin_parent: &'life1 OsStr,
        origin_name: &'life2 OsStr,
        parent: &'life3 OsStr,
        name: &'life4 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        'life4: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn link<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        new_parent: &'life2 OsStr,
        new_name: &'life3 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn open<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        flags: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyOpen>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        offset: u64,
        size: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyData>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn write<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        offset: u64,
        data: &'life2 [u8],
        flags: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyWrite>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn statsfs<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<ReplyStatFs>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn release<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        flags: u32,
        lock_owner: u64,
        flush: bool
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn fsync<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        datasync: bool
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn setxattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        name: &'life2 OsStr,
        value: &'life3 OsStr,
        flags: u32,
        position: u32
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn getxattr<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        name: &'life2 OsStr,
        size: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyXAttr>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn listxattr<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        size: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyXAttr>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn removexattr<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        name: &'life2 OsStr
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn flush<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        lock_owner: u64
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn opendir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        flags: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyOpen>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn readdir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        fh: u64,
        offset: i64
    ) -> Pin<Box<dyn Future<Output = Result<ReplyDirectory<Self::DirEntryStream>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn releasedir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        fh: u64,
        flags: u32
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn fsyncdir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        fh: u64,
        datasync: bool
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn access<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        mask: u32
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn create<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        name: &'life2 OsStr,
        mode: u32,
        flags: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyCreated>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn interrupt<'life0, 'async_trait>(
        &'life0 self,
        req: Request,
        unique: u64
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn bmap<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        block_size: u32,
        idx: u64
    ) -> Pin<Box<dyn Future<Output = Result<ReplyBmap>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn poll<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        kn: Option<u64>,
        flags: u32,
        envents: u32,
        notify: &'life2 Notify
    ) -> Pin<Box<dyn Future<Output = Result<ReplyPoll>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn notify_reply<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: &'life1 OsStr,
        offset: u64,
        data: Bytes
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn batch_forget<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        paths: &'life1 [&'life2 OsStr]
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn fallocate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        offset: u64,
        length: u64,
        mode: u32
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn readdirplus<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        parent: &'life1 OsStr,
        fh: u64,
        offset: u64,
        lock_owner: u64
    ) -> Pin<Box<dyn Future<Output = Result<ReplyDirectoryPlus<Self::DirEntryPlusStream>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn rename2<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        req: Request,
        origin_parent: &'life1 OsStr,
        origin_name: &'life2 OsStr,
        parent: &'life3 OsStr,
        name: &'life4 OsStr,
        flags: u32
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        'life4: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn lseek<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        path: Option<&'life1 OsStr>,
        fh: u64,
        offset: u64,
        whence: u32
    ) -> Pin<Box<dyn Future<Output = Result<ReplyLSeek>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn copy_file_range<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: Request,
        from_path: Option<&'life1 OsStr>,
        fh_in: u64,
        offset_in: u64,
        to_path: Option<&'life2 OsStr>,
        fh_out: u64,
        offset_out: u64,
        length: u64,
        flags: u64
    ) -> Pin<Box<dyn Future<Output = Result<ReplyCopyFileRange>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
}
Expand description

Path based filesystem trait.

Notes:

this trait is defined with async_trait, you can use async_trait to implement it, or just implement it directly.

Associated Types

dir entry stream given by readdir.

dir entry plus stream given by readdirplus.

Required methods

initialize filesystem. Called before any other filesystem method.

clean up filesystem. Called on filesystem exit which is fuseblk, in normal fuse filesystem, kernel may call forget for root. There is some discuss for this https://github.com/bazil/fuse/issues/82#issuecomment-88126886, https://sourceforge.net/p/fuse/mailman/message/31995737/

test for a POSIX file lock.

Notes:

this is supported on enable file-lock feature.

acquire, modify or release a POSIX file lock.

Notes:

this is supported on enable file-lock feature.

Provided methods

look up a directory entry by name and get its attributes.

forget an path. The nlookup parameter indicates the number of lookups previously performed on this path. If the filesystem implements path lifetimes, it is recommended that paths acquire a single reference on each lookup, and lose nlookup references on each forget. The filesystem may ignore forget calls, if the paths don’t need to have a limited lifetime. On unmount it is not guaranteed, that all referenced paths will receive a forget message. When filesystem is normal(not fuseblk) and unmounting, kernel may send forget request for root and this library will stop session after call forget. There is some discussion for this https://github.com/bazil/fuse/issues/82#issuecomment-88126886, https://sourceforge.net/p/fuse/mailman/message/31995737/ https://sourceforge.net/p/fuse/mailman/message/31995737/

get file attributes. If fh is None, means fh is not set. If path is None, means the path may be deleted.

set file attributes. If fh is None, means fh is not set. If path is None, means the path may be deleted.

read symbolic link.

create a symbolic link.

create file node. Create a regular file, character device, block device, fifo or socket node. When creating file, most cases user only need to implement create.

create a directory.

remove a file.

remove a directory.

rename a file or directory.

create a hard link.

open a file. Open flags (with the exception of O_CREAT, O_EXCL and 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). 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.

Notes:

See fuse_file_info structure in fuse_common.h for more details.

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. when path is None, it means the path may be deleted.

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. when path is None, it means the path may be deleted.

get filesystem statistics.

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. flush means flush the data or not when closing file. when path is None, it means the path may be deleted.

synchronize file contents. If the datasync is true, then only the user data should be flushed, not the metadata. when path is None, it means the path may be deleted.

set an extended attribute.

get an extended attribute. If size is too small, use ReplyXAttr::Size to return correct size. If size is enough, use ReplyXAttr::Data to send it, or return error.

list extended attribute names. If size is too small, use ReplyXAttr::Size to return correct size. If size is enough, use ReplyXAttr::Data to send it, or return error.

remove an extended attribute.

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. when path is None, it means the path may be deleted.

Notes:

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.

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 directory. offset is used to track the offset of the directory entries. fh will contain the value set by the opendir method, or will be undefined if the opendir method didn’t set any value.

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.

synchronize directory contents. If the datasync is true, then only the directory contents should be flushed, not the metadata. fh will contain the value set by the opendir method, or will be undefined if the opendir method didn’t set any value.

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 be called. This method is not called under Linux kernel versions 2.4.x.

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. 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.

Notes:

See fuse_file_info structure in fuse_common.h for more details.

handle interrupt. When a operation is interrupted, an interrupt request will send to fuse server with the unique id of the operation.

map block index within file to block index within device.

Notes:

This may not works because currently this crate doesn’t support fuseblk mode yet.

poll for IO readiness events.

receive notify reply from kernel.

forget more than one path. This is a batch version forget

allocate space for an open file. This function ensures that required space is allocated for specified file.

Notes:

more information about fallocate, please see man 2 fallocate

read directory entries, but with their attribute, like readdir + lookup at the same time.

rename a file or directory with flags.

find next data or hole after the specified offset.

copy a range of data from one file to another. This can improve performance because it reduce data copy: in normal, data will copy from FUSE server to kernel, then to user-space, then to kernel, finally send back to FUSE server. By implement this method, data will only copy in FUSE server internal. when from_path or to_path is None, it means the path may be deleted.

Implementors