]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[DLM] lock_dlm recover_status patch
authorDavid Teigland <teigland@redhat.com>
Wed, 26 Apr 2006 19:56:35 +0000 (15:56 -0400)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 26 Apr 2006 19:56:35 +0000 (15:56 -0400)
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>
fs/gfs2/locking/dlm/lock_dlm.h
fs/gfs2/locking/dlm/mount.c
fs/gfs2/locking/dlm/sysfs.c

index 6d76146953cea50660744325cfc41deefa21f0a9..e6c1e4786fec0585db264285fc8e9c29463a2345 100644 (file)
@@ -70,6 +70,7 @@ struct gdlm_ls {
        lm_fsdata_t             *fsdata;
        int                     recover_jid;
        int                     recover_jid_done;
+       int                     recover_jid_status;
        spinlock_t              async_lock;
        struct list_head        complete;
        struct list_head        blocking;
index 026f05ce168d6687d091c24f80401e0f36ce8605..aa79fbecaf6a1e2ffbffd75bcd87d67fc16360e9 100644 (file)
@@ -203,6 +203,7 @@ static void gdlm_recovery_done(lm_lockspace_t *lockspace, unsigned int jid,
 {
        struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
        ls->recover_jid_done = jid;
+       ls->recover_jid_status = message;
        kobject_uevent(&ls->kobj, KOBJ_CHANGE);
 }
 
index e1e5186c97c9f089f79d37231ab119f29b2c83b5..0d8bd0806dba9e9c085b03f73405fdd2d0756d0b 100644 (file)
@@ -110,6 +110,11 @@ static ssize_t recover_done_show(struct gdlm_ls *ls, char *buf)
        return sprintf(buf, "%d\n", ls->recover_jid_done);
 }
 
+static ssize_t recover_status_show(struct gdlm_ls *ls, char *buf)
+{
+       return sprintf(buf, "%d\n", ls->recover_jid_status);
+}
+
 struct gdlm_attr {
        struct attribute attr;
        ssize_t (*show)(struct gdlm_ls *, char *);
@@ -119,15 +124,16 @@ struct gdlm_attr {
 #define GDLM_ATTR(_name,_mode,_show,_store) \
 static struct gdlm_attr gdlm_attr_##_name = __ATTR(_name,_mode,_show,_store)
 
-GDLM_ATTR(proto_name,   0444, proto_name_show,   NULL);
-GDLM_ATTR(block,        0644, block_show,        block_store);
-GDLM_ATTR(withdraw,     0644, withdraw_show,     withdraw_store);
-GDLM_ATTR(id,           0444, id_show,           NULL);
-GDLM_ATTR(jid,          0444, jid_show,          NULL);
-GDLM_ATTR(first,        0444, first_show,        NULL);
-GDLM_ATTR(first_done,   0444, first_done_show,   NULL);
-GDLM_ATTR(recover,      0644, recover_show,      recover_store);
-GDLM_ATTR(recover_done, 0444, recover_done_show, NULL);
+GDLM_ATTR(proto_name,     0444, proto_name_show,     NULL);
+GDLM_ATTR(block,          0644, block_show,          block_store);
+GDLM_ATTR(withdraw,       0644, withdraw_show,       withdraw_store);
+GDLM_ATTR(id,             0444, id_show,             NULL);
+GDLM_ATTR(jid,            0444, jid_show,            NULL);
+GDLM_ATTR(first,          0444, first_show,          NULL);
+GDLM_ATTR(first_done,     0444, first_done_show,     NULL);
+GDLM_ATTR(recover,        0644, recover_show,        recover_store);
+GDLM_ATTR(recover_done,   0444, recover_done_show,   NULL);
+GDLM_ATTR(recover_status, 0444, recover_status_show, NULL);
 
 static struct attribute *gdlm_attrs[] = {
        &gdlm_attr_proto_name.attr,
@@ -139,6 +145,7 @@ static struct attribute *gdlm_attrs[] = {
        &gdlm_attr_first_done.attr,
        &gdlm_attr_recover.attr,
        &gdlm_attr_recover_done.attr,
+       &gdlm_attr_recover_status.attr,
        NULL,
 };