lkml.org 
[lkml]   [2016]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/2] pstore/ram: Set pstore flags dynamically
Date
The ramoops can be configured to enable each pstore type by setting
their size. In that case, it'd be better not to register disabled types
in the first place.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
fs/pstore/ram.c | 8 +++++++-
include/linux/pstore.h | 2 --
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index d08bfd611b11..80a4d44464fc 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -539,7 +539,13 @@ static int ramoops_probe(struct platform_device *pdev)
goto fail_clear;
}

- cxt->pstore.flags = PSTORE_FLAGS_ALL;
+ cxt->pstore.flags = PSTORE_FLAGS_DMESG;
+ if (ctx->console_size)
+ cxt->pstore.flags |= PSTORE_FLAGS_CONOLE;
+ if (ctx->ftrace_size)
+ cxt->pstore.flags |= PSTORE_FLAGS_FTRACE;
+ if (ctx->pmsg_size)
+ cxt->pstore.flags |= PSTORE_FLAGS_PMSG;

err = pstore_register(&cxt->pstore);
if (err) {
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 3ba0c1af40e5..a6d80bd960cb 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -78,8 +78,6 @@ struct pstore_info {
#define PSTORE_FLAGS_FTRACE (1 << 2)
#define PSTORE_FLAGS_PMSG (1 << 3)

-#define PSTORE_FLAGS_ALL ((1 << 4) - 1)
-
extern int pstore_register(struct pstore_info *);
extern void pstore_unregister(struct pstore_info *);
extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason);
--
2.8.0
\
 
 \ /
  Last update: 2016-07-21 03:21    [W:0.057 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site