Commit 070c29ca authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

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

Move xattr_cache 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 d36f2b0b
...@@ -777,26 +777,27 @@ static int ll_sbi_flags_seq_show(struct seq_file *m, void *v) ...@@ -777,26 +777,27 @@ static int ll_sbi_flags_seq_show(struct seq_file *m, void *v)
} }
LPROC_SEQ_FOPS_RO(ll_sbi_flags); LPROC_SEQ_FOPS_RO(ll_sbi_flags);
static int ll_xattr_cache_seq_show(struct seq_file *m, void *v) static ssize_t xattr_cache_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,
struct ll_sb_info *sbi = ll_s2sbi(sb); ll_kobj);
seq_printf(m, "%u\n", sbi->ll_xattr_cache_enabled);
return 0; return sprintf(buf, "%u\n", sbi->ll_xattr_cache_enabled);
} }
static ssize_t ll_xattr_cache_seq_write(struct file *file, static ssize_t xattr_cache_store(struct kobject *kobj,
const char __user *buffer, struct attribute *attr,
size_t count, loff_t *off) const char *buffer,
size_t count)
{ {
struct seq_file *seq = file->private_data; struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
struct super_block *sb = seq->private; ll_kobj);
struct ll_sb_info *sbi = ll_s2sbi(sb); int rc;
int val, rc; unsigned long val;
rc = lprocfs_write_helper(buffer, count, &val); rc = kstrtoul(buffer, 10, &val);
if (rc) if (rc)
return rc; return rc;
...@@ -810,7 +811,7 @@ static ssize_t ll_xattr_cache_seq_write(struct file *file, ...@@ -810,7 +811,7 @@ static ssize_t ll_xattr_cache_seq_write(struct file *file,
return count; return count;
} }
LPROC_SEQ_FOPS(ll_xattr_cache); LUSTRE_RW_ATTR(xattr_cache);
static struct lprocfs_vars lprocfs_llite_obd_vars[] = { static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
/* { "mntpt_path", ll_rd_path, 0, 0 }, */ /* { "mntpt_path", ll_rd_path, 0, 0 }, */
...@@ -819,7 +820,6 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = { ...@@ -819,7 +820,6 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
{ "max_cached_mb", &ll_max_cached_mb_fops, NULL }, { "max_cached_mb", &ll_max_cached_mb_fops, NULL },
{ "statahead_stats", &ll_statahead_stats_fops, NULL, 0 }, { "statahead_stats", &ll_statahead_stats_fops, NULL, 0 },
{ "sbi_flags", &ll_sbi_flags_fops, NULL, 0 }, { "sbi_flags", &ll_sbi_flags_fops, NULL, 0 },
{ "xattr_cache", &ll_xattr_cache_fops, NULL, 0 },
{ NULL } { NULL }
}; };
...@@ -847,6 +847,7 @@ static struct attribute *llite_attrs[] = { ...@@ -847,6 +847,7 @@ static struct attribute *llite_attrs[] = {
&lustre_attr_lazystatfs.attr, &lustre_attr_lazystatfs.attr,
&lustre_attr_max_easize.attr, &lustre_attr_max_easize.attr,
&lustre_attr_default_easize.attr, &lustre_attr_default_easize.attr,
&lustre_attr_xattr_cache.attr,
NULL, NULL,
}; };
......
...@@ -183,3 +183,10 @@ Contact: "Oleg Drokin" <oleg.drokin@intel.com> ...@@ -183,3 +183,10 @@ Contact: "Oleg Drokin" <oleg.drokin@intel.com>
Description: Description:
Shows maximum observed file striping data seen by this Shows maximum observed file striping data seen by this
filesystem client instance. filesystem client instance.
What: /sys/fs/lustre/llite/<fsname>-<uuid>/xattr_cache
Date: May 2015
Contact: "Oleg Drokin" <oleg.drokin@intel.com>
Description:
Controls extended attributes client-side cache.
1 to enable, 0 to disable.
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