47 Commits

Author SHA1 Message Date
Bernd Schubert 2ad90f04dc examples: enable io_uring single-issuer mode
These example filesystems always send their reply from the per-queue
io-uring worker thread. The ones that run a helper thread use it only
for cache-invalidation notifications over /dev/fuse, not ring
submissions, so they too satisfy the io_uring_single_issuer contract.

Call fuse_set_conn_flag(conn, FUSE_CONN_FLAG_SINGLE_ISSUER) in their
init() handlers so they take the lock-free, registered-ring-fd fast
path. It is harmless when io-uring is not in use.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2026-06-29 00:21:20 +02:00
izxl007 fc1c8da0cf license: s/COPYING/GPL2.txt, s/COPYING.LIB/LGPL2.txt
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
2025-06-27 09:47:00 +02:00
Bernd Schubert 3863da58b1 conn: prevent duplicate flag conversion in high-level interface
The high-level interface triggers flag conversion twice: once in the
high-level init and once in the low-level init. This caused false
"both 'want' and 'want_ext' are set" errors when using
fuse_set_feature_flag() or fuse_unset_feature_flag().

The existing check for duplicate conversion only worked when 32-bit
flags were set directly. When using the preferred flag manipulation
functions, conn->want and the lower 32 bits of conn->want_ext
would differ, triggering the error.

Fix this by synchronizing conn->want with the lower 32 bits of
conn->want_ext after conversion, ensuring consistent state for
subsequent calls.

Closes: https://github.com/libfuse/libfuse/issues/1171

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-16 13:48:42 +02:00
Bernd Schubert f68970cd23 fuse: Fix want flag conversion
32-bit conn->want flags been left to be ABI compatible to 3.10,
even though the so version was changed.
The more recent way is to use fuse_set_feature_flag(),
which will use conn->want_ext.

Given that we now have two flags (want and want_ext), we need
to convert and that brought several issues
- If the application sets conn->want, that needs to be set into
  the lower 32 bit of  conn->want_ext. As the application might
  actually unset values, it really has to be a copy and not
  just 'or' - fixed now.
- convert_to_conn_want_ext() actually needs to check for
  _modified_ conn->want and conn->want_ext
- convert_to_conn_want_ext() must consider being called from
  high and lowlevel interfact, with different want_ext_default
  and want_default values. It is only a failure, if the application
  changed both, conn->want and conn->want_ext. This function
  was failing in issue #1171, because high level fuse_fs_init()
  was changing values and then lowlevel do_init() was incorrectly
  failing on that.

This also adds a new test (test_want_conversion) and sets
values into example/{hello.c,hello_ll.c}

Also some more internal users of conn->want are converted to
fuse_{set,unset}_feature_flag().

Closes: https://github.com/libfuse/libfuse/issues/1171
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-03-24 09:38:06 +01:00
FredyVia c021e910a5 Add FUSE_FILL_DIR_DEFAULTS enum (#903)
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-03-20 16:08:04 +01:00
Dr. David Alan Gilbert 252e978c54 State GPL version in comment (#485)
IN a bunch of comments we say 'under the terms of the GNU GPL', make
it clear this is GPLv2 (as LICENSE says).

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-03-13 16:46:44 +00:00
zsugabubus 81ab7d8c8c examples: mark ops variables constant (#496) 2020-01-30 11:17:25 -05:00
Nikolaus Rath 59dc22b12f Don't segfault when called with -h.
Fixes: #327
2018-11-24 20:51:34 +00:00
Rostislav Skudnov a2a09e7cca example/{hello,null}: Fix memory leaks 2018-07-23 11:02:57 +01:00
Nikolaus Rath f750abb757 Removed unneccessary #include <config.h> from examples
Fixes: #208.
2017-09-25 10:17:11 +01:00
Nikolaus Rath e870a0427a Added public fuse_lib_help(), bumped minor version 2017-07-08 12:48:08 +02:00
guraga aa1460ff43 hello.c: don't use constant instead of magic number 2017-03-28 08:57:23 -07:00
Nikolaus Rath 7983414b33 Clean-up doxygen documentation
Fixes: #81.
2016-10-28 20:44:39 -07:00
Nikolaus Rath 8ee553dac0 fuse_new(): don't accept options that don't make sense for end-users
Several options (use_ino, etc) depend on the file system
implementation. Allowing them to be set from the command line makes no
sense.
2016-10-20 15:32:20 -07:00
Nikolaus Rath 73b6ff4b75 Pass fuse_file_info to getattr, chown, chmod, truncate, utimens handlers
This obsoletes the ftruncate & fgetattr handlers.

Fixes #58.
2016-10-15 18:46:27 -07:00
Nikolaus Rath b69192b629 fuse_main(): extend support for printing help
There's now a way to inhibit the "usage" line (which actually got lost
in commit 225c12aebf), which makes it easier for simply file-systems
to generate good-looking --help output.
2016-10-10 09:41:17 -07:00
Nikolaus Rath a1e1e8cdc4 Fixed permissions of source files. 2016-10-02 20:32:38 -07:00
Eric Wong 6bf2e6f07c libfuse: implement readdirplus for high-level API
Reuse the old "readdir" callback, but add a flags argument, that has
FUSE_READDIR_PLUS in case this is a "plus" version.  Filesystems can safely
ignore this flag, but if they want they can add optimizations based on it:
i.e. only retrieve the full attributes in PLUS mode.

The filler function is also given a flags argument and the filesystem can
set FUSE_FILL_DIR_PLUS if all the attributes in "stat" are valid.
2014-03-05 14:45:44 +01:00
Miklos Szeredi 0cb2db32e7 libfuse: fuse -> fuse3
Allow 2.X and 3.X to coexist.  Includes are now stored under
/usr/include/fuse3 and library is named libfuse3.*.  Invoke pkg-config with
"fuse3" as the first argument to build with version 3 of the library.
2013-07-25 16:54:42 +02:00
Miklos Szeredi e6e7a249c5 libfuse: remove "-D_FILE_OFFSET_BITS=64" from fuse.pc
add AC_SYS_LARGEFILE to your configure.ac instead.
2013-07-24 17:09:26 +02:00
Miklos Szeredi 7dfb43254c Documentation fixes 2013-07-17 15:58:53 +02:00
Joachim Schiele f4f87bba12 rewrote c++ style comments to c style coments mentioned by Miklos Szeredi 2013-07-02 17:37:38 +02:00
Joachim Schiele ea7227db43 - added a doxygen main page
- modified all examples to be included in doxygen
- modified the API documentation to have more details
- added the 490px_FUSE_structure.svg.png (c) wikipedia
2013-06-20 19:18:18 +02:00
Miklos Szeredi 2b4b5cc544 Start of 3.0 series
Change the version numbers.

This is going to be a new major version of the library breaking backward
compatibility on the binary level as well as the source level.
2012-07-19 18:40:11 +02:00
Miklos Szeredi 46b9c3326d Fix the compile command in the examples
Reported by Luciano Dalle Ore
2012-05-16 17:31:33 +02:00
Miklos Szeredi cdb8b79bad change indenting 2007-12-12 14:25:40 +00:00
Miklos Szeredi 611ad93ac7 update copyright dates 2007-04-25 16:19:15 +00:00
Miklos Szeredi 4a709fc98e cleanup 2007-03-30 16:32:12 +00:00
Miklos Szeredi 4003dfa313 Add init script 2006-10-01 13:46:02 +00:00
Miklos Szeredi 6f385414b2 fix 2006-03-17 15:05:40 +00:00
Miklos Szeredi 95da860d29 fix 2006-01-06 18:29:40 +00:00
Miklos Szeredi ab97456413 fix 2005-04-07 15:40:21 +00:00
Miklos Szeredi e5183747da whitespace fixes 2005-02-02 11:14:04 +00:00
Miklos Szeredi 149f60799d update copyright year 2005-01-10 12:29:28 +00:00
Miklos Szeredi fb28c5ebe1 API change 2004-11-26 12:15:06 +00:00
Miklos Szeredi d507c73e8f fix 2004-11-08 17:32:25 +00:00
Miklos Szeredi 8fb48feb50 getdir related API change 2004-11-08 14:48:52 +00:00
Miklos Szeredi 5dc8a80c65 cleanups + step minor version 2004-10-21 09:35:10 +00:00
Miklos Szeredi 891b874eed add fuse_invalidate() to library API 2004-07-29 09:27:49 +00:00
Miklos Szeredi 2e6b6f2be8 change email address 2004-07-07 19:19:53 +00:00
Miklos Szeredi e8663f383b code cleanup 2004-01-13 15:33:12 +00:00
Miklos Szeredi 5e43f2c00c added fsync operation 2003-12-12 14:06:41 +00:00
Miklos Szeredi c8ba2379a8 added release() callback 2002-12-10 12:26:00 +00:00
Miklos Szeredi 074b4b9232 minor fixes 2002-01-11 08:25:52 +00:00
Mark Glines d84b39ac42 Added statfs support to kernel, lib, examples, and perl
other minor perl fixes (still unstable)
2002-01-07 16:32:02 +00:00
Miklos Szeredi ba8ec88e0e minor fixes 2001-12-21 09:28:33 +00:00
Miklos Szeredi cc8c975f77 writing modules made more easy 2001-11-21 10:03:39 +00:00