diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/fuse.h | 4 | ||||
-rw-r--r-- | include/fuse_lowlevel.h | 21 |
2 files changed, 18 insertions, 7 deletions
diff --git a/include/fuse.h b/include/fuse.h index 8943835..5b9082b 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -748,11 +748,13 @@ void fuse_exit(struct fuse *f); * in the callback function of fuse_operations is also thread-safe. * * @param f the FUSE handle + * @param clone_fd whether to use separate device fds for each thread + * (may increase performance) * @return 0 if no error occurred, -1 otherwise * * See also: fuse_loop() */ -int fuse_loop_mt(struct fuse *f); +int fuse_loop_mt(struct fuse *f, int clone_fd); /** * Get the current context diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index bad1d45..0b7ee2b 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -420,12 +420,18 @@ struct fuse_lowlevel_ops { /** * Open a file * - * Open flags (with the exception of O_CREAT, O_EXCL, O_NOCTTY and - * O_TRUNC) are available in fi->flags. + * Open flags are available in fi->flags. Creation (O_CREAT, + * O_EXCL, O_NOCTTY) and by default also truncation (O_TRUNC) + * flags will be filtered out. If an application specifies + * O_TRUNC, fuse first calls truncate() and then open(). * - * Filesystem may store an arbitrary file handle (pointer, index, - * etc) in fi->fh, and use this in other all other file operations - * (read, write, flush, release, fsync). + * If filesystem is able to handle O_TRUNC directly, the + * init() handler should set the `FUSE_CAP_ATOMIC_O_TRUNC` bit + * in ``conn->want``. + * + * Filesystem may store an arbitrary file handle (pointer, + * index, etc) in fi->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 fi->fh. @@ -1651,6 +1657,7 @@ struct fuse_cmdline_opts { char *mountpoint; int show_version; int show_help; + int clone_fd; }; /** @@ -1721,9 +1728,11 @@ int fuse_session_loop(struct fuse_session *se); * Enter a multi-threaded event loop * * @param se the session + * @param clone_fd whether to use separate device fds for each thread + * (may increase performance) * @return 0 on success, -1 on error */ -int fuse_session_loop_mt(struct fuse_session *se); +int fuse_session_loop_mt(struct fuse_session *se, int clone_fd); /** * Flag a session as terminated. |