From 79d955af711a6e20207783590a2cfddbd649568b Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Thu, 28 Jul 2016 00:08:26 +0900 Subject: pstore/ram: Set pstore flags dynamically 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. Cc: Anton Vorontsov Cc: Colin Cross Cc: Kees Cook Cc: Tony Luck Signed-off-by: Namhyung Kim Signed-off-by: Kees Cook --- fs/pstore/ram.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'fs/pstore/ram.c') diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index c2ebf5084977..08597c524439 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -623,7 +623,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 (cxt->console_size) + cxt->pstore.flags |= PSTORE_FLAGS_CONSOLE; + if (cxt->ftrace_size) + cxt->pstore.flags |= PSTORE_FLAGS_FTRACE; + if (cxt->pmsg_size) + cxt->pstore.flags |= PSTORE_FLAGS_PMSG; err = pstore_register(&cxt->pstore); if (err) { -- cgit v1.2.3