Move max_easize and default_easize files from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/
This is a modified version of
Linux-commit:
f5501d042e5dd2b9932f1cad8ad3a71ec4777926
Linux-commit:
60b65afb700626f0fe43589138c8ca9ac460d634
Change-Id: Ie445d976ba6e21a224adc1894c108a7d30ed3a8b
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/32506
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
}
LUSTRE_RW_ATTR(lazystatfs);
}
LUSTRE_RW_ATTR(lazystatfs);
-static int ll_max_easize_seq_show(struct seq_file *m, void *v)
+static ssize_t max_easize_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
- struct super_block *sb = m->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
unsigned int ealen;
int rc;
unsigned int ealen;
int rc;
- seq_printf(m, "%u\n", ealen);
- return 0;
+ return sprintf(buf, "%u\n", ealen);
-LPROC_SEQ_FOPS_RO(ll_max_easize);
+LUSTRE_RO_ATTR(max_easize);
/**
* Get default_easize.
/**
* Get default_easize.
* \retval 0 on success
* \retval negative negated errno on failure
*/
* \retval 0 on success
* \retval negative negated errno on failure
*/
-static int ll_default_easize_seq_show(struct seq_file *m, void *v)
+static ssize_t default_easize_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
- struct super_block *sb = m->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
unsigned int ealen;
int rc;
unsigned int ealen;
int rc;
- seq_printf(m, "%u\n", ealen);
- return 0;
+ return sprintf(buf, "%u\n", ealen);
* \retval positive \a count on success
* \retval negative negated errno on failure
*/
* \retval positive \a count on success
* \retval negative negated errno on failure
*/
-static ssize_t ll_default_easize_seq_write(struct file *file,
- const char __user *buffer,
- size_t count, loff_t *unused)
+static ssize_t default_easize_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
- struct seq_file *seq = file->private_data;
- struct super_block *sb = (struct super_block *)seq->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
unsigned int val;
int rc;
if (count == 0)
return 0;
unsigned int val;
int rc;
if (count == 0)
return 0;
- rc = kstrtouint_from_user(buffer, count, 0, &val);
+ rc = kstrtouint(buffer, 10, &val);
-LPROC_SEQ_FOPS(ll_default_easize);
+LUSTRE_RW_ATTR(default_easize);
static int ll_sbi_flags_seq_show(struct seq_file *m, void *v)
{
static int ll_sbi_flags_seq_show(struct seq_file *m, void *v)
{
.fops = &ll_max_cached_mb_fops },
{ .name = "statahead_stats",
.fops = &ll_statahead_stats_fops },
.fops = &ll_max_cached_mb_fops },
{ .name = "statahead_stats",
.fops = &ll_statahead_stats_fops },
- { .name = "max_easize",
- .fops = &ll_max_easize_fops },
- { .name = "default_easize",
- .fops = &ll_default_easize_fops },
{ .name = "sbi_flags",
.fops = &ll_sbi_flags_fops },
{ .name = "xattr_cache",
{ .name = "sbi_flags",
.fops = &ll_sbi_flags_fops },
{ .name = "xattr_cache",
&lustre_attr_statahead_max.attr,
&lustre_attr_statahead_agl.attr,
&lustre_attr_lazystatfs.attr,
&lustre_attr_statahead_max.attr,
&lustre_attr_statahead_agl.attr,
&lustre_attr_lazystatfs.attr,
+ &lustre_attr_max_easize.attr,
+ &lustre_attr_default_easize.attr,