mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>
Subject: [PATCH v3 2/2] pstore/ram: Set pstore flags dynamically
Date: Thu, 21 Jul 2016 09:59:18 +0900	[thread overview]
Message-ID: <1469062758-1190-2-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1469062758-1190-1-git-send-email-namhyung@kernel.org>

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

  reply	other threads:[~2016-07-21  1:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21  0:59 [PATCH v3 1/2] pstore: Split pstore fragile flags Namhyung Kim
2016-07-21  0:59 ` Namhyung Kim [this message]
2016-07-21 23:07   ` [PATCH v3 2/2] pstore/ram: Set pstore flags dynamically kbuild test robot
2016-07-22  0:17   ` kbuild test robot
2016-07-22 13:45 ` [PATCH v3.1 " Namhyung Kim
2016-09-08 20:37   ` Kees Cook
2016-09-09  5:56     ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469062758-1190-2-git-send-email-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®