Move checksum_pages file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/
This is a modified version of
Linux-commit:
40cc864a9fcd48d7f3a67421a8e578e8d4cbe308
due to the large amount of changes to the OpenSFS/Intel branch.
Change-Id: Ice48c69503680ac995b60844a8d0d7ae2bddd102
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/32502
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
}
LPROC_SEQ_FOPS(ll_max_cached_mb);
}
LPROC_SEQ_FOPS(ll_max_cached_mb);
-static int ll_checksum_seq_show(struct seq_file *m, void *v)
+static ssize_t checksum_pages_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);
- seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
- return 0;
+ return sprintf(buf, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
-static ssize_t ll_checksum_seq_write(struct file *file,
- const char __user *buffer,
- size_t count, loff_t *off)
+static ssize_t checksum_pages_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
- struct seq_file *m = file->private_data;
- struct ll_sb_info *sbi = ll_s2sbi((struct super_block *)m->private);
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
bool val;
int tmp;
int rc;
bool val;
int tmp;
int rc;
/* Not set up yet */
return -EAGAIN;
/* Not set up yet */
return -EAGAIN;
- rc = kstrtobool_from_user(buffer, count, &val);
+ rc = kstrtobool(buffer, &val);
if (rc)
return rc;
if (val)
if (rc)
return rc;
if (val)
-LPROC_SEQ_FOPS(ll_checksum);
+LUSTRE_RW_ATTR(checksum_pages);
static int ll_rd_track_id(struct seq_file *m, enum stats_track_type type)
{
static int ll_rd_track_id(struct seq_file *m, enum stats_track_type type)
{
.fops = &ll_max_read_ahead_whole_mb_fops },
{ .name = "max_cached_mb",
.fops = &ll_max_cached_mb_fops },
.fops = &ll_max_read_ahead_whole_mb_fops },
{ .name = "max_cached_mb",
.fops = &ll_max_cached_mb_fops },
- { .name = "checksum_pages",
- .fops = &ll_checksum_fops },
{ .name = "stats_track_pid",
.fops = &ll_track_pid_fops },
{ .name = "stats_track_ppid",
{ .name = "stats_track_pid",
.fops = &ll_track_pid_fops },
{ .name = "stats_track_ppid",
&lustre_attr_client_type.attr,
&lustre_attr_fstype.attr,
&lustre_attr_uuid.attr,
&lustre_attr_client_type.attr,
&lustre_attr_fstype.attr,
&lustre_attr_uuid.attr,
+ &lustre_attr_checksum_pages.attr,
&lustre_attr_statahead_running_max.attr,
NULL,
};
&lustre_attr_statahead_running_max.attr,
NULL,
};