aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cuse_lowlevel.c
AgeCommit message (Collapse)AuthorLines
2025-06-27license: s/COPYING/GPL2.txt, s/COPYING.LIB/LGPL2.txtizxl007-1/+1
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
2025-04-28fuse_lowlevel: Add support for header/payload separationBernd Schubert-2/+9
Header/payload separation is part of the fuse-io-uring protocol and might be later on for /dev/fuse legacy communication as well. This is a preparation commit, for now fuse_ll_ops2 is unused. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2024-12-30Add 64-bit conn::{capable,want}_ext fieldsBernd Schubert-2/+4
The previous fields are left for ABI compatibility, although it is not beautiful to add that complexity when we have to increase the so-version as we had ABI breakage anyway. example/printcap is simplified to use an array, as every line would have needed to be modified anyway. Missing 'FUSE_CAP_PASSTHROUGH' was added. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2023-01-28Install a the configure_file (config.h) and use in headersBernd Schubert-1/+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.
2022-09-04API update for fuse_loop_config additionsBernd Schubert-4/+3
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>
2019-11-20fix memleak in cuse_lowlevel_setup (#472)Tomasz Kulasek-0/+1
Local variable args is not freed on cuse_lowlevel_setup success. Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
2019-09-04Introduce callback for loggingStefan Hajnoczi-15/+15
Introduce an API for custom log handler functions. This allows libfuse applications to send messages to syslog(3) or other logging systems. See include/fuse_log.h for details. Convert libfuse from fprintf(stderr, ...) to log_fuse(level, ...). Most messages are error messages with FUSE_LOG_ERR log level. There are also some debug messages which now use the FUSE_LOG_DEBUG log level. Note that lib/mount_util.c is used by both libfuse and fusermount3. Since fusermount3 does not link against libfuse, we cannot call fuse_log() from lib/mount_util.c. This file will continue to use fprintf(stderr, ...) until someone figures out how to split it up. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-05-05Fixed type of ioctl command parameter.Nikolaus Rath-3/+3
2017-09-19Don't use external symbol names in internal filesNikolaus Rath-1/+1
The fuse_session_loop_mt() and fuse_loop_mt() symbols are only visible when linking against the shared object. The code in lib/, however, is compiled *into* the shared object and should thus use the internal names of these functions. Surprisingly enough, the code still worked before - but only when link time optimization was disabled. Unfortunately, we still can't compile with LTO because it seems that enabling LTO somehow makes the tagged symbols vanish. Without lto, we have: $ nm lib/libfuse3.so | grep fuse_new 0000000000011070 T fuse_new_30 0000000000010a00 t fuse_new_31 0000000000011070 T fuse_new@FUSE_3.0 0000000000010a00 T fuse_new@@FUSE_3.1 and with LTO: $ nm lib/libfuse3.so | grep fuse_new 0000000000019a70 T fuse_new_30 0000000000019270 t fuse_new_31 See also issue #198.
2017-08-24Add idle_threads mount option.Joseph Dodge-2/+6
2016-10-25Use "se" instead of "f" for struct fuse_sessionNikolaus Rath-16/+16
The fuse_session pointer is sometimes called f and at other times se. The former is an artifact from the time when there still was a separate struct fuse_ll object. For consistency and to easy maintenance, this patch changes the name of the fuse_session pointer to "se" wherever possible. This patch was generated by the following Coccinelle script: @@ symbol f, se; @@ struct fuse_session * -f +se ; <... -f +se ...> @@ expression expr; @@ struct fuse_session * -f +se = expr; <... -f +se ...> @@ identifier fn; @@ fn(...,struct fuse_session * -f +se ,...) { <... -f +se ...> } Due to its complexity, the do_init() function had to be commented out and then patched manually.
2016-10-13Make -o clone_fd into a parameter of session_loop_mt().Nikolaus Rath-1/+1
This option really affects the behavior of the session loop, not the low-level interface. Therefore, it does not belong in the fuse_session object.
2016-10-04Merge fuse_ll into fuse_session (part 6)Nikolaus Rath-3/+1
Fixup cuse_lowlevel_new().
2016-10-04Merge fuse_ll into fuse_session (part 3)Nikolaus Rath-1/+1
Replace se->f with se.
2016-10-04Merge fuse_ll into fuse_session (part 2)Nikolaus Rath-2/+2
Replaced all references to req->f with req->se.
2016-10-04Merge fuse_ll into fuse_session (part 1)Nikolaus Rath-2/+2
Merged the structures, and replaced fuse_ll with fuse_session in all type definitions.
2016-10-03Merge master fuse_chan into fuse_session.Nikolaus Rath-9/+1
This is a code simplification patch. - It confines most of the implementation channel implementation into fuse_loop_mt (which is its only user). - It makes it more obvious in the code that channels are only ever used when using -o clone_fd and multi-threaded main loop. - It simplies the definition of both struct fuse_session and struct fuse_chan. - Theoretically it should result in (minuscule) performance improvements when not using -o clone_fd. - Overall, it removes a lot more lines of source code than it adds :-).
2016-10-02Don't handle --help and --version in fuse_session_new().Nikolaus Rath-12/+11
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-02Renamed fuse_lowlevel_new() to fuse_session_new().Nikolaus Rath-1/+1
2016-03-11cuse_lowlevel.setup(): fix double free of local variable 'args'Winfried Koehler-7/+9
Signed-off-by: Winfried Koehler <w_scan@gmx-topmail.de>
2013-07-24libfuse: remove "-D_FILE_OFFSET_BITS=64" from fuse.pcMiklos Szeredi-0/+1
add AC_SYS_LARGEFILE to your configure.ac instead.
2013-06-21libfuse: remove session and chan abstractionsMiklos Szeredi-2/+2
There's actually just one type of channel and session, so we don't need the generic callback functions.
2013-06-21libfuse: remove fuse_chan_bufsize()Miklos Szeredi-1/+1
Remove fuse_chan_bufsize() from the lowlevel API. fuse_session_receive_buf() is now responsible for allocating memory for the buffer.
2013-02-20cuse: clean includesMiklos Szeredi-1/+0
2012-07-19Remove compat functionsMiklos Szeredi-1/+1
2012-01-24Revert "Add mmap() and munmap() methods to low level API"Miklos Szeredi-26/+0
This partially reverts commit 4b2157c44e6ad7e692fcffb7450143e83151d36b. Remove mmap/munmap suppor as this missed the interface changes for Linux-3.3 (API version 7.18). Only revert the mmap/munmap bits and leave the retrieve_reply API fix in place as well as the optimization in fuse_send_data_iov_fallback().
2011-12-06Add mmap() and munmap() methods to low level APIMiklos Szeredi-0/+26
Currently this is only useful for CUSE. Also update retrieve_reply() method.
2010-08-27cuse: fix minor typos in error messagesMiklos Szeredi-4/+4
This basically was a %s/fuse:/cuse:/ to remove some apparent copy/paste errors. Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
2009-08-18* Add missing fuse_session_data to versionscriptMiklos Szeredi-3/+3
* Make sure all global symbols are prefixed with "fuse_" or "cuse_" * Released 2.8.0
2009-06-18CUSE patches from Tejun Heo (add new files)Miklos Szeredi-0/+371