Whamcloud - gitweb
LU-8066 llite: move /proc/fs/lustre/llite/uuid to sysfs 01/32501/9
authorJames Simmons <uja.ornl@yahoo.com>
Sun, 29 Jul 2018 14:34:19 +0000 (10:34 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 23 Aug 2018 07:18:08 +0000 (07:18 +0000)
Move uuid file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/

This is a modified version of

Linux-commit: ec55a6299990efa969dfc00d95c72444ff1e3461

due to the large amount of changes to the OpenSFS/Intel branch.

Change-Id: I2dc13c248879f554f9f7ed6dc62a6772a59f6f35
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/32501
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/llite/lproc_llite.c

index 86f460a..113989d 100644 (file)
@@ -252,15 +252,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 = m->private;
+       struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+                                             ll_kset.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_xattr_cache_seq_show(struct seq_file *m, void *v)
 {
@@ -1174,8 +1174,6 @@ static ssize_t ll_nosquash_nids_seq_write(struct file *file,
 LPROC_SEQ_FOPS(ll_nosquash_nids);
 
 struct lprocfs_vars lprocfs_llite_obd_vars[] = {
-       { .name =       "uuid",
-         .fops =       &ll_sb_uuid_fops                        },
        { .name =       "site",
          .fops =       &ll_site_stats_fops                     },
        { .name =       "stat_blocksize",
@@ -1238,6 +1236,7 @@ static struct attribute *llite_attrs[] = {
        &lustre_attr_filesfree.attr,
        &lustre_attr_client_type.attr,
        &lustre_attr_fstype.attr,
+       &lustre_attr_uuid.attr,
        &lustre_attr_statahead_running_max.attr,
        NULL,
 };