staging/lustre/llite: move /proc/fs/lustre/llite/uuid to sysfs
authorOleg Drokin <green@linuxhacker.ru>
Thu, 21 May 2015 19:31:43 +0000 (15:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 01:48:03 +0000 (10:48 +0900)
Move uuid file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/lproc_llite.c
drivers/staging/lustre/sysfs-fs-lustre

index 53671db2b6d357514be88a7f81c14e1640de9021..deee702fa33c4521bfebdfe67b0110b8a9edb128 100644 (file)
@@ -198,15 +198,15 @@ static ssize_t fstype_show(struct kobject *kobj, struct attribute *attr,
 }
 LUSTRE_RO_ATTR(fstype);
 
-static int ll_sb_uuid_seq_show(struct seq_file *m, void *v)
+static ssize_t uuid_show(struct kobject *kobj, struct attribute *attr,
+                        char *buf)
 {
-       struct super_block *sb = (struct super_block *)m->private;
+       struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+                                             ll_kobj);
 
-       LASSERT(sb != NULL);
-       seq_printf(m, "%s\n", ll_s2sbi(sb)->ll_sb_uuid.uuid);
-       return 0;
+       return sprintf(buf, "%s\n", sbi->ll_sb_uuid.uuid);
 }
-LPROC_SEQ_FOPS_RO(ll_sb_uuid);
+LUSTRE_RO_ATTR(uuid);
 
 static int ll_site_stats_seq_show(struct seq_file *m, void *v)
 {
@@ -837,7 +837,6 @@ static ssize_t ll_xattr_cache_seq_write(struct file *file,
 LPROC_SEQ_FOPS(ll_xattr_cache);
 
 static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
-       { "uuid",         &ll_sb_uuid_fops,       NULL, 0 },
        /* { "mntpt_path",   ll_rd_path,             0, 0 }, */
        { "site",         &ll_site_stats_fops,    NULL, 0 },
        /* { "filegroups",   lprocfs_rd_filegroups,  0, 0 }, */
@@ -875,6 +874,7 @@ static struct attribute *llite_attrs[] = {
        &lustre_attr_filesfree.attr,
        &lustre_attr_client_type.attr,
        &lustre_attr_fstype.attr,
+       &lustre_attr_uuid.attr,
        NULL,
 };
 
index 36c20d893a520b4a0f75f0b8adcfd56248454081..f353d129ea81784b259c6cbc8b2d02a6aeb8a472 100644 (file)
@@ -91,3 +91,9 @@ Date:         May 2015
 Contact:       "Oleg Drokin" <oleg.drokin@intel.com>
 Description:
                Shows filesystem type of the filesystem
+
+What:          /sys/fs/lustre/llite/<fsname>-<uuid>/uuid
+Date:          May 2015
+Contact:       "Oleg Drokin" <oleg.drokin@intel.com>
+Description:
+               Shows this filesystem superblock uuid