mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-01 20:36:37 -05:00
rework config management
* Add standard way to do str2val and val2str conversion * Add support for a config file * Add support for reading and writing settings via ioctl
This commit is contained in:
parent
8d989777f8
commit
54c41c4994
90 changed files with 3292 additions and 2619 deletions
|
|
@ -77,7 +77,7 @@ struct fuse_operations {
|
|||
* ignored. The 'st_ino' field is ignored except if the 'use_ino'
|
||||
* mount option is given.
|
||||
*/
|
||||
int (*getattr) (const char *, struct stat *);
|
||||
int (*getattr) (const char *, struct stat *, fuse_timeouts_t *);
|
||||
|
||||
/** Read the target of a symbolic link
|
||||
*
|
||||
|
|
@ -390,7 +390,7 @@ struct fuse_operations {
|
|||
*
|
||||
* Introduced in version 2.5
|
||||
*/
|
||||
int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *);
|
||||
int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *, fuse_timeouts_t *);
|
||||
|
||||
/**
|
||||
* Perform POSIX file locking operation
|
||||
|
|
@ -504,7 +504,7 @@ struct fuse_operations {
|
|||
* Introduced in version 2.8
|
||||
*/
|
||||
int (*ioctl) (const char *fusepath,
|
||||
int cmd,
|
||||
unsigned long cmd,
|
||||
void *arg,
|
||||
struct fuse_file_info *ffi,
|
||||
unsigned int flags,
|
||||
|
|
@ -853,9 +853,17 @@ struct fuse_fs;
|
|||
* fuse_fs_releasedir and fuse_fs_statfs, which return 0.
|
||||
*/
|
||||
|
||||
int fuse_fs_getattr(struct fuse_fs *fs, const char *path, struct stat *buf);
|
||||
int fuse_fs_fgetattr(struct fuse_fs *fs, const char *path, struct stat *buf,
|
||||
struct fuse_file_info *fi);
|
||||
int fuse_fs_getattr(struct fuse_fs *fs,
|
||||
const char *path,
|
||||
struct stat *buf,
|
||||
fuse_timeouts_t *timeout);
|
||||
|
||||
int fuse_fs_fgetattr(struct fuse_fs *fs,
|
||||
const char *path,
|
||||
struct stat *buf,
|
||||
struct fuse_file_info *fi,
|
||||
fuse_timeouts_t *timeout);
|
||||
|
||||
int fuse_fs_rename(struct fuse_fs *fs, const char *oldpath,
|
||||
const char *newpath);
|
||||
int fuse_fs_unlink(struct fuse_fs *fs, const char *path);
|
||||
|
|
@ -920,7 +928,7 @@ int fuse_fs_removexattr(struct fuse_fs *fs, const char *path,
|
|||
const char *name);
|
||||
int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize,
|
||||
uint64_t *idx);
|
||||
int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, int cmd, void *arg,
|
||||
int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, unsigned long cmd, void *arg,
|
||||
struct fuse_file_info *fi, unsigned int flags,
|
||||
void *data, uint32_t *out_bufsz);
|
||||
int fuse_fs_poll(struct fuse_fs *fs, const char *path,
|
||||
|
|
|
|||
|
|
@ -40,6 +40,13 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct fuse_timeouts_s fuse_timeouts_t;
|
||||
struct fuse_timeouts_s
|
||||
{
|
||||
uint64_t entry;
|
||||
uint64_t attr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about open files
|
||||
*
|
||||
|
|
@ -83,9 +90,6 @@ fuse_file_info
|
|||
|
||||
uint32_t auto_cache : 1;
|
||||
|
||||
/** Padding. Do not use*/
|
||||
uint32_t padding : 24;
|
||||
|
||||
/** File handle. May be filled in by filesystem in open().
|
||||
Available in all other file operations */
|
||||
uint64_t fh;
|
||||
|
|
|
|||
|
|
@ -101,11 +101,7 @@ struct fuse_entry_param {
|
|||
*/
|
||||
struct stat attr;
|
||||
|
||||
/** Validity timeout (in seconds) for the attributes */
|
||||
double attr_timeout;
|
||||
|
||||
/** Validity timeout (in seconds) for the name */
|
||||
double entry_timeout;
|
||||
fuse_timeouts_t timeout;
|
||||
};
|
||||
|
||||
/** Additional context associated with requests */
|
||||
|
|
@ -882,7 +878,7 @@ struct fuse_lowlevel_ops {
|
|||
* @param in_bufsz number of fetched bytes
|
||||
* @param out_bufsz maximum size of output data
|
||||
*/
|
||||
void (*ioctl) (fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
|
||||
void (*ioctl) (fuse_req_t req, fuse_ino_t ino, unsigned long cmd, void *arg,
|
||||
struct fuse_file_info *fi, unsigned flags,
|
||||
const void *in_buf, uint32_t in_bufsz, uint32_t out_bufsz);
|
||||
|
||||
|
|
@ -1136,8 +1132,9 @@ int fuse_reply_create(fuse_req_t req, const struct fuse_entry_param *e,
|
|||
* @param attr_timeout validity timeout (in seconds) for the attributes
|
||||
* @return zero for success, -errno for failure to send reply
|
||||
*/
|
||||
int fuse_reply_attr(fuse_req_t req, const struct stat *attr,
|
||||
double attr_timeout);
|
||||
int fuse_reply_attr(fuse_req_t req,
|
||||
const struct stat *attr,
|
||||
const uint64_t timeout);
|
||||
|
||||
/**
|
||||
* Reply with the contents of a symbolic link
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue