Whamcloud - gitweb
LU-8066 llite: move /proc/fs/lustre/llite/client_type to sysfs 99/32499/5
authorJames Simmons <uja.ornl@yahoo.com>
Sun, 29 Jul 2018 02:13:43 +0000 (22:13 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 6 Aug 2018 14:35:37 +0000 (14:35 +0000)
Move client_type file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/

This is a modified version of

Linux-commit: 95e1b6b0cff09292158ecc0701f721315167b64e

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

Change-Id: I056b0b3693b0c747d5a45fb6485cb5c4975acb1b
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/32499
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/lproc_llite.c

index c9ee782..29d7f78 100644 (file)
@@ -235,16 +235,12 @@ static ssize_t filesfree_show(struct kobject *kobj, struct attribute *attr,
 }
 LUSTRE_RO_ATTR(filesfree);
 
-static int ll_client_type_seq_show(struct seq_file *m, void *v)
+static ssize_t client_type_show(struct kobject *kobj, struct attribute *attr,
+                               char *buf)
 {
-       struct ll_sb_info *sbi = ll_s2sbi((struct super_block *)m->private);
-
-       LASSERT(sbi != NULL);
-
-       seq_puts(m, "local client\n");
-       return 0;
+       return sprintf(buf, "local client\n");
 }
-LPROC_SEQ_FOPS_RO(ll_client_type);
+LUSTRE_RO_ATTR(client_type);
 
 static int ll_fstype_seq_show(struct seq_file *m, void *v)
 {
@@ -1187,8 +1183,6 @@ struct lprocfs_vars lprocfs_llite_obd_vars[] = {
          .fops =       &ll_site_stats_fops                     },
        { .name =       "stat_blocksize",
          .fops =       &ll_stat_blksize_fops                   },
-       { .name =       "client_type",
-         .fops =       &ll_client_type_fops                    },
        { .name =       "max_read_ahead_mb",
          .fops =       &ll_max_readahead_mb_fops               },
        { .name =       "max_read_ahead_per_file_mb",
@@ -1245,6 +1239,7 @@ static struct attribute *llite_attrs[] = {
        &lustre_attr_kbytesavail.attr,
        &lustre_attr_filestotal.attr,
        &lustre_attr_filesfree.attr,
+       &lustre_attr_client_type.attr,
        &lustre_attr_statahead_running_max.attr,
        NULL,
 };