From: James Simmons Date: Sun, 29 Jul 2018 14:34:19 +0000 (-0400) Subject: LU-8066 llite: move /proc/fs/lustre/llite/uuid to sysfs X-Git-Tag: 2.11.55~61 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=3a564cc74a3ba56374d7b34a98a639bfb712ed55;p=fs%2Flustre-release.git LU-8066 llite: move /proc/fs/lustre/llite/uuid to sysfs 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/32501 Reviewed-by: Bobi Jam Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo --- diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 86f460a..113989d 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -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, };