Commit dee28e72 authored by Matthew Garrett's avatar Matthew Garrett Committed by Tony Luck

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: default avatarMatthew Garrett <mjg@redhat.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent b94fdd07
...@@ -39,3 +39,9 @@ Description: Generic interface to platform dependent persistent storage. ...@@ -39,3 +39,9 @@ Description: Generic interface to platform dependent persistent storage.
multiple) files based on the record size of the underlying multiple) files based on the record size of the underlying
persistent storage until at least this amount is reached. persistent storage until at least this amount is reached.
Default is 10 Kbytes. Default is 10 Kbytes.
Pstore only supports one backend at a time. If multiple
backends are available, the preferred backend may be
set by passing the pstore.backend= argument to the kernel at
boot time.
...@@ -2151,6 +2151,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -2151,6 +2151,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
[HW,MOUSE] Controls Logitech smartscroll autorepeat. [HW,MOUSE] Controls Logitech smartscroll autorepeat.
0 = disabled, 1 = enabled (default). 0 = disabled, 1 = enabled (default).
pstore.backend= Specify the name of the pstore backend to use
pt. [PARIDE] pt. [PARIDE]
See Documentation/blockdev/paride.txt. See Documentation/blockdev/paride.txt.
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
static DEFINE_SPINLOCK(pstore_lock); static DEFINE_SPINLOCK(pstore_lock);
static struct pstore_info *psinfo; static struct pstore_info *psinfo;
static char *backend;
/* How much of the console log to snapshot */ /* How much of the console log to snapshot */
static unsigned long kmsg_bytes = 10240; static unsigned long kmsg_bytes = 10240;
...@@ -131,6 +133,12 @@ int pstore_register(struct pstore_info *psi) ...@@ -131,6 +133,12 @@ int pstore_register(struct pstore_info *psi)
spin_unlock(&pstore_lock); spin_unlock(&pstore_lock);
return -EBUSY; return -EBUSY;
} }
if (backend && strcmp(backend, psi->name)) {
spin_unlock(&pstore_lock);
return -EINVAL;
}
psinfo = psi; psinfo = psi;
spin_unlock(&pstore_lock); spin_unlock(&pstore_lock);
...@@ -208,3 +216,6 @@ int pstore_write(enum pstore_type_id type, char *buf, size_t size) ...@@ -208,3 +216,6 @@ int pstore_write(enum pstore_type_id type, char *buf, size_t size)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(pstore_write); EXPORT_SYMBOL_GPL(pstore_write);
module_param(backend, charp, 0444);
MODULE_PARM_DESC(backend, "Pstore backend to use");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment