[Cluster-devel] [PATCH 05/10] GFS2: Remove sysfs "done" files

Steven Whitehouse swhiteho at redhat.com
Wed Sep 16 15:03:37 UTC 2009


All recent userspace programs for GFS2 only require the uevents
and they don't read the (potentially racy) "done" files. This
patch removes the "done" files which are no longer used.

This also means that is it now potentially possible for a single
node to recover more than one journal at once. That won't happen
until such time as gfs_controld makes multiple requests though,
but all the kernel support is currently in place.

This also has the effect of slightly shrinking the GFS2 super
block (in core).

Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
---
 fs/gfs2/incore.h     |    4 ----
 fs/gfs2/ops_fstype.c |    3 +--
 fs/gfs2/recovery.c   |    4 +---
 fs/gfs2/sys.c        |   24 ------------------------
 4 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 6edb423..a564ac5 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -498,14 +498,10 @@ struct gfs2_sb_host {
 struct lm_lockstruct {
 	unsigned int ls_jid;
 	unsigned int ls_first;
-	unsigned int ls_first_done;
 	unsigned int ls_nodir;
 	const struct lm_lockops *ls_ops;
 	unsigned long ls_flags;
 	dlm_lockspace_t *ls_dlm;
-
-	int ls_recover_jid_done;
-	int ls_recover_jid_status;
 };
 
 struct gfs2_sbd {
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 5c8f8cc..a3e188d 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -626,8 +626,7 @@ static void gfs2_others_may_mount(struct gfs2_sbd *sdp)
 {
 	char *message = "FIRSTMOUNT=Done";
 	char *envp[] = { message, NULL };
-	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
-	ls->ls_first_done = 1;
+
 	kobject_uevent_env(&sdp->sd_kobj, KOBJ_CHANGE, envp);
 }
 
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index 59d2695..2aeb02d 100644
--- a/fs/gfs2/recovery.c
+++ b/fs/gfs2/recovery.c
@@ -431,9 +431,7 @@ static void gfs2_recovery_done(struct gfs2_sbd *sdp, unsigned int jid,
 	char env_jid[20];
 	char env_status[20];
 	char *envp[] = { env_jid, env_status, NULL };
-	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
-        ls->ls_recover_jid_done = jid;
-        ls->ls_recover_jid_status = message;
+
 	sprintf(env_jid, "JID=%d", jid);
 	sprintf(env_status, "RECOVERY=%s",
 		message == LM_RD_SUCCESS ? "Done" : "Failed");
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index be1b8ac..b9e68e6 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -326,12 +326,6 @@ static ssize_t lkfirst_show(struct gfs2_sbd *sdp, char *buf)
 	return sprintf(buf, "%d\n", ls->ls_first);
 }
 
-static ssize_t first_done_show(struct gfs2_sbd *sdp, char *buf)
-{
-	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
-	return sprintf(buf, "%d\n", ls->ls_first_done);
-}
-
 static ssize_t recover_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
 {
 	unsigned jid;
@@ -361,18 +355,6 @@ out:
 	return rv ? rv : len;
 }
 
-static ssize_t recover_done_show(struct gfs2_sbd *sdp, char *buf)
-{
-	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
-	return sprintf(buf, "%d\n", ls->ls_recover_jid_done);
-}
-
-static ssize_t recover_status_show(struct gfs2_sbd *sdp, char *buf)
-{
-	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
-	return sprintf(buf, "%d\n", ls->ls_recover_jid_status);
-}
-
 static ssize_t jid_show(struct gfs2_sbd *sdp, char *buf)
 {
 	return sprintf(buf, "%u\n", sdp->sd_lockstruct.ls_jid);
@@ -386,10 +368,7 @@ GDLM_ATTR(block,		0644, block_show,		block_store);
 GDLM_ATTR(withdraw,		0644, withdraw_show,		withdraw_store);
 GDLM_ATTR(jid,			0444, jid_show,			NULL);
 GDLM_ATTR(first,		0444, lkfirst_show,		NULL);
-GDLM_ATTR(first_done,		0444, first_done_show,		NULL);
 GDLM_ATTR(recover,		0600, NULL,			recover_store);
-GDLM_ATTR(recover_done,		0444, recover_done_show,	NULL);
-GDLM_ATTR(recover_status,	0444, recover_status_show,	NULL);
 
 static struct attribute *lock_module_attrs[] = {
 	&gdlm_attr_proto_name.attr,
@@ -397,10 +376,7 @@ static struct attribute *lock_module_attrs[] = {
 	&gdlm_attr_withdraw.attr,
 	&gdlm_attr_jid.attr,
 	&gdlm_attr_first.attr,
-	&gdlm_attr_first_done.attr,
 	&gdlm_attr_recover.attr,
-	&gdlm_attr_recover_done.attr,
-	&gdlm_attr_recover_status.attr,
 	NULL,
 };
 
-- 
1.6.2.5




More information about the Cluster-devel mailing list