aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorLines
2024-03-20Add FUSE_FILL_DIR_DEFAULTS enum (#903)FredyVia-0/+2
In order to use the fuse_fill_dir_t function in a C++ program, add the enum item: FUSE_FILL_DIR_DEFAULTS Without this change g++ compilation failed with example/hello.c:94:35: error: invalid conversion from ‘int’ to ‘fuse_fill_dir_flags’ [-fpermissive] 94 | filler(buf, ".", NULL, 0, 0); | ^ | | | int
2024-01-20Add processing for FUSE_CAP_HANDLE_KILLPRIV and disable it by defaultbigbrotherwei-1/+1
'FUSE_CAP_HANDLE_KILLPRIV' is not enabled by default anymore, as that would be a sudden security issue introduced by a new ABI and API compatible libfuse version.
2024-01-10Don't set FUSE_CAP_PARALLEL_DIROPS by defaultMiklos Szeredi-2/+0
Allowing parallel dir operations could result in a crash in a filesystem implementation that is not prepared for this. To be safe keep this flag off by default (this is not a regression, since there was no public release where this flag wasn't ignored). If the filesystem wants better performance, then it should set this flag explicitly. Fixes: c9905341ea34 ("Pass FUSE_PARALLEL_DIROPS to kernel (#861)") Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2024-01-10Add FUSE_CAP_DIRECT_IO_ALLOW_MMAP and use in passthrough_hpBernd Schubert-0/+9
This is not called FUSE_CAP_DIRECT_IO_RELAX, as the kernel flag FUSE_DIRECT_IO_RELAX is supposed to be renamed to FUSE_DIRECT_IO_ALLOW_MMAP. The corresponding kernel patches just did not land yet.
2024-01-10Add in rename to FUSE_DIRECT_IO_ALLOW_MMAPBernd Schubert-4/+6
Add in the rename of FUSE_DIRECT_IO_RELAX to FUSE_DIRECT_IO_ALLOW_MMAP.
2024-01-10Synchronize fuse_kernel.h from current linux masterBernd Schubert-1/+62
2023-11-19Clarify fuse_lowlevel poll() docstring (#862)George Hilliard-7/+10
The original docstring was confusing; it was not clear that the ph must be retained indefinitely, nor was it clear that the client *also* needs to reply to the poll call immediately. Clarify this by explaining that it is only necessary to retain a single handle, that the client must retain ph, and that it must immediately call reply.
2023-10-28Update fuse_common.h (#855)Caian Benedicto-1/+1
2023-10-09Fixes typo in fuse.h (#844)Nikola Petrov-1/+1
2023-08-08Released fuse-3.16.1Nikolaus Rath-1/+1
2023-06-30Make expire only function fail if no kernel support (#789)HereThereBeDragons-15/+15
2023-06-29Clarify behavior of fuse_session_exit().Nikolaus Rath-3/+6
2023-06-09Released 3.15.0Nikolaus Rath-1/+1
2023-05-12Do not pass unsupported mount options to the kernel.Nikolaus Rath-0/+6
The filesystem daemon is responsible for implementing eg. st_atime updates, so passing options like relatime to the kernel results in them being silently ignored. Instead, such options need to be interpreted (and filtered out) by the filesystem daemon.
2023-04-11Update fuse_kernel.h to state of linux-6.3Bernd Schubert-13/+244
This syncs fuse_kernel.h to <linux-6.3>/include/uapi/linux/fuse.h Special handling is done for setxattr as in linux commit 52a4c95f4d24b struct fuse_setxattr_in was extended. Extended struct is only used when FUSE_SETXATTR_EXT is passed in FUSE_INIT reply.
2023-04-11Fix doxygen warning about parameter nameMatthias Goergens-1/+1
Before: ``` $ doxygen doc/Doxyfile /Users/matthias/prog/fuser/libfuse/include/fuse.h:934: warning: argument 'private_data' of command @param is not found in the argument list of fuse_new_31(struct fuse_args *args, const struct fuse_operations *op, size_t op_size, void *user_data) /Users/matthias/prog/fuser/libfuse/include/fuse.h:934: warning: The following parameter of fuse_new_31(struct fuse_args *args, const struct fuse_operations *op, size_t op_size, void *user_data) is not documented: parameter 'user_data' ```
2023-04-06Fix MS_LAZYTIME not defined on uclibc and move all MS_* and UMOUNT_* (#753)Giulio Benetti-0/+42
as well as <sys/mount.h> inclusion to new fuse_mount_compat.h file. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
2023-03-29Fix typos and configure spellcheck for PRsYaroslav Halchenko-2/+2
2023-03-26Revert "upgrade of fuse_kernel.h based on Miklos expire_only kernel patch ↵Nikolaus Rath-190/+11
https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/commit/?h=for-next&id=53e949edb7692dce02220eba926c9d75ecbb47f7" This reverts commit 7f430a39db5a30979d75a906af891a38ebce1a3c because it breaks setxattr(). Fixes: #730
2023-03-03Enable parallel direct writes on the same file.Dharmendra singh-3/+22
Right now fuse kernel serializes direct writes on the same file. This serialization is good for such FUSE implementations which rely on the inode lock to avoid any data inconsistency issues but it hurts badly such FUSE implementations which have their own mechanism of dealing with cache/data integrity and can handle parallel direct writes on the same file. This patch allows parallel direct writes on the same file to be enabled with the help of a flag FOPEN_PARALLEL_DIRECT_WRITES. FUSE implementations which want to use this feature can set this flag during fuse init. Default behaviour remains same i.e no parallel direct writes on the same file. Corresponding fuse kernel patch(Merged). https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.2&id=153524053bbb0d27bb2e0be36d1b46862e9ce74c
2023-03-01Update description of keep_cache.Nikolaus Rath-5/+4
2023-02-17Released 3.14.0Nikolaus Rath-1/+1
2023-02-09fuse_lowlevel.h: add more setattr flagsXiubo Li-0/+8
Such as for the xfstest-dev's generic/684 test case it will clear suid and sgid if the fallocate request is commited by an unprivileged user. The kernel fuse passed the ATTR_KILL_SUID/ATTR_KILL_SGID flags to userspace but it will be dropped. Signed-off-by: Xiubo Li <xiubli@redhat.com>
2023-02-09Split config.h into private and public configBernd Schubert-7/+12
This addresses https://github.com/libfuse/libfuse/issues/729 commit db35a37def14b72181f3630efeea0e0433103c41 introduced a public config.h (rename to fuse_config.h to avoid conflicts) that was installed with the package and included by libfuse users through fuse_common.h. Probablem is that this file does not have unique defines so that they are unique to libfuse - on including the file conflicts with libfuse users came up. In principle all defines could be prefixed, but then most of them are internal for libfuse compilation only. So this splits out publically required defines to a new file 'libfuse_config.h' and changes back to include of "fuse_config.h" only when HAVE_LIBFUSE_PRIVATE_CONFIG_H is defined. This also renames HAVE_LIBC_VERSIONED_SYMBOLS to LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS, as it actually better explains for libfuse users what that variable is for.
2023-01-28Install a the configure_file (config.h) and use in headersBernd Schubert-0/+1
This addresses: https://github.com/libfuse/libfuse/issues/724 HAVE_LIBC_VERSIONED_SYMBOLS configures the library if to use versioned symbols and is set at meson configuration time. External filesystems (the main target, actually) include fuse headers and the preprocessor then acts on HAVE_LIBC_VERSIONED_SYMBOLS. Problem was now that 'config.h' was not distributed with libfuse and so HAVE_LIBC_VERSIONED_SYMBOLS was never defined with external tools and the preprocessor did the wrong decision. This commit also increases the the minimal meson version, as this depends on meson feature only available in 0.50 <quote 'meson' > WARNING: Project specifies a minimum meson_ version '>= 0.42' but uses features which were added in newer versions: * 0.50.0: {'install arg in configure_file'} </quote> Additionally the config file has been renamed to "fuse_config.h" to avoid clashes - 'config.h' is not very specific.
2023-01-15use off_t over __off64_tpsykose-4/+4
when -D_FILE_OFFSET_BITS=64 is defined, the off_t type is 64 bits wide already. the fuse_common.h header already checks for this, and errors when it is not, so be consistent with all the other uses of off_t. some libcs like musl do not have a 32-bit off_t type, and don't define __off64_t.
2023-01-13Released 3.13.0Nikolaus Rath-1/+1
2023-01-10Support application-defined I/O functions for FUSE fdTofik Sonono-0/+41
The io for FUSE requests and responses can now be further customized by allowing to write custom functions for reading/writing the responses. This includes overriding the splice io. The reason for this addition is that having a custom file descriptor is not sufficient to allow custom io. Different types of file descriptor require different mechanisms of io interaction. For example, some file descriptor communication has boundaries (SOCK_DGRAM, EOF, etc...), while other types of fd:s might be unbounded (SOCK_STREAMS, ...). For unbounded communication, you have to read the header of the FUSE request first, and then read the remaining packet data. Furthermore, the one read call does not necessarily return all the data expected, requiring further calls in a loop.
2023-01-06adding comments and capability discovery, enum for flags moved to top of fileHereThereBeDragons-4/+52
2023-01-06upgrade of fuse_kernel.h based on Miklos expire_only kernel patch ↵HereThereBeDragons-11/+190
https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/commit/?h=for-next&id=53e949edb7692dce02220eba926c9d75ecbb47f7
2023-01-06Initial patch provided by Miklos Szeredi <mszeredi@redhat.com>HereThereBeDragons-1/+15
2023-01-04Fixes when HAVE_LIBC_VERSIONED_SYMBOLS is not definedBernd Schubert-0/+12
fuse_loop_mt and fuse_new had not been defined when HAVE_LIBC_VERSIONED_SYMBOLS had not been set and additionally, fuse_new_31 was missing in the version script and was therefore an unusable symbol. This also adds a test for unset HAVE_LIBC_VERSIONED_SYMBOLS.
2023-01-04convert __APPLE__ and __ULIBC__ to HAVE_LIBC_VERSIONED_SYMBOLSBernd Schubert-2/+2
In fact only gnu-libc fully supports symbol versioning, so it is better to have a generic macro for it. This also allows to manually disable symbol version and allows to run tests with that configuration on gnu-libc. That testing will still not catch compat issues, but least ensures the code can compile. Testing for __APPLE__ and __ULIBC__ is now done by meson. More of such checks can be added by people using other libcs.
2023-01-02Revert "libfuse custom communication interface"Nikolaus Rath-19/+0
This reverts commit 777663953382925c7403f0560c28ec9bbd14d7be.
2022-11-15libfuse custom communication interfacey-0/+19
libfuse can now be used without having a mount interface.
2022-09-04fuse_session_loop_mt: Accept a NULL config - use defaultsBernd Schubert-1/+1
If an application does not want to bother with the session and wants to keep defaults, it can now just pass a NULL as config parameter.
2022-09-04fuse-loop/fuse_do_work: Avoid lots of thread creations/destructionsBernd Schubert-3/+30
On benchmarking metadata operations with a single threaded bonnie++ and "max_idle_threads" limited to 1, 'top' was showing suspicious 160% cpu usage. Profiling the system with flame graphs showed that an astonishing amount of CPU time was spent in thread creation and destruction. After verifying the code it turned out that fuse_do_work() was creating a new thread every time all existing idle threads were already busy. And then just a few lines later after processing the current request it noticed that it had created too many threads and destructed the current thread. I.e. there was a thread creation/destruction ping-pong. Code is changed to only create new threads if the max number of threads is not reached. Furthermore, thread destruction is disabled, as creation/destruction is expensive in general. With this change cpu usage of passthrough_hp went from ~160% to ~80% (with different values of max_idle_threads). And bonnie values got approximately faster by 90%. This is a with single threaded bonnie++ bonnie++ -x 4 -q -s0 -d <path> -n 30:1:1:10 -r 0 Without this patch, using the default max_idle_threads=10 and just a single bonnie++ the thread creation/destruction code path is not triggered. Just one libfuse and one application thread is just a corner case - the requirement for the issue was just n-application-threads >= max_idle_threads. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2022-09-04API update for fuse_loop_config additionsBernd Schubert-20/+69
struct fuse_loop_config was passed as a plain struct, without any version identifer. This had two implications 1) Any addition of new parameters required a FUSE_SYMVER for fuse_session_loop_mt() and fuse_loop_mt() as otherwise a read beyond end-of previous struct size might have happened. 2) Filesystems also might have been recompiled and the developer might not have noticed the struct extensions and unexpected for the developer (or people recomliling the code) uninitialized parameters would have been passed. Code is updated to have struct fuse_loop_config as an opaque/private data type for file systems that want version 312 (FUSE_MAKE_VERSION(3, 12)). The deprecated fuse_loop_config_v1 is visible, but should not be used outside of internal conversion functions File systems that want version >= 32 < 312 get the previous struct (through ifdefs) and the #define of fuse_loop_mt and fuse_session_loop_mt ensures that these recompiled file systems call into the previous API, which then converts the struct. This is similar to existing compiled applications when just libfuse updated, but binaries it is solved with the FUSE_SYMVER ABI compact declarations. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2022-05-02Released 3.11.0Nikolaus Rath-1/+1
2022-04-20patch: document ignored fill parameter of readdirAndré Schröder-0/+7
2022-04-17Add missing kernel flags up to 1ULL << 33Bernd Schubert-0/+8
Just a further sync with the in-kernel flags.
2022-04-08Modify structures in libfuse to handle flags beyond 32 bits.Dharmendra Singh-2/+6
In fuse kernel, 'commit 53db28933e95 ("fuse: extend init flags")' made the changes to handle flags going beyond 32 bits but i think changes were not done in libfuse to handle the same. This patch prepares the ground in libfuse for incoming FUSE kernel patches (Atomic open + lookup) where flags went beyond 32 bits. It makes struct same as in fuse kernel resulting in name change of few fields.
2022-01-03Add no_rofd_flush mount optionAmir Goldstein-0/+8
To disable flush for read-only fd. Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2022-01-03Add support for FOPEN_NOFLUSH flagAmir Goldstein-1/+7
Allow requesting from kernel to avoid flush on close at file open time. If kernel does not support FOPEN_NOFLUSH flag, the request will be ignored. For passthrough_hp example, request to avoid flush on close when writeback cache is disabled and file is opened O_RDONLY. Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-12-12Document possible NULL paths when directories are removed (#633)Maximilian Heinzler-0/+6
When directories with open handles are removed, the releasedir and fsyncdir operations might be called with a NULL path. That is because there is no hiding behavior like for regular files and the nodes get removed immediately.
2021-05-19Define FUSE_USE_VERSION in Doxygen. (#608)Junichi Uekawa-5/+5
We currently do not pass anything in PREDEFINED and that means FUSE_USE_VERSION is undefined. Add that definition so that Doxygen built-in C pre-processor can use FUSE_USE_VERSION value to find the correct comment to parse.
2021-05-07Fix doxygen warnings. (#600)Junichi Uekawa-14/+17
Some parameters were undocumented, and @file does not mean to expand current file name.
2021-04-23Add missing exceptions to fuse_reply_err() documentation. (#597)Manuel Jacob-1/+1
Co-authored-by: Manuel Jacob <test>
2021-03-30Fix typo in fuse_lowlevel.h (#593)Tobias Nießen-1/+1
2021-03-25Fix typos (#592)Andrew Gaul-5/+5