[PATCH 04/58] staging/lustre/llite: move /proc/fs/lustre/llite/blocksize to sysfs

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

 



From: Oleg Drokin <green@xxxxxxxxxxxxxx>

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

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

diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index a3ecb61..bdf1f38 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -48,22 +48,23 @@ static struct file_operations ll_rw_extents_stats_fops;
 static struct file_operations ll_rw_extents_stats_pp_fops;
 static struct file_operations ll_rw_offset_stats_fops;
 
-static int ll_blksize_seq_show(struct seq_file *m, void *v)
+static ssize_t blocksize_show(struct kobject *kobj, struct attribute *attr,
+			      char *buf)
 {
-	struct super_block *sb = (struct super_block *)m->private;
+	struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+					      ll_kobj);
 	struct obd_statfs osfs;
 	int rc;
 
-	LASSERT(sb != NULL);
-	rc = ll_statfs_internal(sb, &osfs,
+	rc = ll_statfs_internal(sbi->ll_sb, &osfs,
 				cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
 				OBD_STATFS_NODELAY);
 	if (!rc)
-		seq_printf(m, "%u\n", osfs.os_bsize);
+		return sprintf(buf, "%u\n", osfs.os_bsize);
 
 	return rc;
 }
-LPROC_SEQ_FOPS_RO(ll_blksize);
+LUSTRE_RO_ATTR(blocksize);
 
 static int ll_kbytestotal_seq_show(struct seq_file *m, void *v)
 {
@@ -839,7 +840,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 },
-	{ "blocksize",    &ll_blksize_fops,	  NULL, 0 },
 	{ "kbytestotal",  &ll_kbytestotal_fops,   NULL, 0 },
 	{ "kbytesfree",   &ll_kbytesfree_fops,    NULL, 0 },
 	{ "kbytesavail",  &ll_kbytesavail_fops,   NULL, 0 },
@@ -873,6 +873,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
 #define MAX_STRING_SIZE 128
 
 static struct attribute *llite_attrs[] = {
+	&lustre_attr_blocksize.attr,
 	NULL,
 };
 
diff --git a/drivers/staging/lustre/sysfs-fs-lustre b/drivers/staging/lustre/sysfs-fs-lustre
index df90a1b..85b0ba7 100644
--- a/drivers/staging/lustre/sysfs-fs-lustre
+++ b/drivers/staging/lustre/sysfs-fs-lustre
@@ -39,3 +39,9 @@ Description:
 			       command name and pid with a dot in between
 			       e.g. dd.1253
 		nodelocal - use jobid_name value from above.
+
+What:		/sys/fs/lustre/llite/<fsname>-<uuid>/blocksize
+Date:		May 2015
+Contact:	"Oleg Drokin" <oleg.drokin@xxxxxxxxx>
+Description:
+		Biggest blocksize on object storage server for this filesystem.
-- 
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