aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-04-26 15:56:35 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-04-26 15:56:35 -0400
commit6bd70aba5ab453459bb53b1e29f0e0650d6c311f (patch)
tree4fd79cf7dd69c19e08d7fcd0222e83d9b9358ffe /fs/gfs2/locking
parent579b78a43b366d51f9c888afaf1eab1f4ea599fa (diff)
[DLM] lock_dlm recover_status patch
This saves the journal recovery result and makes it visible through sysfs. User space needs to know if the node actually recovered the journal or tried and gave up. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r--fs/gfs2/locking/dlm/lock_dlm.h1
-rw-r--r--fs/gfs2/locking/dlm/mount.c1
-rw-r--r--fs/gfs2/locking/dlm/sysfs.c25
3 files changed, 18 insertions, 9 deletions
diff --git a/fs/gfs2/locking/dlm/lock_dlm.h b/fs/gfs2/locking/dlm/lock_dlm.h
index 6d76146953ce..e6c1e4786fec 100644
--- a/fs/gfs2/locking/dlm/lock_dlm.h
+++ b/fs/gfs2/locking/dlm/lock_dlm.h
@@ -70,6 +70,7 @@ struct gdlm_ls {
70 lm_fsdata_t *fsdata; 70 lm_fsdata_t *fsdata;
71 int recover_jid; 71 int recover_jid;
72 int recover_jid_done; 72 int recover_jid_done;
73 int recover_jid_status;
73 spinlock_t async_lock; 74 spinlock_t async_lock;
74 struct list_head complete; 75 struct list_head complete;
75 struct list_head blocking; 76 struct list_head blocking;
diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c
index 026f05ce168d..aa79fbecaf6a 100644
--- a/fs/gfs2/locking/dlm/mount.c
+++ b/fs/gfs2/locking/dlm/mount.c
@@ -203,6 +203,7 @@ static void gdlm_recovery_done(lm_lockspace_t *lockspace, unsigned int jid,
203{ 203{
204 struct gdlm_ls *ls = (struct gdlm_ls *) lockspace; 204 struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
205 ls->recover_jid_done = jid; 205 ls->recover_jid_done = jid;
206 ls->recover_jid_status = message;
206 kobject_uevent(&ls->kobj, KOBJ_CHANGE); 207 kobject_uevent(&ls->kobj, KOBJ_CHANGE);
207} 208}
208 209
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c
index e1e5186c97c9..0d8bd0806dba 100644
--- a/fs/gfs2/locking/dlm/sysfs.c
+++ b/fs/gfs2/locking/dlm/sysfs.c
@@ -110,6 +110,11 @@ static ssize_t recover_done_show(struct gdlm_ls *ls, char *buf)
110 return sprintf(buf, "%d\n", ls->recover_jid_done); 110 return sprintf(buf, "%d\n", ls->recover_jid_done);
111} 111}
112 112
113static ssize_t recover_status_show(struct gdlm_ls *ls, char *buf)
114{
115 return sprintf(buf, "%d\n", ls->recover_jid_status);
116}
117
113struct gdlm_attr { 118struct gdlm_attr {
114 struct attribute attr; 119 struct attribute attr;
115 ssize_t (*show)(struct gdlm_ls *, char *); 120 ssize_t (*show)(struct gdlm_ls *, char *);
@@ -119,15 +124,16 @@ struct gdlm_attr {
119#define GDLM_ATTR(_name,_mode,_show,_store) \ 124#define GDLM_ATTR(_name,_mode,_show,_store) \
120static struct gdlm_attr gdlm_attr_##_name = __ATTR(_name,_mode,_show,_store) 125static struct gdlm_attr gdlm_attr_##_name = __ATTR(_name,_mode,_show,_store)
121 126
122GDLM_ATTR(proto_name, 0444, proto_name_show, NULL); 127GDLM_ATTR(proto_name, 0444, proto_name_show, NULL);
123GDLM_ATTR(block, 0644, block_show, block_store); 128GDLM_ATTR(block, 0644, block_show, block_store);
124GDLM_ATTR(withdraw, 0644, withdraw_show, withdraw_store); 129GDLM_ATTR(withdraw, 0644, withdraw_show, withdraw_store);
125GDLM_ATTR(id, 0444, id_show, NULL); 130GDLM_ATTR(id, 0444, id_show, NULL);
126GDLM_ATTR(jid, 0444, jid_show, NULL); 131GDLM_ATTR(jid, 0444, jid_show, NULL);
127GDLM_ATTR(first, 0444, first_show, NULL); 132GDLM_ATTR(first, 0444, first_show, NULL);
128GDLM_ATTR(first_done, 0444, first_done_show, NULL); 133GDLM_ATTR(first_done, 0444, first_done_show, NULL);
129GDLM_ATTR(recover, 0644, recover_show, recover_store); 134GDLM_ATTR(recover, 0644, recover_show, recover_store);
130GDLM_ATTR(recover_done, 0444, recover_done_show, NULL); 135GDLM_ATTR(recover_done, 0444, recover_done_show, NULL);
136GDLM_ATTR(recover_status, 0444, recover_status_show, NULL);
131 137
132static struct attribute *gdlm_attrs[] = { 138static struct attribute *gdlm_attrs[] = {
133 &gdlm_attr_proto_name.attr, 139 &gdlm_attr_proto_name.attr,
@@ -139,6 +145,7 @@ static struct attribute *gdlm_attrs[] = {
139 &gdlm_attr_first_done.attr, 145 &gdlm_attr_first_done.attr,
140 &gdlm_attr_recover.attr, 146 &gdlm_attr_recover.attr,
141 &gdlm_attr_recover_done.attr, 147 &gdlm_attr_recover_done.attr,
148 &gdlm_attr_recover_status.attr,
142 NULL, 149 NULL,
143}; 150};
144 151