aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pstore/platform.c
diff options
context:
space:
mode:
authorLuck, Tony <tony.luck@intel.com>2011-03-18 18:33:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-21 16:50:05 -0400
commit366f7e7a79b19bd8c4e8f55fdf12b81538d1a7a4 (patch)
tree0c43335ab9e91ca895fdec82d1327cec16dcb645 /fs/pstore/platform.c
parent10effcb548c170d59ea1d2152f2ee0ad45ce4c9d (diff)
pstore: use mount option instead sysfs to tweak kmsg_bytes
/sys/fs is a somewhat strange way to tweak what could more obviously be tuned with a mount option. Suggested-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/pstore/platform.c')
-rw-r--r--fs/pstore/platform.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 705fdf8abf6e..ce9ad84d5dd9 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -37,24 +37,14 @@
37static DEFINE_SPINLOCK(pstore_lock); 37static DEFINE_SPINLOCK(pstore_lock);
38static struct pstore_info *psinfo; 38static struct pstore_info *psinfo;
39 39
40/* How much of the console log to snapshot. /sys/fs/pstore/kmsg_bytes */ 40/* How much of the console log to snapshot */
41static unsigned long kmsg_bytes = 10240; 41static unsigned long kmsg_bytes = 10240;
42 42
43static ssize_t b_show(struct kobject *kobj, 43void pstore_set_kmsg_bytes(int bytes)
44 struct kobj_attribute *attr, char *buf)
45{ 44{
46 return snprintf(buf, PAGE_SIZE, "%lu\n", kmsg_bytes); 45 kmsg_bytes = bytes;
47} 46}
48 47
49static ssize_t b_store(struct kobject *kobj, struct kobj_attribute *attr,
50 const char *buf, size_t count)
51{
52 return (sscanf(buf, "%lu", &kmsg_bytes) > 0) ? count : 0;
53}
54
55struct kobj_attribute pstore_kmsg_bytes_attr =
56 __ATTR(kmsg_bytes, S_IRUGO | S_IWUSR, b_show, b_store);
57
58/* Tag each group of saved records with a sequence number */ 48/* Tag each group of saved records with a sequence number */
59static int oopscount; 49static int oopscount;
60 50