Age | Commit message (Collapse) | Author | Lines |
|
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>
|
|
Add header guards, include system headers as needed, and declare
helper functions as inline.
This ensures that the helper header could be properly included.
Signed-off-by: CismonX <admin@cismon.net>
|
|
Move fallocate implementation to passthrough_helpers.h, so that
it could be reused by multiple passthrough examples.
Signed-off-by: CismonX <admin@cismon.net>
|
|
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
|
|
passthrough example supports the --plus command line argument to reply
to readdirplus with fill_dir_plus and unspecified (0) fill offsets.
As explained in this comment:
https://github.com/libfuse/libfuse/pull/896#issuecomment-1978917041
passthrough example needs a few more changes to be able to test commit
dd95d13a ("fix readdirplus when filler is called with zero offset (#896))
With the changes in this commit, readdirplus without fill offsets
can be tested to verify the readdirplus fix above with command line:
passthrough --plus -o auto_cache,modules=subdir,subdir=/src /mnt
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
|
|
Shared locks (parallel_direct_writes) cannot be enabled for O_DIRECT, as
O_DIRECT may be set past file open time with fcntl(fd, F_SETFD, ...).
Kernel side fuse has precautions for shared lock direct-IO (direct_io in
libfuse), as it needs an exclusive inode lock when direct and page cache
IO happend at the same time.
In order to enjoy the parallel_direct_writes feature (i.e., get a shared
lock, not exclusive lock) for writes to the same file), direct_io is needed.
The feature direct_io is corresponding to FOPEN_DIRECT_IO in fuse kernel.
FOPEN_DIRECT_IO and O_DIRECT are not entirely the same as described above.
So enable direct_io (i.e., FOPEN_DIRECT_IO in fuse kernel) to enjoy parallel
direct_writes.
Some patches related to FOPEN_DIRECT_IO and O_DIRECT are below:
https://lore.kernel.org/all/753d6823-e984-4730-a126-d66b65ea772c@ddn.com
|
|
Move the parallel_direct_writes enable action to the init function in high level API,
it is more recommended just like commit 8ee553dac. Besides, add some comments to show
that the feature parallel_direct_writes is depend on the feature direct_io (refer to
kernel side patch series to consolidate direct IO, link: https://lwn.net/ml/linux-fsdevel/
20230918150313.3845114-1-bschubert@ddn.com for the reason).
|
|
All these passthrough examples don't need writes to be serialized.
Actually, most file systems probably handle non serialized parallel
direct writes - the FOPEN_PARALLEL_DIRECT_WRITES flag is just
to avoid a regression for those file system that rely on serialized
DIO writes in fuse kernel. Passthrough file system forward the IO
to another file system, which actually handles that internally -
serialized in fuser kernel is not needed.
|
|
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.
|
|
When not using the readdir_plus mode, the d_type was not returned,
and the use_ino flag was not used for returning d_ino.
This patch fixes the returned values for d_ino and d_type by readdir(3)
The test for the returned value of d_ino has been adjusted to also
take the d_type into consideration and to check the returned values in
both basic readdir and readdir_plus modes. This is done by executing
the passthrough test twice.
Co-authored-by: Jean-Pierre André <jpandre@users.sourceforge.net>
|
|
- Test added for all passthrough examples.
- passthrough.c uses offset==0 mode. The others don't.
- passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass.
- This fixes #583.
|
|
Only close the file descriptors if they were just opened. Otherwise,
the second FUSE_COPY_FILE_RANGE operation on any given file will fail
with EBADF.
|
|
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>
|
|
|
|
|
|
FreeBSD doesn't allow creating sockets using mknod(2). Instead, one has to use socket(2)
and bind(2). Add appropriate logic to the examples and add a test case.
|
|
The passthrough example filesystem can be used for validating the API
and the implementation in the FUSE kernel module.
|
|
|
|
This reverts commit 179fa13b40387645e722089873079488f9dbe3d8.
|
|
|
|
This allows calls like open(file, O_CREAT|O_RDONLY, 0200) which would
otherwise fail because we cannot open the file after mknod() has
created it with 0200 permissions.
|
|
No reason not to use it. May even be a little faster and will
consume less resources :-).
|
|
This allows truncating an open file even if write permission
was removed after open() (which is the expected behavior).
|
|
That way we can use the file descriptor for other operations.
|
|
Required for better hardlink handling, see comments in patch.
|
|
|
|
Fixes: #81.
|
|
Several options (use_ino, etc) depend on the file system
implementation. Allowing them to be set from the command line makes no
sense.
|
|
This obsoletes the ftruncate & fgetattr handlers.
Fixes #58.
|
|
Also, added more comments for the same purpose.
|