aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/lockspace.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-04-28 10:51:53 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-04-28 10:51:53 -0400
commitc56b39cd2c55d521597f04bbd872a08d1c4373ca (patch)
tree6f88b8a371e5d555f2ed3c66c21855595a0f2519 /fs/dlm/lockspace.c
parent1c032c03117c014512195f2e33c3af999f132146 (diff)
[DLM] PATCH 3/3 dlm: show recover state
Expose the current recovery state in sysfs to help in debugging. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm/lockspace.c')
-rw-r--r--fs/dlm/lockspace.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index d2ff505d51cd..9ed4b70348fb 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -21,6 +21,7 @@
21#include "config.h" 21#include "config.h"
22#include "memory.h" 22#include "memory.h"
23#include "lock.h" 23#include "lock.h"
24#include "recover.h"
24 25
25#ifdef CONFIG_DLM_DEBUG 26#ifdef CONFIG_DLM_DEBUG
26int dlm_create_debug_file(struct dlm_ls *ls); 27int 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 return len; 75 return len;
75} 76}
76 77
78static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf)
79{
80 uint32_t status = dlm_recover_status(ls);
81 return sprintf(buf, "%x\n", status);
82}
83
77struct dlm_attr { 84struct dlm_attr {
78 struct attribute attr; 85 struct attribute attr;
79 ssize_t (*show)(struct dlm_ls *, char *); 86 ssize_t (*show)(struct dlm_ls *, char *);
@@ -96,10 +103,16 @@ static struct dlm_attr dlm_attr_id = {
96 .store = dlm_id_store 103 .store = dlm_id_store
97}; 104};
98 105
106static struct dlm_attr dlm_attr_recover_status = {
107 .attr = {.name = "recover_status", .mode = S_IRUGO},
108 .show = dlm_recover_status_show
109};
110
99static struct attribute *dlm_attrs[] = { 111static struct attribute *dlm_attrs[] = {
100 &dlm_attr_control.attr, 112 &dlm_attr_control.attr,
101 &dlm_attr_event.attr, 113 &dlm_attr_event.attr,
102 &dlm_attr_id.attr, 114 &dlm_attr_id.attr,
115 &dlm_attr_recover_status.attr,
103 NULL, 116 NULL,
104}; 117};
105 118