[PATCH -next] erofs: add support for FS_IOC_GETFSSYSFSPATH

Gao Xiang hsiangkao at linux.alibaba.com
Mon Jun 24 21:42:34 AEST 2024



On 2024/6/24 14:38, Huang Xiaojia wrote:
> FS_IOC_GETFSSYSFSPATH ioctl exposes /sys/fs path of a given filesystem,
> potentially standarizing sysfs reporting. This patch add support for
> FS_IOC_GETFSSYSFSPATH for erofs, "erofs/<dev>" will be outpt.
> 
> Signed-off-by: Huang Xiaojia <huangxiaojia2 at huawei.com>
> ---
>   fs/erofs/super.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/erofs/super.c b/fs/erofs/super.c
> index 1b91d9513013..19dfc1bd3666 100644
> --- a/fs/erofs/super.c
> +++ b/fs/erofs/super.c
> @@ -643,6 +643,7 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
>   		sb->s_flags |= SB_POSIXACL;
>   	else
>   		sb->s_flags &= ~SB_POSIXACL;
> +	super_set_sysfs_name_bdev(sb);

I think you should use `super_set_sysfs_name_id()` for bdev cases,
and non-bdev cases should be handled too.

Please check out erofs_register_sysfs() for details.

Thanks,
Gao Xiang

>   
>   #ifdef CONFIG_EROFS_FS_ZIP
>   	xa_init(&sbi->managed_pslots);


More information about the Linux-erofs mailing list