aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuse_versionscript
AgeCommit message (Collapse)AuthorLines
2025-08-22Allow applications to retrieve the req payload (io-uring only)Bernd Schubert-0/+1
With io-uring the req owns the payload buffer, the application can directly access it and copy data into it. fuse_buf_copy_one() already has a check for dstmem == srcmem and skips data copies. fuse_reply_data fuse_reply_data_uring fuse_buf_copy fuse_buf_copy_one Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-07-16Add statx supportJoanne Koong-0/+3
This commit adds libfuse support for FUSE_STATX requests on linux distributions. Currently, statx is only supported on linux. To make the interface a ergonomic as possible (eg using native 'struct statx' vs 'struct fuse_statx'), this implementation gates the 'struct statx' changes by #ifdef linux. Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
2025-06-18fuse: add support to FUSE_NOTIFY_INC_EPOCHLuis Henriques-0/+1
This patch adds support for the FUSE INC_EPOCH notify. This new operation simply increments the FUSE connection epoch value, allowing to invalidate all the dentries next time they are revalidated. Signed-off-by: Luis Henriques <luis@igalia.com>
2025-05-20conn->want conversion: Fix fuse_apply_conn_info_opts()Bernd Schubert-0/+6
fuse_apply_conn_info_opts() was applying to 'want_ext', which would cause conflicts with 'want' if the application applied its own flags to 'conn->want'. Solution is: - to move fuse_{set,unset,get}_feature_flag and convert_to_conn_want_ext() to fuse_lowlevel.c and to define them as part of the public API, although convert_to_conn_want_ext() should not be used - it is currently needed to be a public function due as it needs to be defined for the tests. Related to https://github.com/libfuse/libfuse/issues/1171 and https://github.com/libfuse/libfuse/pull/1172. Closes: https://github.com/libfuse/libfuse/issues/1171 Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add fuse_req_is_uring() to check if a req comes through io-uringBernd Schubert-0/+5
This might be useful to optimize code paths. For example, with io-uring the request buffer is valid until the request is replied to, while without io-uring the request buffer is only valid in current thread context. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-02-10fuse_new version fixes: Change to fuse_new_versionedBernd Schubert-3/+2
Another additon for https://github.com/libfuse/libfuse/issues/1092 Use _fuse_new_versioned() instead of _fuse_new_317 and actually also remove symbol versioning for it - we don't need it. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-02-09Rename to fuse_session_new_versionedBernd Schubert-1/+1
Similar previous renames to fuse_main_real_versioned, but here for the low level fuse_session_new. Also remove symbol versioned as part of "fuse_session_new" as that function is not part of the official API/ABI and to allow easier access with dlopen/dlsym. Also switch back to a macro fuse_session_new, just in case some code has some expectations on that. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-02-09Make fuse_main a macro again and wrap that to fuse_main_fnBernd Schubert-1/+1
As suggested by Bill in Issue #1092 make fuse_main a macro again, just in case some applications expect it to be a macro. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-01-06Make fuse_main_real() not symboledBernd Schubert-1/+1
Addresses https://github.com/libfuse/libfuse/issues/1092 We actually don't need to make fuse_main_real() symboled, as it is not part of the official API. The inlined function now always calls into fuse_main_real_317 and the compat ABI function (which should also be available for dlopen/dlsym) is now always compiled, independent if the compiler/linker support versioned symbols. Additionally, fuse_main_real() is also declared as inlined function and a warning message is created when that function is called. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-01-06Avoid global declarion of internal functions that are new in 3.17Bernd Schubert-2/+2
_fuse_new() is not supposed to be called by external users outside of internal functions or static inlined functions. This also removes several functions from lib/fuse_versionscript which where added and exported by commit 58f85bfa9b7d ("Add in the libfuse version a program...) as these are libfuse internal only. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-07-14Add syslog and fatal signal handler featureBernd Schubert-0/+3
I see random ENOTCONN failures in xfstest generic/013 and generic/014 in my branch, but earliest on the 2nd run - takes ~12hours to get the issue, but then there are no further information logged. ENOTCONN points to a daemon crash - I need backtraces and a core dump. This adds optional handling of fatal signals to print a core dump and optional syslog logging with these new public functions: fuse_set_fail_signal_handlers() In addition to the existing fuse_set_signal_handlers(). This is not enabled together with fuse_set_signal_handlers(), as it is change in behavior and file systems might already have their own fatal handlers. fuse_log_enable_syslog Print logs to syslog instead of stderr fuse_log_close_syslog Close syslog (for now just does closelog()) Code in fuse_signals.c is also updated, to be an array of signals, and setting signal handlers is now down with a for-loop instead of one hand coded set_one_signal_handler() per signal.
2024-06-01Fix compatibility issue around fuse_custom_io->clone_fd (#953)legezywzh-0/+2
Fixes: 73cd124d0408 ("Add clone_fd to custom IO (#927)") Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
2024-05-13Enable passthrough mode for read/write operations (#919)Amir Goldstein-0/+2
Add support for filesystem passthrough read/write of files. When the FUSE_PASSTHROUGH capability is enabled, the FUSE server may decide, while handling the "open" or "create" requests, if the given file can be accessed by that process in "passthrough" mode, meaning that all the further read and write operations would be forwarded by the kernel directly to the backing file rather than to the FUSE server. All requests other than read or write are still handled by the server. This allows for an improved performance on reads and writes, especially in the case of reads at random offsets, for which no (readahead) caching mechanism would help, reducing the performance gap between FUSE and native filesystem access. Extend also the passthrough_hp example with the new passthrough feature. This example opens a kernel backing file per FUSE inode on the first FUSE file open of that inode and closes the backing file on the release of the last FUSE file on that inode. All opens of the same inode passthrough to the same backing file. A combination of fi->direct_io and fi->passthrough is allowed. It means that read/write operations go directly to the server, but mmap is done on the backing file. This allows to open some fds of the inode in passthrough mode and some fd of the same inode in direct_io/passthrough_mmap mode. Signed-off-by: Alessio Balsini <balsini@android.com> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2024-05-13Add in the libfuse version a program was compiled with (#942)Bernd Schubert-0/+9
The API stays the same, the libfuse version comes from inlined functions, which are defined fuse_lowlevel.h and fuse.h. As these inlined functions are defined in the header files they get added into the application, similar as if these were preprocessor macros. Macro vs inlined function is then just a style issue - I personally prefer the latter. fuse_session_new() -> static inlinei, in the application _fuse_session_new -> inside of libfuse fuse_new() -> static inline, in the application _fuse_new() -> inside of libfuse Note: Entirely untested is the fuse 30 api - we need a test for it. And we do not have any ABI tests at all. Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
2023-07-07Allow linking with mold / fix the version script (#814)Bernd Schubert-2/+0
This fixes issue https://github.com/libfuse/libfuse/issues/810 and should avoid mold linking errors. Commit d4e294b removed made fuse_register_module() a static function, but forgot to remove it from the version script. Commit fe4f942 introduced copy_file_range to libfuse and added the non-exiting (neither declared nor defined) function fuse_reply_copy_file_range() to the version script. Kernel side just exects an integer reply how much was copied, using fuse_reply_write() as in fuse_lib_copy_file_range() is sufficient and no extra function is needed. Co-authored-by: Bernd Schubert <bschubert@ddn.com>
2023-01-10Support application-defined I/O functions for FUSE fdTofik Sonono-0/+1
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-06Initial patch provided by Miklos Szeredi <mszeredi@redhat.com>HereThereBeDragons-0/+1
2023-01-04Fixes when HAVE_LIBC_VERSIONED_SYMBOLS is not definedBernd Schubert-0/+1
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-02Revert "libfuse custom communication interface"Nikolaus Rath-1/+0
This reverts commit 777663953382925c7403f0560c28ec9bbd14d7be.
2022-11-15libfuse custom communication interfacey-0/+1
libfuse can now be used without having a mount interface.
2022-09-04fuse-loop/fuse_do_work: Avoid lots of thread creations/destructionsBernd Schubert-0/+4
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-0/+14
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>
2020-08-09Define fuse_session_loop_mt as a macro on uclibc and MacOS (#532)asafkahlon-0/+1
On uclibc and MacOS we don't use versioned symbols. Hence, there's no definition for fuse_session_loop_mt on those cases and the linker won't be able to resolve calls to fuse_session_loop_mt() Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
2020-01-02Fixed an issue with the linker version script. (#483)Bill Zissimopoulos-1/+1
Fixes #467.
2019-11-03Implement lseek operation (#457)Yuri Per-0/+2
2019-09-10log: move fuse_log() to the public header fileStefan Hajnoczi-0/+6
Applications may wish to call fuse_log() for unified logging. This way they don't need to define their own wrappers to invoke the log message handler function installed by fuse_set_log_func(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-11-19libfuse: add copy_file_range() supportNiels de Vos-0/+6
Add support for the relatively new copy_file_range() syscall. Backend filesystems can now implement an efficient way of cloning/duplicating data ranges within files. See 'man 2 copy_file_range' for more details.
2018-10-09Add unprivileged option in `mount.fuse3`Mattias Nissler-0/+5
The unprivileged option allows to run the FUSE file system process without privileges by dropping capabilities and preventing them from being re-acquired via setuid / fscaps etc. To accomplish this, mount.fuse sets up the `/dev/fuse` file descriptor and mount itself and passes the file descriptor via the `/dev/fd/%u` mountpoint syntax to the FUSE file system.
2017-09-19Fix versioned symbols in version scriptNikolaus Rath-1/+4
According to "How to Write Shared Libraries" by Ulrich Drepper (https://www.akkadia.org/drepper/dsohowto.pdf), the version script should contain the exported name of the versioned symbol once in each tag for which it has been defined by .symver.
2017-08-24Add idle_threads mount option.Joseph Dodge-0/+6
2017-08-24Allow inode cache invalidation in high-level APISławek Rudnicki-0/+1
We re-introduce the functionality of invalidating the caches for an inode specified by path by adding a new routine fuse_invalidate_path. This is useful for network-based file systems which use the high-level API, enabling them to notify the kernel about external changes. This is a revival of Miklos Szeredi's original code for the fuse_invalidate routine.
2017-07-08Added public fuse_lib_help(), bumped minor versionNikolaus Rath-0/+6
2017-05-25Remove fuse_fs_fgetattr and fuse_fs_ftruncate from linker scriptpablomh-2/+0
They were removed from source here: https://github.com/libfuse/libfuse/commit/73b6ff4b75cf1228ea61262c293fcb2fda5dfeea
2016-10-17Update linker scriptNikolaus Rath-2/+2
- Fixes commit d49f2e77b4. - Fixes commit 199fc0f833. - Thanks to Github user mtheall for the review!
2016-10-09fuse_parse_cmdline(): do not print help/version textNikolaus Rath-0/+1
The current behavior makes it difficult to add help for additional options. With the change, this becomes a lot easier.
2016-10-09Added missing export of fuse_pkgversion.Nikolaus Rath-0/+1
2016-10-02Added fuse_session_fd()Nikolaus Rath-0/+1
Fixes #59.
2016-10-02Don't handle --help and --version in fuse_session_new().Nikolaus Rath-0/+4
Help and version messages can be generated using the new fuse_lowlevel_help(), fuse_lowlevel_version(), fuse_mount_help(), and fuse_mount_version() functions. The fuse_parse_cmdline() function has been made more powerful to do this automatically, and is now explicitly intended only for low-level API users. This is a code simplication patch. We don't have to parse for --help and --version in quite as many places, and we no longer have a low-level initialization function be responsible for the (super-high level) task of printing a program usage message. In the high-level API, we can now handle the command line parsing earlier and avoid running other initialization code if we're just going to abort later on.
2016-10-02Turn struct fuse_chan into an implementation detailNikolaus Rath-5/+0
The only struct fuse_chan that's accessible to the user application is the "master" channel that is returned by fuse_mount and stored in struct fuse_session. When using the multi-threaded main loop with the "clone_fd" option, each worker thread gets its own struct fuse_chan. However, none of these are available to the user application, nor do they hold references to struct fuse_session (the pointer is always null). Therefore, any presence of struct fuse_chan can be removed without loss of functionality by relying on struct fuse_session instead. This reduces the number of API functions and removes a potential source of confusion (since the new API no longer looks as if it might be possible to add multiple channels to one session, or to share one channel between multiple sessions). Fixes issue #17.
2016-10-02Renamed fuse_lowlevel_new() to fuse_session_new().Nikolaus Rath-1/+1
2016-10-02Introduce separate mount/umount functions for low-level API.Nikolaus Rath-0/+2
2016-10-02Tell emacs to use tabs for linkerscript.Nikolaus Rath-0/+4
2013-06-21libfuse: remove fuse_chan_bufsize()Miklos Szeredi-1/+0
Remove fuse_chan_bufsize() from the lowlevel API. fuse_session_receive_buf() is now responsible for allocating memory for the buffer.
2013-06-21libfuse: clean up fuse_chanMiklos Szeredi-4/+0
Clean up fuse_chan related interfaces. Remove the following from the lowlevel library API: struct fuse_chan_ops; fuse_chan_new(); fuse_chan_session(); fuse_chan_recv(); fuse_chan_send();
2013-06-21libfuse: clean up fuse_sessionMiklos Szeredi-3/+0
Clean up fuse_session related interfaces. Remove the following from the lowlevel library API: struct fuse_session_ops; fuse_session_new(); fuse_session_process(); fuse_session_data();
2013-06-21libfuse: replace fuse_session_next_chanMiklos Szeredi-1/+1
Replace fuse_session_next_chan() with fuse_session_chan(), as multiple channels per session were never actually supported and probably never will.
2013-06-20libfuse: remove channel user dataMiklos Szeredi-1/+0
2013-02-22remove real fuse_main() symbolMiklos Szeredi-1/+0
2013-02-22clean fuse_chan_receive from versionscriptMiklos Szeredi-1/+0
2013-02-08libfuse: remove deprecated fuse_lowlevel_is_lib_option()Miklos Szeredi-1/+0