[PATCH 07/58] staging/lustre/llite: move /proc/fs/lustre/llite/client_type to sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Oleg Drokin <green@xxxxxxxxxxxxxx>

Move client_type file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/

Signed-off-by: Oleg Drokin <green@xxxxxxxxxxxxxx>
---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 20 ++++++++------------
 drivers/staging/lustre/sysfs-fs-lustre            |  8 ++++++++
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 3dce0ba..fba21f8 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -177,20 +177,16 @@ 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);
-
-	if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
-		seq_puts(m, "remote client\n");
-	else
-		seq_puts(m, "local client\n");
+	struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+					      ll_kobj);
 
-	return 0;
+	return sprintf(buf, "%s client\n",
+			sbi->ll_flags & LL_SBI_RMT_CLIENT ? "remote" : "local");
 }
-LPROC_SEQ_FOPS_RO(ll_client_type);
+LUSTRE_RO_ATTR(client_type);
 
 static int ll_fstype_seq_show(struct seq_file *m, void *v)
 {
@@ -845,7 +841,6 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
 	/* { "mntpt_path",   ll_rd_path,	     0, 0 }, */
 	{ "fstype",       &ll_fstype_fops,	  NULL, 0 },
 	{ "site",	  &ll_site_stats_fops,    NULL, 0 },
-	{ "client_type",  &ll_client_type_fops,   NULL, 0 },
 	/* { "filegroups",   lprocfs_rd_filegroups,  0, 0 }, */
 	{ "max_read_ahead_mb", &ll_max_readahead_mb_fops, NULL },
 	{ "max_read_ahead_per_file_mb", &ll_max_readahead_per_file_mb_fops,
@@ -879,6 +874,7 @@ static struct attribute *llite_attrs[] = {
 	&lustre_attr_kbytesavail.attr,
 	&lustre_attr_filestotal.attr,
 	&lustre_attr_filesfree.attr,
+	&lustre_attr_client_type.attr,
 	NULL,
 };
 
diff --git a/drivers/staging/lustre/sysfs-fs-lustre b/drivers/staging/lustre/sysfs-fs-lustre
index ecb16f0..213eb86 100644
--- a/drivers/staging/lustre/sysfs-fs-lustre
+++ b/drivers/staging/lustre/sysfs-fs-lustre
@@ -77,3 +77,11 @@ Date:		May 2015
 Contact:	"Oleg Drokin" <oleg.drokin@xxxxxxxxx>
 Description:
 		Shows estimated number of free inodes on the filesystem
+
+What:		/sys/fs/lustre/llite/<fsname>-<uuid>/client_type
+Date:		May 2015
+Contact:	"Oleg Drokin" <oleg.drokin@xxxxxxxxx>
+Description:
+		Shows whenever this filesystem considers this client to be
+		compute cluster-local or remote. Remote clients have
+		additional uid/gid convrting logic applied.
-- 
2.1.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux