Starting with kernel version 4.20 fuse supports a new property
'max_pages' which is the maximum number of pages that can be used per
request. This can be set via an argument during initialization.
This new property allows writes to be larger than 128k.
This patch sets the property if the matching capability is set
(FUSE_MAX_PAGES). It will also set max_write to 1MiB. Filesystems have
the possibility to decrease this size by setting max_write to a smaller
size. The max_pages and bufsize fields are adjusted accordingly.
Cc: Constantine Shulyupin <const@MakeLinux.com>
Signed-off-by: Markus Pargmann <scosu@quobyte.com>
A comment said that fuse_entry_param.generation must be non-zero.
However, I can't find anything in the kernel that requires that, and
real-world file systems don't seem to follow that advice, either.
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.
fuse.ko has supported FALLOC_FL_KEEP_SIZE and FALLOC_FL_PUNCH_HOLE at this
moment and more modes may be supported in the future.
fallocate(2) supports modes while posix_fallocate(2) does not, so this
makes lo_fallocate use fallocate(2) instead.
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
This constant is not defined in the kernel, so it will be lost when
fuse_kernel.h is not synchronized. Instead, the kernel just passes a
flag value of "1", so for now we also use a literal in userspace.
Instead of the Posix ioctl(2) command, Linux uses its own variant of ioctl()
in which the commands are requested as "unsigned long" and truncated to
32 bits by the fuse kernel module. Transmitting the commands to user space
file systems as "unsigned int" is a workaround for processing ioctl()
commands which do not fit into a signed int.
sprintf(3)/snprintf(3) destination buffers need to be large enough
so that gcc doesn't warn -Wformat-truncation= or -Wformat-overflow=
when source buffer size is 1024 bytes.
--
../test/test_syscalls.c:1445:47: warning: '%s' directive output may be truncated writing 1 byte into a region of size between 0 and 1023 [-Wformat-truncation=]
#define PATH(p) (snprintf(path, sizeof path, "%s/%s", testdir, p), path)
^~~~~~~
../test/test_syscalls.c:1458:19:
res = mkdir(PATH("a"), 0755);
~~~
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
cd to mountpoint's parent directory using unprivileged rather than
privileged access. This is to ensure that unmount works on mountpoints
where root may not have privileged access.
Fixes: #376
If hello_ll is invoked without a mountpoint, it will try to call
fuse_session_mount anyway with the NULL mountpoint (which then causes a
segfault). Print out a short help message instead (taken from
passthrough_ll.c).
lo_create() did not honour CACHE_NEVER in lo_create(), which has an effect
on how I/O is performed after the open.
The value of CACHE_ALWAYS, which results in setting fi->keep_cache, only
has an effect for the state of the cache at open, and since the file was
just created the cache is always empty. Hence setting this doesn't have an
effect on lo_create(), but keep it for symmetry with lo_open().