Skip to content

Commit dee28e7

Browse files
Matthew Garrettaegl
Matthew Garrett
authored andcommitted
pstore: Allow the user to explicitly choose a backend
pstore only allows one backend to be registered at present, but the system may provide several. Add a parameter to allow the user to choose which backend will be used rather than just relying on load order. Signed-off-by: Matthew Garrett <[email protected]> Signed-off-by: Tony Luck <[email protected]>
1 parent b94fdd0 commit dee28e7

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

Documentation/ABI/testing/pstore

+6
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ Description: Generic interface to platform dependent persistent storage.
3939
multiple) files based on the record size of the underlying
4040
persistent storage until at least this amount is reached.
4141
Default is 10 Kbytes.
42+
43+
Pstore only supports one backend at a time. If multiple
44+
backends are available, the preferred backend may be
45+
set by passing the pstore.backend= argument to the kernel at
46+
boot time.
47+

Documentation/kernel-parameters.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
21512151
[HW,MOUSE] Controls Logitech smartscroll autorepeat.
21522152
0 = disabled, 1 = enabled (default).
21532153

2154+
pstore.backend= Specify the name of the pstore backend to use
2155+
21542156
pt. [PARIDE]
21552157
See Documentation/blockdev/paride.txt.
21562158

fs/pstore/platform.c

+11
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
static DEFINE_SPINLOCK(pstore_lock);
3838
static struct pstore_info *psinfo;
3939

40+
static char *backend;
41+
4042
/* How much of the console log to snapshot */
4143
static unsigned long kmsg_bytes = 10240;
4244

@@ -131,6 +133,12 @@ int pstore_register(struct pstore_info *psi)
131133
spin_unlock(&pstore_lock);
132134
return -EBUSY;
133135
}
136+
137+
if (backend && strcmp(backend, psi->name)) {
138+
spin_unlock(&pstore_lock);
139+
return -EINVAL;
140+
}
141+
134142
psinfo = psi;
135143
spin_unlock(&pstore_lock);
136144

@@ -208,3 +216,6 @@ int pstore_write(enum pstore_type_id type, char *buf, size_t size)
208216
return 0;
209217
}
210218
EXPORT_SYMBOL_GPL(pstore_write);
219+
220+
module_param(backend, charp, 0444);
221+
MODULE_PARM_DESC(backend, "Pstore backend to use");

0 commit comments

Comments
 (0)