This function will be called from the upcoming bfetch command to
determine whether the running barebox has functional pstore support.

Signed-off-by: Ahmad Fatoum <a.fat...@barebox.org>
---
 fs/pstore/platform.c   | 5 +++++
 include/linux/pstore.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 50a1bffdd053..3157cc90d514 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -46,6 +46,11 @@ void pstore_set_kmsg_bytes(int bytes)
 
 static int pstore_ready;
 
+bool pstore_is_ready(void)
+{
+       return pstore_ready;
+}
+
 void pstore_log(const char *str)
 {
        uint64_t id;
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 90e3bd2d4255..a3e6a26be94c 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -83,6 +83,7 @@ struct pstore_info {
 #ifdef CONFIG_FS_PSTORE
 extern int pstore_register(struct pstore_info *);
 extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason);
+extern bool pstore_is_ready(void);
 extern void pstore_log(const char *msg);
 #else
 static inline int
@@ -95,6 +96,10 @@ pstore_cannot_block_path(enum kmsg_dump_reason reason)
 {
        return false;
 }
+static inline bool pstore_is_ready(void)
+{
+       return false;
+}
 static inline void pstore_log(const char *msg)
 {
 }
-- 
2.39.5


Reply via email to