aboutsummaryrefslogtreecommitdiffstats
path: root/example
AgeCommit message (Collapse)AuthorLines
2019-11-03passthrough_ll: drop lo_dirp->fd field (#464)Stefan Hajnoczi-7/+9
fdopendir(3) takes ownership of the file descriptor. The presence of the lo_dirp->fd field could lead to someone incorrectly adding a close(d->fd) cleanup call in the future. Do not store the file descriptor in struct lo_dirp since it is unused. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-09-10passthrough_ll: use fuse_log() instead of err()/errx()Stefan Hajnoczi-8/+17
Send everything through fuse_log() instead of writing directly to stderr. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-09-10passthrough_ll: use fuse_log()Stefan Hajnoczi-16/+16
Make use of fuse_log() instead of printing directly to stderr. This demonstrates unified logging and also caught the fact that I forgot to add fuse_log APIs to lib/fuse_versionscript. So it's basically a test case :). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-09-09passthrough_ll: fix fallocate variant ifdefs (#449)Dr. David Alan Gilbert-2/+2
If fallocate isn't available we incorrectly check for the value of HAVE_POSIX_FALLOCATE rather than it being defined. We also fail to initialise 'err' in the case where neither are defined. Fixes: 5fc562c90d7925963467 ("Add fallocate and use it instead of ...") Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-05-15passthrough: fix unix-domain sockets on FreeBSD (#413)Alan Somers-19/+87
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.
2019-05-12Fix includes of non-system headers.Nikolaus Rath-2/+2
Fixes: #415.
2019-05-09Added new example filesystemNikolaus Rath-0/+3363
passthrough_hp puts emphasis and performance and correctness, rather than simplicity.
2019-05-05Fixed permissions.Nikolaus Rath-0/+0
2019-04-18Add fallocate and use it instead of posix_fallocate if possible (#398)Liu Bo-0/+7
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>
2019-04-16Add documentation for opting out of opendir and releasedir (#391)Chad Austin-0/+2
2019-03-11Defined the (*ioctl)() commands as unsigned int (#381)Jean-Pierre André-1/+1
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.
2019-03-08Document fuse_fsync_in.fsync_flags and remove magic numbers (#375)Alan Somers-12/+4
2019-02-25hello_ll: Fix null pointer dereference (#363)Forty-Bot-0/+7
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).
2019-01-22passthrough_ll: lo_create() should honor CACHE_NEVER (#345)Miklos Szeredi-0/+5
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().
2018-12-29Fixed memory leak.Nikolaus Rath-5/+0
Fixes: #338.
2018-11-27Fix fd/inode leakNikolaus Rath-13/+19
If do_readdir() calls do_lookup(), but the latter fails, we still have to return any entries that we already stored in the readdir buffer to avoid leaking inodes. do_lookup() may fail if e.g. we reach the file descriptor limit.
2018-11-24Avoid needless telldir() call.Nikolaus Rath-1/+1
2018-11-24Fixed lookup-count leak in do_readdir().Nikolaus Rath-3/+7
2018-11-24Don't segfault when called with -h.Nikolaus Rath-1/+1
Fixes: #327
2018-11-19examples: add copy_file_range() support to passthrough(_fh)Niels de Vos-0/+98
The passthrough example filesystem can be used for validating the API and the implementation in the FUSE kernel module.
2018-11-09Don't crash if mountpoint is not specified.Nikolaus Rath-0/+7
Fixes: #319.
2018-10-10passthrough_ll: initialize unused memoryMiklos Szeredi-3/+4
For '.' and '..' entries only the file type in e.attr.st_mode and the inode number in e.attr.st_ino are used. But it's prudent to at least initialize the other fields of struct fuse_entry_param as well, instead of using random values from the stack.
2018-10-10passthrough_ll: allow configuring cachingMiklos Szeredi-8/+55
Caching can be controlled with the following options: "cache=never": disable caching "cache=normal": enable caching but also refresh after the timeout "cache=always": never refresh cache The timeout can be controlled with the "timeout=SEC" option, where SEC is the number of seconds and can be an arbitrary non-negative floating point number. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: add *xattr() operationsMiklos Szeredi-0/+186
The extended attribute functionality is enabled with the "xattr" option (default) and disabled with the "no_xatt" option. New operations added: - getxattr - listxattr - setxattr - removexattr Caveat: none of these operations will work on a symbolic link, because it's difficult to implement that without races that can result in incorrect operation. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: add flock()Miklos Szeredi-0/+23
Conditionally enable flock() locking on underlying filesystem, based on the flock/no_flock options. Default is "no_flock", meaning locking will be local to the fuse filesystem and won't be propagated to the filesystem passed through. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: whitespace cleanupMiklos Szeredi-6/+5
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: add forget_multi()Vivek Goyal-1/+16
Add method forget_multi() to forget multiple inodes in a single message. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: add source optionVivek Goyal-2/+19
Right now, passthrough_ll will use "/" as source directory for passthrough. We need more flexibility where user can specify path of directory to be passed through. Hence add an option "source=<source-dir>". Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: add some of the missing operationsMiklos Szeredi-1/+324
New operations added: - mkdir - mknod - symlink - link - unlink - rmdir - rename - setattr - fsyncdir - flush - fsync - statfs - fallocate Caveats: - The utimes(2) family of syscalls will fail on symlinks on 4.18 and earlier kernels. Hoping to add support to later kernels. - The link(2) and linkat(2) system calls will fail on symlinks unless running with privileges (CAP_DAC_READ_SEARCH). Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: add is_symlink to lo_inodeMiklos Szeredi-0/+3
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: set umask at startupMiklos Szeredi-0/+3
Like all the other passthrough examples. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: fix refcount for "." and ".." entriesMiklos Szeredi-7/+19
Kernel is not expecting an elevated lookup count for the "." and ".." entries when doing READDIRPLUS. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-10-10passthrough_ll: add locking to inode cacheMiklos Szeredi-26/+51
Otherwise it may crash when running multithreaded. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-08-25Make meson build scripts subprojects friendlyMartin Blanchard-5/+2
Multiple meson build scripts improvements including: * Bump meson requirement to 0.40.1 (0.40 already required) * Declare a dependency object for main library * Stop using add_global_arguments() * Various minor style fixes
2018-07-23example/{hello,null}: Fix memory leaksRostislav Skudnov-1/+8
2018-04-13Invert calloc(3) argument order (`nmemb` comes first)Tomohiro Kusumi-1/+1
No functional difference expected, but should still follow the standard. http://pubs.opengroup.org/onlinepubs/009695399/functions/calloc.html
2018-03-28Fix build error on DragonFlyBSD (sync with other *BSD) (#240)Tomohiro Kusumi-1/+1
DragonFlyBSD has no "bsd" in uname, so add 'dragonfly' to conditionals. -- e.g. uname(1) in DragonFlyBSD [root@ ~]# uname DragonFly [root@ ~]# python -c "import sys; print(sys.platform)" dragonfly5
2018-01-15Fix typo in "passthrough" docstring (#229)Mateusz Urbańczyk-1/+1
2017-11-27Spelling (#223)Josh Soref-1/+1
Fix spelling errors
2017-09-25Removed unneccessary #include <config.h> from examplesNikolaus Rath-28/+0
Fixes: #208.
2017-08-25example/ioctl: build on FreeBSD, but add protocol check instead.Nikolaus Rath-5/+5
2017-08-25examples/{ioctl,null}: don't build under FreeBSD instead of skipping tests.Nikolaus Rath-6/+8
2017-08-24printcap: use temporary directory, not fileNikolaus Rath-6/+3
Mounting a file doesn't seem to work under FreeBSD.
2017-08-24passthrough_ll: only active EXPORT_SUPPORT of supported by kernel.Nikolaus Rath-1/+3
2017-08-24Dropped support for building with autotoolsNikolaus Rath-21/+0
It's just too much pain to keep it working.
2017-08-24Renamed notify_inval_inode_fh to invalidate_pathNikolaus Rath-4/+4
The previous name didn't make much sense.
2017-08-24Allow inode cache invalidation in high-level APISławek Rudnicki-2/+296
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-08-23Added examples/printcapNikolaus Rath-2/+132
2017-08-22Make passthrough_fh work under FreeBSD.Nikolaus Rath-0/+13
2017-08-22Fix two compiler warnings.Nikolaus Rath-1/+1