[PATCH 2/2] cachefiles: support query cachefiles ondemand feature

Gao Xiang hsiangkao at linux.alibaba.com
Fri Jun 21 19:14:20 AEST 2024



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 <lihongbo22 at 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,
Gao Xiang


More information about the Linux-erofs mailing list