diff options
author | Matthew Garrett <mjg@redhat.com> | 2011-07-21 16:57:55 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2011-07-22 19:14:39 -0400 |
commit | dee28e72b619b48ec80a9e5509db458dbe66f71f (patch) | |
tree | 781ef74fc42193f05877af53fe0787d175181bd7 /fs/pstore | |
parent | b94fdd077eef5e6cab56836bf62695b497946716 (diff) |
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 <mjg@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'fs/pstore')
-rw-r--r-- | fs/pstore/platform.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 49ff1de2178a..c5300ec31696 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
@@ -37,6 +37,8 @@ | |||
37 | static DEFINE_SPINLOCK(pstore_lock); | 37 | static DEFINE_SPINLOCK(pstore_lock); |
38 | static struct pstore_info *psinfo; | 38 | static struct pstore_info *psinfo; |
39 | 39 | ||
40 | static char *backend; | ||
41 | |||
40 | /* How much of the console log to snapshot */ | 42 | /* How much of the console log to snapshot */ |
41 | static unsigned long kmsg_bytes = 10240; | 43 | static unsigned long kmsg_bytes = 10240; |
42 | 44 | ||
@@ -131,6 +133,12 @@ int pstore_register(struct pstore_info *psi) | |||
131 | spin_unlock(&pstore_lock); | 133 | spin_unlock(&pstore_lock); |
132 | return -EBUSY; | 134 | return -EBUSY; |
133 | } | 135 | } |
136 | |||
137 | if (backend && strcmp(backend, psi->name)) { | ||
138 | spin_unlock(&pstore_lock); | ||
139 | return -EINVAL; | ||
140 | } | ||
141 | |||
134 | psinfo = psi; | 142 | psinfo = psi; |
135 | spin_unlock(&pstore_lock); | 143 | spin_unlock(&pstore_lock); |
136 | 144 | ||
@@ -208,3 +216,6 @@ int pstore_write(enum pstore_type_id type, char *buf, size_t size) | |||
208 | return 0; | 216 | return 0; |
209 | } | 217 | } |
210 | EXPORT_SYMBOL_GPL(pstore_write); | 218 | EXPORT_SYMBOL_GPL(pstore_write); |
219 | |||
220 | module_param(backend, charp, 0444); | ||
221 | MODULE_PARM_DESC(backend, "Pstore backend to use"); | ||