Class: FFI::Libfuse::FuseConfig
- Inherits:
-
Struct
- Object
- Struct
- FFI::Libfuse::FuseConfig
- Includes:
- Accessors
- Defined in:
- lib/ffi/libfuse/fuse_config.rb
Overview
Configuration of the high-level API
This structure is initialized from the arguments passed to fuse_new(), and then passed to the file system's init() handler which should ensure that the configuration is compatible with the file system implementation.
Some options can only be set via the filesystem init method (:use_ino etc..) because the filesystem either supports them or it doesn't.
Instance Attribute Summary collapse
-
#ac_attr_timeout ⇒ Object
if set the timeout in seconds for which file attributes are cached for the purpose of checking if auto_cache should flush the file data on open.
-
#attr_timeout ⇒ Float
The timeout in seconds for which file/directory attributes.
-
#auto_cache? ⇒ Boolean
invalidate cached data on open based on changes in file attributes.
-
#direct_io? ⇒ Boolean
disables the use of kernel page cache (file content cache) in the kernel for this filesystem.
-
#entry_timeout ⇒ Float
The timeout in seconds for which name lookups will be cached.
-
#gid ⇒ Integer|nil
readonly
If set, this value will be used for the :gid attribute of each file.
-
#hard_remove? ⇒ Boolean
should open files be removed immediately.
-
#intr? ⇒ Boolean
Allow requests to be interrupted.
-
#intr_signal ⇒ Integer
Which signal number to send to the filesystem when a request is interrupted.
-
#kernel_cache? ⇒ Boolean
disables flushing the cache of the file contents on every open(2).
-
#negative_timeout ⇒ Float
The timeout in seconds for which a negative lookup will be cached.
-
#nullpath_ok? ⇒ Boolean
operations on open files and directories are ok to receive nil paths.
-
#readdir_ino? ⇒ Boolean
generate inodes for readdir even if #use_ino? is set.
-
#remember ⇒ Integer
the number of seconds inodes are remembered.
-
#uid ⇒ Integer|nil
readonly
If set, this value will be used for the :uid attribute of each file.
-
#umask ⇒ Integer|nil
readonly
If set, this mask will be applied to the mode attribute of each file.
-
#use_ino? ⇒ Boolean
use filesystem provided inode values.
Method Summary
Methods included from Accessors
#ffi_attr_fill, #ffi_attr_reader_member, #ffi_attr_writer_member, #fill, #inspect, #to_h
Methods included from Accessors::ClassMethods
#attr_accessor, #attr_reader, #attr_writer, #ffi_attr_accessor, #ffi_attr_reader, #ffi_attr_reader_method, #ffi_attr_readers, #ffi_attr_writer, #ffi_attr_writer_method, #ffi_attr_writers, #ffi_bitflag_accessor, #ffi_bitflag_reader, #ffi_bitflag_writer, #ffi_public_attr_readers, #ffi_public_attr_writers
Instance Attribute Details
#ac_attr_timeout ⇒ Object
if set the timeout in seconds for which file attributes are cached for the purpose of checking if auto_cache should flush the file data on open.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 161
|
#attr_timeout ⇒ Float
The timeout in seconds for which file/directory attributes
(as returned by e.g. the getattr
handler) are cached.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 50
|
#auto_cache? ⇒ Boolean
invalidate cached data on open based on changes in file attributes
This option is an alternative to kernel_cache
. Instead of unconditionally keeping cached data, the cached
data is invalidated on open(2) if if the modification time or the size of the file has changed since it was
last opened.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 152
|
#direct_io? ⇒ Boolean
disables the use of kernel page cache (file content cache) in the kernel for this filesystem.
This has several affects:
Each read(2) or write(2) system call will initiate one or more read or write operations, data will not be cached in the kernel.
The return value of the read() and write() system calls will correspond to the return values of the read and write operations. This is useful for example if the file size is not known in advance (before reading it).
Internally, enabling this option causes fuse to set FFI::Libfuse::FuseFileInfo#direct_io overwriting any value that was put there by the file system during :open
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 121
|
#entry_timeout ⇒ Float
The timeout in seconds for which name lookups will be cached.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 35
|
#gid ⇒ Integer|nil (readonly)
Returns if set, this value will be used for the :gid attribute of each file.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 20
|
#hard_remove? ⇒ Boolean
should open files be removed immediately
The default behavior is that if an open file is deleted, the file is renamed to a hidden file (.fuse_hiddenXXX), and only removed when the file is finally released. This relieves the filesystem implementation of having to deal with this problem. This option disables the hiding behavior, and files are removed immediately in an unlink operation (or in a rename operation which overwrites an existing file).
It is recommended that you not use the hard_remove option. When hard_remove is set, the following libc functions fail on unlinked files (returning errno of ENOENT): read(2), write(2), fsync(2), close(2), f*xattr(2), ftruncate(2), fstat(2), fchmod(2), fchown(2)
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 83
|
#intr? ⇒ Boolean
Allow requests to be interrupted
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 58
|
#intr_signal ⇒ Integer
Which signal number to send to the filesystem when a request is interrupted.
The default is hardcoded to USR1.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 63
|
#kernel_cache? ⇒ Boolean
disables flushing the cache of the file contents on every open(2).
This should only be enabled on filesystem where the file data is never changed externally (not through the mounted FUSE filesystem). Thus it is not suitable for network filesystem and other intermediate filesystem.
Note: if neither this option or #direct_io? is specified data is still cached after the open(2), so a read(2) system call will not always initiate a read operation.
Internally, enabling this option causes fuse to set FFI::Libfuse::FuseFileInfo#keep_cache overwriting any value that was put there by the file system.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 138
|
#negative_timeout ⇒ Float
The timeout in seconds for which a negative lookup will be cached.
This means, that if file did not exist (lookup returned ENOENT), the lookup will only be redone after the timeout, and the file/directory will be assumed to not exist until then. A value of zero means that negative lookups are not cached.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 40
|
#nullpath_ok? ⇒ Boolean
operations on open files and directories are ok to receive nil paths
If this option is given the file-system handlers for the following operations will not receive path information: read, write, flush, release, fsync, readdir, releasedir, fsyncdir, lock, ioctl and poll.
For the truncate, getattr, chmod, chown and utimens operations the path will be provided only if the FFI::Libfuse::FuseFileInfo argument is nil.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 168
|
#readdir_ino? ⇒ Boolean
generate inodes for readdir even if #use_ino? is set
If use_ino option is not given, still try to fill in the d_ino field in readdir(2). If the name was previously looked up, and is still in the cache, the inode number found there will be used. Otherwise it will be set to -1. If use_ino option is given, this option is ignored.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 112
|
#remember ⇒ Integer
the number of seconds inodes are remembered
Normally, FUSE assigns inodes to paths only for as long as the kernel is aware of them. With this option inodes are instead remembered for at least this many seconds. This will require more memory, but may be necessary when using applications that make use of inode numbers.
A number of -1 means that inodes will be remembered for the entire life-time of the file-system process.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 71
|
#uid ⇒ Integer|nil (readonly)
Returns if set, this value will be used for the :uid attribute of each file.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 25
|
#umask ⇒ Integer|nil (readonly)
Returns if set, this mask will be applied to the mode attribute of each file.
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 30
|
#use_ino? ⇒ Boolean
use filesystem provided inode values
Honor the st_ino field in the functions getattr() and fill_dir(). This value is used to fill in the st_ino field in the stat(2), lstat(2), fstat(2) functions and the d_ino field in the readdir(2) function. The filesystem does not have to guarantee uniqueness, however some applications rely on this value being unique for the whole filesystem.
Note that this does not affect the inode that libfuse and the kernel use internally (also called the "nodeid").
|
# File 'lib/ffi/libfuse/fuse_config.rb', line 98
|