Skip to content

Commit

Permalink
pstore: Implement show_options
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dhowells authored and Al Viro committed Jul 6, 2017
1 parent d86efb0 commit 349d743
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
14 changes: 11 additions & 3 deletions fs/pstore/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,16 @@ static void parse_options(char *options)
}
}

/*
* Display the mount options in /proc/mounts.
*/
static int pstore_show_options(struct seq_file *m, struct dentry *root)
{
if (kmsg_bytes != PSTORE_DEFAULT_KMSG_BYTES)
seq_printf(m, ",kmsg_bytes=%lu", kmsg_bytes);
return 0;
}

static int pstore_remount(struct super_block *sb, int *flags, char *data)
{
sync_filesystem(sb);
Expand All @@ -296,7 +306,7 @@ static const struct super_operations pstore_ops = {
.drop_inode = generic_delete_inode,
.evict_inode = pstore_evict_inode,
.remount_fs = pstore_remount,
.show_options = generic_show_options,
.show_options = pstore_show_options,
};

static struct super_block *pstore_sb;
Expand Down Expand Up @@ -448,8 +458,6 @@ static int pstore_fill_super(struct super_block *sb, void *data, int silent)
{
struct inode *inode;

save_mount_options(sb, data);

pstore_sb = sb;

sb->s_maxbytes = MAX_LFS_FILESIZE;
Expand Down
3 changes: 3 additions & 0 deletions fs/pstore/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include <linux/time.h>
#include <linux/pstore.h>

#define PSTORE_DEFAULT_KMSG_BYTES 10240
extern unsigned long kmsg_bytes;

#ifdef CONFIG_PSTORE_FTRACE
extern void pstore_register_ftrace(void);
extern void pstore_unregister_ftrace(void);
Expand Down
2 changes: 1 addition & 1 deletion fs/pstore/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static char *big_oops_buf;
static size_t big_oops_buf_sz;

/* How much of the console log to snapshot */
static unsigned long kmsg_bytes = 10240;
unsigned long kmsg_bytes = PSTORE_DEFAULT_KMSG_BYTES;

void pstore_set_kmsg_bytes(int bytes)
{
Expand Down

0 comments on commit 349d743

Please sign in to comment.