aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pstore_ram.h
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2016-10-20 00:34:01 -0700
committerKees Cook <keescook@chromium.org>2016-11-15 16:34:25 -0800
commit663deb47880f2283809669563c5a52ac7c6aef1a (patch)
treefdfbc8b4d4abcfdf55bc348ac266528912938ed1 /include/linux/pstore_ram.h
parentpstore: Warn on PSTORE_TYPE_PMSG using deprecated function (diff)
downloadlinux-dev-663deb47880f2283809669563c5a52ac7c6aef1a.tar.xz
linux-dev-663deb47880f2283809669563c5a52ac7c6aef1a.zip
pstore: Allow prz to control need for locking
In preparation of not locking at all for certain buffers depending on if there's contention, make locking optional depending on the initialization of the prz. Signed-off-by: Joel Fernandes <joelaf@google.com> [kees: moved locking flag into prz instead of via caller arguments] Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'include/linux/pstore_ram.h')
-rw-r--r--include/linux/pstore_ram.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h
index 244d2423dbaf..4058bf991868 100644
--- a/include/linux/pstore_ram.h
+++ b/include/linux/pstore_ram.h
@@ -24,6 +24,13 @@
#include <linux/list.h>
#include <linux/types.h>
+/*
+ * Choose whether access to the RAM zone requires locking or not. If a zone
+ * can be written to from different CPUs like with ftrace for example, then
+ * PRZ_FLAG_NO_LOCK is used. For all other cases, locking is required.
+ */
+#define PRZ_FLAG_NO_LOCK BIT(0)
+
struct persistent_ram_buffer;
struct rs_control;
@@ -40,6 +47,7 @@ struct persistent_ram_zone {
void *vaddr;
struct persistent_ram_buffer *buffer;
size_t buffer_size;
+ u32 flags;
raw_spinlock_t buffer_lock;
/* ECC correction */
@@ -56,7 +64,7 @@ struct persistent_ram_zone {
struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
u32 sig, struct persistent_ram_ecc_info *ecc_info,
- unsigned int memtype);
+ unsigned int memtype, u32 flags);
void persistent_ram_free(struct persistent_ram_zone *prz);
void persistent_ram_zap(struct persistent_ram_zone *prz);