From c0818cdeaf5a877740d0e27fc83cfce0c1e0a3fc Mon Sep 17 00:00:00 2001 From: James Simmons Date: Sun, 29 Jul 2018 10:28:33 -0400 Subject: [PATCH] LU-8066 llite: move /proc/fs/lustre/llite/fstype to sysfs Move fstype file from /proc/fs/lustre/llite/* to /sys/fs/lustre/llite/*/ This is a modified version of Linux-commit: 0cee667682b55d7c389d77877adbd63360415baa due to the large amount of changes to the OpenSFS/Intel branch. Change-Id: Ic06988c1f9ccfa6a32f99f5ea8ddcf4820a62a8e Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/32896 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/llite/lproc_llite.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 29d7f78..86f460a 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -242,16 +242,15 @@ static ssize_t client_type_show(struct kobject *kobj, struct attribute *attr, } LUSTRE_RO_ATTR(client_type); -static int ll_fstype_seq_show(struct seq_file *m, void *v) +static ssize_t fstype_show(struct kobject *kobj, struct attribute *attr, + char *buf) { - struct super_block *sb = m->private; - struct ll_sb_info *sbi = ll_s2sbi(sb); + struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, + ll_kset.kobj); - LASSERT(sb != NULL); - seq_printf(m, "%s\n", sbi->ll_mnt.mnt->mnt_sb->s_type->name); - return 0; + return sprintf(buf, "%s\n", sbi->ll_mnt.mnt->mnt_sb->s_type->name); } -LPROC_SEQ_FOPS_RO(ll_fstype); +LUSTRE_RO_ATTR(fstype); static int ll_sb_uuid_seq_show(struct seq_file *m, void *v) { @@ -1177,8 +1176,6 @@ LPROC_SEQ_FOPS(ll_nosquash_nids); struct lprocfs_vars lprocfs_llite_obd_vars[] = { { .name = "uuid", .fops = &ll_sb_uuid_fops }, - { .name = "fstype", - .fops = &ll_fstype_fops }, { .name = "site", .fops = &ll_site_stats_fops }, { .name = "stat_blocksize", @@ -1240,6 +1237,7 @@ static struct attribute *llite_attrs[] = { &lustre_attr_filestotal.attr, &lustre_attr_filesfree.attr, &lustre_attr_client_type.attr, + &lustre_attr_fstype.attr, &lustre_attr_statahead_running_max.attr, NULL, }; -- 1.8.3.1