Skip to contentSkip to conversation

dlm: better handling of first lock

PATCH New David Teigland 1 participant 1 message Jul 15, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 7/12 dlm: better handling of first lock

The first lock taken on an rsb is treated specially because the resource master needs to be looked up. There were some potential problems with this during recovery, and the whole thing was becoming too complex. This simplifies the special first-lock case and solves the problems.

drivers/dlm/debug_fs.c +7 -2
Index: linux-2.6.12-mm1/drivers/dlm/debug_fs.c
===================================================================
@@ -99,11 +99,16 @@ static int print_resource(struct dlm_rsb
 		else
 			seq_printf(s, "%c", '.');
 	}
-	if (res->res_nodeid)
+	if (res->res_nodeid > 0)
 		seq_printf(s, "\"  \nLocal Copy, Master is node %d\n",
 			   res->res_nodeid);
-	else
+	else if (res->res_nodeid == 0)
 		seq_printf(s, "\"  \nMaster Copy\n");
+	else if (res->res_nodeid == -1)
+		seq_printf(s, "\"  \nLooking up master (lkid %x)\n",
+			   res->res_first_lkid);
+	else
+		seq_printf(s, "\"  \nInvalid master %d\n", res->res_nodeid);
 
 	/* Print the LVB: */
 	if (res->res_lvbptr) {
drivers/dlm/dlm_internal.h +2 -3
Index: linux-2.6.12-mm1/drivers/dlm/dlm_internal.h
===================================================================
@@ -272,8 +272,8 @@ struct dlm_rsb {
 	uint32_t                res_lvbseq;
 	uint32_t		res_bucket;	/* rsbtbl */
 	unsigned long		res_toss_time;
-	uint32_t		res_trial_lkid;	/* lkb trying lookup result */
-	struct list_head	res_lookup;	/* lkbs waiting lookup confirm*/
+	uint32_t		res_first_lkid;
+	struct list_head	res_lookup;	/* lkbs waiting on first */
 	struct list_head	res_hashchain;	/* rsbtbl */
 	struct list_head	res_grantqueue;
 	struct list_head	res_convertqueue;
@@ -295,7 +295,6 @@ struct dlm_rsb {
 /* rsb_flags */
 
 enum rsb_flags {
-	RSB_MASTER_WAIT,
 	RSB_MASTER_UNCERTAIN,
 	RSB_VALNOTVALID,
 	RSB_VALNOTVALID_PREV,
drivers/dlm/lock.c +59 -93

282 lines not on this page · raw message

--