On 2024/6/21 17:14, Gao Xiang wrote:
On 2024/6/21 14:18, Hongbo Li wrote:
Erofs over fscache need CONFIG_CACHEFILES_ONDEMAND in cachefiles
module. We cannot know whether it is supported from userspace, so
we export this feature to user by sysfs interface.
[Before]
$ cat /sys/fs/cachefiles/features/cachefiles_ondemand
cat: /sys/fs/cachefiles/features/cachefiles_ondemand: No such file or
directory
[After]
$ cat /sys/fs/cachefiles/features/cachefiles_ondemand
supported
Signed-off-by: Hongbo Li <lihongb...@huawei.com>
I don't think such sysfs is needed, you could just use
`bind ondemand` to check if it is supported:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/cachefiles/daemon.c?h=v6.9#n780
Thanks for reply!
`bind ondemand` can check if it is supported, but it requires a more
complicated procedure for user to implement. For example, a serial of
system call (open, ioctl, close) are need.The containerd snapshotter
daemon relies on these feature, only use a simple check method is usable
in product environment. The snapshotter developers may know how
cachefiles works, but for snapshotter users, a simple way to check
whether snapshotter can be launched is useful. Even though they do not
know how cachefiles works.
Thanks,
Hongbo
Thanks,
Gao Xiang