diff options
author | Luck, Tony <tony.luck@intel.com> | 2011-03-19 01:33:43 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-21 23:50:05 +0300 |
commit | 366f7e7a79b19bd8c4e8f55fdf12b81538d1a7a4 (patch) | |
tree | 0c43335ab9e91ca895fdec82d1327cec16dcb645 /fs/pstore/platform.c | |
parent | 10effcb548c170d59ea1d2152f2ee0ad45ce4c9d (diff) | |
download | linux-366f7e7a79b19bd8c4e8f55fdf12b81538d1a7a4.tar.xz |
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.c | 16 |
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 @@ static DEFINE_SPINLOCK(pstore_lock); static struct pstore_info *psinfo; -/* How much of the console log to snapshot. /sys/fs/pstore/kmsg_bytes */ +/* How much of the console log to snapshot */ static unsigned long kmsg_bytes = 10240; -static ssize_t b_show(struct kobject *kobj, - struct kobj_attribute *attr, char *buf) +void pstore_set_kmsg_bytes(int bytes) { - return snprintf(buf, PAGE_SIZE, "%lu\n", kmsg_bytes); + kmsg_bytes = bytes; } -static ssize_t b_store(struct kobject *kobj, struct kobj_attribute *attr, - const char *buf, size_t count) -{ - return (sscanf(buf, "%lu", &kmsg_bytes) > 0) ? count : 0; -} - -struct kobj_attribute pstore_kmsg_bytes_attr = - __ATTR(kmsg_bytes, S_IRUGO | S_IWUSR, b_show, b_store); - /* Tag each group of saved records with a sequence number */ static int oopscount; |