Skip to content

Commit 349d743

Browse files
dhowellsAl Viro
authored andcommitted
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 <[email protected]> cc: Kees Cook <[email protected]> cc: Anton Vorontsov <[email protected]> cc: Colin Cross <[email protected]> cc: Tony Luck <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent d86efb0 commit 349d743

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

fs/pstore/inode.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,16 @@ static void parse_options(char *options)
283283
}
284284
}
285285

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+
286296
static int pstore_remount(struct super_block *sb, int *flags, char *data)
287297
{
288298
sync_filesystem(sb);
@@ -296,7 +306,7 @@ static const struct super_operations pstore_ops = {
296306
.drop_inode = generic_delete_inode,
297307
.evict_inode = pstore_evict_inode,
298308
.remount_fs = pstore_remount,
299-
.show_options = generic_show_options,
309+
.show_options = pstore_show_options,
300310
};
301311

302312
static struct super_block *pstore_sb;
@@ -448,8 +458,6 @@ static int pstore_fill_super(struct super_block *sb, void *data, int silent)
448458
{
449459
struct inode *inode;
450460

451-
save_mount_options(sb, data);
452-
453461
pstore_sb = sb;
454462

455463
sb->s_maxbytes = MAX_LFS_FILESIZE;

fs/pstore/internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include <linux/time.h>
66
#include <linux/pstore.h>
77

8+
#define PSTORE_DEFAULT_KMSG_BYTES 10240
9+
extern unsigned long kmsg_bytes;
10+
811
#ifdef CONFIG_PSTORE_FTRACE
912
extern void pstore_register_ftrace(void);
1013
extern void pstore_unregister_ftrace(void);

fs/pstore/platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static char *big_oops_buf;
9999
static size_t big_oops_buf_sz;
100100

101101
/* How much of the console log to snapshot */
102-
static unsigned long kmsg_bytes = 10240;
102+
unsigned long kmsg_bytes = PSTORE_DEFAULT_KMSG_BYTES;
103103

104104
void pstore_set_kmsg_bytes(int bytes)
105105
{

0 commit comments

Comments
 (0)