From 2f3d1c395e9d6feea06e7fa6117cb77df5b044e9 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 24 Nov 2020 12:15:41 -0800 Subject: [PATCH] scoutfs: show metadev_path in sysfs/mount_options We forgot to add metadev_path to the options that are found in the mount_options sysfs directory. Signed-off-by: Zach Brown --- kmod/src/super.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kmod/src/super.c b/kmod/src/super.c index 23df589e..926531d6 100644 --- a/kmod/src/super.c +++ b/kmod/src/super.c @@ -182,6 +182,16 @@ static int scoutfs_show_options(struct seq_file *seq, struct dentry *root) return 0; } +static ssize_t metadev_path_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct super_block *sb = SCOUTFS_SYSFS_ATTRS_SB(kobj); + struct mount_options *opts = &SCOUTFS_SB(sb)->opts; + + return snprintf(buf, PAGE_SIZE, "%s", opts->metadev_path); +} +SCOUTFS_ATTR_RO(metadev_path); + static ssize_t server_addr_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { @@ -194,6 +204,7 @@ static ssize_t server_addr_show(struct kobject *kobj, SCOUTFS_ATTR_RO(server_addr); static struct attribute *mount_options_attrs[] = { + SCOUTFS_ATTR_PTR(metadev_path), SCOUTFS_ATTR_PTR(server_addr), NULL, };