Commit 40cc864a authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre/llite: move /proc/fs/lustre/llite/checksum_pages to sysfs

Move checksum_pages file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec469235
......@@ -407,7 +407,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) {
/* OBD_CONNECT_CKSUM should always be set, even if checksums are
* disabled by default, because it can still be enabled on the
* fly via /proc. As a consequence, we still need to come to an
* fly via /sys. As a consequence, we still need to come to an
* agreement on the supported algorithms at connect time */
data->ocd_connect_flags |= OBD_CONNECT_CKSUM;
......
......@@ -480,28 +480,30 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file,
}
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_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 super_block *sb = ((struct seq_file *)file->private_data)->private;
struct ll_sb_info *sbi = ll_s2sbi(sb);
int val, rc;
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kobj);
int rc;
unsigned long val;
if (!sbi->ll_dt_exp)
/* Not set up yet */
return -EAGAIN;
rc = lprocfs_write_helper(buffer, count, &val);
rc = kstrtoul(buffer, 10, &val);
if (rc)
return rc;
if (val)
......@@ -516,7 +518,7 @@ static ssize_t ll_checksum_seq_write(struct file *file,
return count;
}
LPROC_SEQ_FOPS(ll_checksum);
LUSTRE_RW_ATTR(checksum_pages);
static int ll_max_rw_chunk_seq_show(struct seq_file *m, void *v)
{
......@@ -850,7 +852,6 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
{ "site", &ll_site_stats_fops, NULL, 0 },
/* { "filegroups", lprocfs_rd_filegroups, 0, 0 }, */
{ "max_cached_mb", &ll_max_cached_mb_fops, NULL },
{ "checksum_pages", &ll_checksum_fops, NULL },
{ "max_rw_chunk", &ll_max_rw_chunk_fops, NULL },
{ "stats_track_pid", &ll_track_pid_fops, NULL },
{ "stats_track_ppid", &ll_track_ppid_fops, NULL },
......@@ -883,6 +884,7 @@ static struct attribute *llite_attrs[] = {
&lustre_attr_max_read_ahead_mb.attr,
&lustre_attr_max_read_ahead_per_file_mb.attr,
&lustre_attr_max_read_ahead_whole_mb.attr,
&lustre_attr_checksum_pages.attr,
NULL,
};
......
......@@ -117,3 +117,10 @@ Contact: "Oleg Drokin" <oleg.drokin@intel.com>
Description:
For small reads, how many megabytes to actually request from
the server as initial read-ahead.
What: /sys/fs/lustre/llite/<fsname>-<uuid>/checksum_pages
Date: May 2015
Contact: "Oleg Drokin" <oleg.drokin@intel.com>
Description:
Enables or disables per-page checksum at llite layer, before
the pages are actually given to lower level for network transfer
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment