]> www.infradead.org Git - users/hch/configfs.git/commitdiff
zonefs: add support for FS_IOC_GETFSSYSFSPATH
authorLiao Chen <liaochen4@huawei.com>
Tue, 20 Aug 2024 02:20:29 +0000 (02:20 +0000)
committerDamien Le Moal <dlemoal@kernel.org>
Tue, 20 Aug 2024 08:46:54 +0000 (17:46 +0900)
FS_IOC_GETFSSYSFSPATH ioctl expects sysfs sub-path of a filesystem, the
format can be "$FSTYP/$SYSFS_IDENTIFIER" under /sys/fs, it can helps to
standardizes exporting sysfs datas across filesystems.

This patch wires up FS_IOC_GETFSSYSFSPATH for zonefs, it will output
"zonefs/<dev>".

Signed-off-by: Liao Chen <liaochen4@huawei.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
fs/zonefs/sysfs.c

index 8ccb65c2b419fb44cb5320fb36ac213f6659d260..ff9a688f1f9cf22bdaf57627e3f46b7aa1918ff4 100644 (file)
@@ -92,6 +92,7 @@ int zonefs_sysfs_register(struct super_block *sb)
        struct zonefs_sb_info *sbi = ZONEFS_SB(sb);
        int ret;
 
+       super_set_sysfs_name_id(sb);
        init_completion(&sbi->s_kobj_unregister);
        ret = kobject_init_and_add(&sbi->s_kobj, &zonefs_sb_ktype,
                                   zonefs_sysfs_root, "%s", sb->s_id);