Commit c56b39cd authored by David Teigland's avatar David Teigland Committed by Steven Whitehouse

[DLM] PATCH 3/3 dlm: show recover state

Expose the current recovery state in sysfs to help in debugging.
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 1c032c03
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "config.h" #include "config.h"
#include "memory.h" #include "memory.h"
#include "lock.h" #include "lock.h"
#include "recover.h"
#ifdef CONFIG_DLM_DEBUG #ifdef CONFIG_DLM_DEBUG
int dlm_create_debug_file(struct dlm_ls *ls); int dlm_create_debug_file(struct dlm_ls *ls);
...@@ -74,6 +75,12 @@ static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len) ...@@ -74,6 +75,12 @@ static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len)
return len; return len;
} }
static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf)
{
uint32_t status = dlm_recover_status(ls);
return sprintf(buf, "%x\n", status);
}
struct dlm_attr { struct dlm_attr {
struct attribute attr; struct attribute attr;
ssize_t (*show)(struct dlm_ls *, char *); ssize_t (*show)(struct dlm_ls *, char *);
...@@ -96,10 +103,16 @@ static struct dlm_attr dlm_attr_id = { ...@@ -96,10 +103,16 @@ static struct dlm_attr dlm_attr_id = {
.store = dlm_id_store .store = dlm_id_store
}; };
static struct dlm_attr dlm_attr_recover_status = {
.attr = {.name = "recover_status", .mode = S_IRUGO},
.show = dlm_recover_status_show
};
static struct attribute *dlm_attrs[] = { static struct attribute *dlm_attrs[] = {
&dlm_attr_control.attr, &dlm_attr_control.attr,
&dlm_attr_event.attr, &dlm_attr_event.attr,
&dlm_attr_id.attr, &dlm_attr_id.attr,
&dlm_attr_recover_status.attr,
NULL, NULL,
}; };
......
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