diff options
author | David Howells <dhowells@redhat.com> | 2017-07-05 11:24:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-07-06 03:31:46 -0400 |
commit | 349d743895e2371bda9a02a5b465b50cc24d2825 (patch) | |
tree | 5a9ff4a63bf70603842b00e079b4fe6f25451e01 | |
parent | d86efb0df98afe0acdda7ed94963684c3fa7cccd (diff) |
pstore: Implement show_options
Implement the show_options superblock op for pstore as part of a bid to get
rid of s_options and generic_show_options() to make it easier to implement
a context-based mount where the mount options can be passed individually
over a file descriptor.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Kees Cook <keescook@chromium.org>
cc: Anton Vorontsov <anton@enomsg.org>
cc: Colin Cross <ccross@android.com>
cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/pstore/inode.c | 14 | ||||
-rw-r--r-- | fs/pstore/internal.h | 3 | ||||
-rw-r--r-- | fs/pstore/platform.c | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 792a4e5f9226..913e839ac1f5 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c | |||
@@ -283,6 +283,16 @@ static void parse_options(char *options) | |||
283 | } | 283 | } |
284 | } | 284 | } |
285 | 285 | ||
286 | /* | ||
287 | * Display the mount options in /proc/mounts. | ||
288 | */ | ||
289 | static int pstore_show_options(struct seq_file *m, struct dentry *root) | ||
290 | { | ||
291 | if (kmsg_bytes != PSTORE_DEFAULT_KMSG_BYTES) | ||
292 | seq_printf(m, ",kmsg_bytes=%lu", kmsg_bytes); | ||
293 | return 0; | ||
294 | } | ||
295 | |||
286 | static int pstore_remount(struct super_block *sb, int *flags, char *data) | 296 | static int pstore_remount(struct super_block *sb, int *flags, char *data) |
287 | { | 297 | { |
288 | sync_filesystem(sb); | 298 | sync_filesystem(sb); |
@@ -296,7 +306,7 @@ static const struct super_operations pstore_ops = { | |||
296 | .drop_inode = generic_delete_inode, | 306 | .drop_inode = generic_delete_inode, |
297 | .evict_inode = pstore_evict_inode, | 307 | .evict_inode = pstore_evict_inode, |
298 | .remount_fs = pstore_remount, | 308 | .remount_fs = pstore_remount, |
299 | .show_options = generic_show_options, | 309 | .show_options = pstore_show_options, |
300 | }; | 310 | }; |
301 | 311 | ||
302 | static struct super_block *pstore_sb; | 312 | static struct super_block *pstore_sb; |
@@ -448,8 +458,6 @@ static int pstore_fill_super(struct super_block *sb, void *data, int silent) | |||
448 | { | 458 | { |
449 | struct inode *inode; | 459 | struct inode *inode; |
450 | 460 | ||
451 | save_mount_options(sb, data); | ||
452 | |||
453 | pstore_sb = sb; | 461 | pstore_sb = sb; |
454 | 462 | ||
455 | sb->s_maxbytes = MAX_LFS_FILESIZE; | 463 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
diff --git a/fs/pstore/internal.h b/fs/pstore/internal.h index c416e653dc4f..4d5913130580 100644 --- a/fs/pstore/internal.h +++ b/fs/pstore/internal.h | |||
@@ -5,6 +5,9 @@ | |||
5 | #include <linux/time.h> | 5 | #include <linux/time.h> |
6 | #include <linux/pstore.h> | 6 | #include <linux/pstore.h> |
7 | 7 | ||
8 | #define PSTORE_DEFAULT_KMSG_BYTES 10240 | ||
9 | extern unsigned long kmsg_bytes; | ||
10 | |||
8 | #ifdef CONFIG_PSTORE_FTRACE | 11 | #ifdef CONFIG_PSTORE_FTRACE |
9 | extern void pstore_register_ftrace(void); | 12 | extern void pstore_register_ftrace(void); |
10 | extern void pstore_unregister_ftrace(void); | 13 | extern void pstore_unregister_ftrace(void); |
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index d468eec9b8a6..6640df40908d 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
@@ -99,7 +99,7 @@ static char *big_oops_buf; | |||
99 | static size_t big_oops_buf_sz; | 99 | static size_t big_oops_buf_sz; |
100 | 100 | ||
101 | /* How much of the console log to snapshot */ | 101 | /* How much of the console log to snapshot */ |
102 | static unsigned long kmsg_bytes = 10240; | 102 | unsigned long kmsg_bytes = PSTORE_DEFAULT_KMSG_BYTES; |
103 | 103 | ||
104 | void pstore_set_kmsg_bytes(int bytes) | 104 | void pstore_set_kmsg_bytes(int bytes) |
105 | { | 105 | { |