Move blocksize file from /proc/fs/lustre/llite/*/ to
/sys/fs/lustre/llite/*/blocksize
This is a heavly modified version of
Linux-commit:
364bcfc8634d5625dbb41683b061bddf307a70e8
due to the large amount of changes to the OpenSFS/Intel branch.
Change-Id: I0b54890e6c5d5f172c2cc3d081c38ea2307b0f88
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/32496
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
static const struct file_operations ll_rw_offset_stats_fops;
static __s64 ll_stats_pid_write(const char __user *buf, size_t len);
static const struct file_operations ll_rw_offset_stats_fops;
static __s64 ll_stats_pid_write(const char __user *buf, size_t len);
-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 = m->private;
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
struct obd_statfs osfs;
int rc;
struct obd_statfs osfs;
int rc;
- LASSERT(sb != NULL);
- rc = ll_statfs_internal(ll_s2sbi(sb), &osfs, OBD_STATFS_NODELAY);
- if (!rc)
- seq_printf(m, "%u\n", osfs.os_bsize);
- return rc;
+ rc = ll_statfs_internal(sbi, &osfs, OBD_STATFS_NODELAY);
+ if (rc)
+ return rc;
+
+ return sprintf(buf, "%u\n", osfs.os_bsize);
-LPROC_SEQ_FOPS_RO(ll_blksize);
+LUSTRE_RO_ATTR(blocksize);
static int ll_stat_blksize_seq_show(struct seq_file *m, void *v)
{
static int ll_stat_blksize_seq_show(struct seq_file *m, void *v)
{
.fops = &ll_fstype_fops },
{ .name = "site",
.fops = &ll_site_stats_fops },
.fops = &ll_fstype_fops },
{ .name = "site",
.fops = &ll_site_stats_fops },
- { .name = "blocksize",
- .fops = &ll_blksize_fops },
{ .name = "stat_blocksize",
.fops = &ll_stat_blksize_fops },
{ .name = "kbytestotal",
{ .name = "stat_blocksize",
.fops = &ll_stat_blksize_fops },
{ .name = "kbytestotal",
#define MAX_STRING_SIZE 128
static struct attribute *llite_attrs[] = {
#define MAX_STRING_SIZE 128
static struct attribute *llite_attrs[] = {
+ &lustre_attr_blocksize.attr,
&lustre_attr_statahead_running_max.attr,
NULL,
};
&lustre_attr_statahead_running_max.attr,
NULL,
};