scoutfs: use fr identity in pseudo fs paths

Use the fr mount identity string in the sysfs/fs/ and debugfs paths we
register for each mount.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2019-06-24 11:19:59 -07:00
committed by Zach Brown
parent 7a36a289d2
commit bd7a7fe97e
2 changed files with 9 additions and 10 deletions

View File

@@ -325,16 +325,16 @@ out:
return ret;
}
/*
* This needs to be setup after reading the super because it uses the
* fsid found in the super block.
*/
static int scoutfs_debugfs_setup(struct super_block *sb)
{
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
char name[32];
/*
* XXX: Move the name variable to sbi and use it in
* init_lock_info as well.
*/
snprintf(name, 32, "%llx", le64_to_cpu(sbi->super.hdr.fsid));
snprintf(name, ARRAY_SIZE(name), SCSBF, SCSB_ARGS(sb));
sbi->debug_root = debugfs_create_dir(name, scoutfs_debugfs_root);
if (!sbi->debug_root)
@@ -410,10 +410,10 @@ static int scoutfs_fill_super(struct super_block *sb, void *data, int silent)
goto out;
}
ret = scoutfs_setup_sysfs(sb) ?:
scoutfs_setup_counters(sb) ?:
scoutfs_read_super(sb, &SCOUTFS_SB(sb)->super) ?:
ret = scoutfs_read_super(sb, &SCOUTFS_SB(sb)->super) ?:
scoutfs_debugfs_setup(sb) ?:
scoutfs_setup_sysfs(sb) ?:
scoutfs_setup_counters(sb) ?:
scoutfs_options_setup(sb) ?:
scoutfs_sysfs_create_attrs(sb, &sbi->mopts_ssa,
mount_options_attrs, "mount_options") ?:

View File

@@ -204,10 +204,9 @@ int scoutfs_setup_sysfs(struct super_block *sb)
sfsinfo->sb = sb;
sbi->sfsinfo = sfsinfo;
/* XXX can have multiple mounts of a device, need mount id */
init_completion(&sfsinfo->sb_id_comp);
ret = kobject_init_and_add(&sfsinfo->sb_id_kobj, &sb_id_ktype,
&scoutfs_kset->kobj, "%s", sb->s_id);
&scoutfs_kset->kobj, SCSBF, SCSB_ARGS(sb));
if (ret)
kfree(sfsinfo);