From ba3b225a126ebb3c6d4fe27c9f7c73aa4167001e Mon Sep 17 00:00:00 2001 From: Etienne Dublé Date: Sun, 20 Sep 2020 20:08:15 +0200 Subject: Allow caching symlinks in kernel page cache. (#551) This commit defines a new capability called `FUSE_CAP_CACHE_SYMLINKS`. It is off by default but you can now enable it by setting this flag in in the `want` field of the `fuse_conn_info` structure. When enabled, the kernel will save symlinks in its page cache, by making use of the feature introduced in kernel 4.20: https://github.com/torvalds/linux/commit/5571f1e65486be025f73fa6aa30fb03725d362a2 --- include/fuse_common.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/fuse_common.h') diff --git a/include/fuse_common.h b/include/fuse_common.h index 39937d3..f5bfb6a 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -346,6 +346,19 @@ struct fuse_loop_config { */ #define FUSE_CAP_HANDLE_KILLPRIV (1 << 20) +/** + * Indicates that the kernel supports caching symlinks in its page cache. + * + * When this feature is enabled, symlink targets are saved in the page cache. + * You can invalidate a cached link by calling: + * `fuse_lowlevel_notify_inval_inode(se, ino, 0, 0);` + * + * This feature is disabled by default. + * If the kernel supports it (>= 4.20), you can enable this feature by + * setting this flag in the `want` field of the `fuse_conn_info` structure. + */ +#define FUSE_CAP_CACHE_SYMLINKS (1 << 23) + /** * Indicates support for zero-message opendirs. If this flag is set in * the `capable` field of the `fuse_conn_info` structure, then the filesystem -- cgit v1.2.3