summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorOleg Drokin <green@linuxhacker.ru>2015-05-21 15:31:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-31 10:48:02 +0900
commit7267ec0d8726c214aaf24ca9e8baebb443b0da75 (patch)
tree31c3204c7d8c8f0401d73bf52e0db48a3e158359 /drivers
parent5804b11e1487558c6740282a01a08bb4ba0c6d06 (diff)
downloadlinux-7267ec0d8726c214aaf24ca9e8baebb443b0da75.tar.gz
linux-7267ec0d8726c214aaf24ca9e8baebb443b0da75.tar.bz2
linux-7267ec0d8726c214aaf24ca9e8baebb443b0da75.zip
staging/lustre/llite: move /proc/fs/lustre/llite/files* to sysfs
Move filestotal and filesfree files from /proc/fs/lustre/llite/* to /sys/fs/lustre/llite/*/ Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/lustre/lustre/llite/lproc_llite.c30
-rw-r--r--drivers/staging/lustre/sysfs-fs-lustre12
2 files changed, 28 insertions, 14 deletions
diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 0010ac296e7f..3dce0bacac2a 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -141,39 +141,41 @@ static ssize_t kbytesavail_show(struct kobject *kobj, struct attribute *attr,
}
LUSTRE_RO_ATTR(kbytesavail);
-static int ll_filestotal_seq_show(struct seq_file *m, void *v)
+static ssize_t filestotal_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, "%llu\n", osfs.os_files);
+ return sprintf(buf, "%llu\n", osfs.os_files);
return rc;
}
-LPROC_SEQ_FOPS_RO(ll_filestotal);
+LUSTRE_RO_ATTR(filestotal);
-static int ll_filesfree_seq_show(struct seq_file *m, void *v)
+static ssize_t filesfree_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, "%llu\n", osfs.os_ffree);
+ return sprintf(buf, "%llu\n", osfs.os_ffree);
return rc;
}
-LPROC_SEQ_FOPS_RO(ll_filesfree);
+LUSTRE_RO_ATTR(filesfree);
static int ll_client_type_seq_show(struct seq_file *m, void *v)
{
@@ -843,8 +845,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 },
- { "filestotal", &ll_filestotal_fops, NULL, 0 },
- { "filesfree", &ll_filesfree_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 },
@@ -877,6 +877,8 @@ static struct attribute *llite_attrs[] = {
&lustre_attr_kbytestotal.attr,
&lustre_attr_kbytesfree.attr,
&lustre_attr_kbytesavail.attr,
+ &lustre_attr_filestotal.attr,
+ &lustre_attr_filesfree.attr,
NULL,
};
diff --git a/drivers/staging/lustre/sysfs-fs-lustre b/drivers/staging/lustre/sysfs-fs-lustre
index 889cef40a4bf..ecb16f0fcb14 100644
--- a/drivers/staging/lustre/sysfs-fs-lustre
+++ b/drivers/staging/lustre/sysfs-fs-lustre
@@ -65,3 +65,15 @@ Description:
Shows total number of free kilobytes of space on this filesystem
actually available for use (taking into account per-client
grants and filesystem reservations).
+
+What: /sys/fs/lustre/llite/<fsname>-<uuid>/filestotal
+Date: May 2015
+Contact: "Oleg Drokin" <oleg.drokin@intel.com>
+Description:
+ Shows total number of inodes on the filesystem.
+
+What: /sys/fs/lustre/llite/<fsname>-<uuid>/filesfree
+Date: May 2015
+Contact: "Oleg Drokin" <oleg.drokin@intel.com>
+Description:
+ Shows estimated number of free inodes on the filesystem