[DRBD-cvs] svn commit by phil - r2569 - trunk/drbd - Renamed cstate_wait to misc_wait.

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Wed Oct 25 11:15:35 CEST 2006


Author: phil
Date: 2006-10-25 11:15:32 +0200 (Wed, 25 Oct 2006)
New Revision: 2569

Modified:
   trunk/drbd/drbd_int.h
   trunk/drbd/drbd_main.c
   trunk/drbd/drbd_nl.c
   trunk/drbd/drbd_receiver.c
   trunk/drbd/drbd_req.c
   trunk/drbd/drbd_worker.c
Log:
Renamed cstate_wait to misc_wait.


Modified: trunk/drbd/drbd_int.h
===================================================================
--- trunk/drbd/drbd_int.h	2006-10-24 15:00:12 UTC (rev 2568)
+++ trunk/drbd/drbd_int.h	2006-10-25 09:15:32 UTC (rev 2569)
@@ -777,7 +777,7 @@
 
 	drbd_state_t new_state_tmp; // Used after attach while negotiating new disk state.
 	drbd_state_t state;
-	wait_queue_head_t cstate_wait; // TODO Rename into "misc_wait".
+	wait_queue_head_t misc_wait;
 	wait_queue_head_t state_wait;  // upon each state change.
 	unsigned int send_cnt;
 	unsigned int recv_cnt;
@@ -1375,14 +1375,14 @@
 
 static inline void drbd_state_lock(drbd_dev *mdev)
 {
-	wait_event(mdev->cstate_wait,
+	wait_event(mdev->misc_wait,
 		   !test_and_set_bit(CLUSTER_ST_CHANGE,&mdev->flags));
 }
 
 static inline void drbd_state_unlock(drbd_dev *mdev)
 {
 	clear_bit(CLUSTER_ST_CHANGE,&mdev->flags);
-	wake_up(&mdev->cstate_wait);
+	wake_up(&mdev->misc_wait);
 }
 
 static inline int drbd_request_state(drbd_dev* mdev, drbd_state_t mask,
@@ -1618,7 +1618,7 @@
 #define dec_ap_pending(mdev)	do {				\
 	typecheck(drbd_dev*,mdev);				\
 	if(atomic_dec_and_test(&mdev->ap_pending_cnt))		\
-		wake_up(&mdev->cstate_wait);			\
+		wake_up(&mdev->misc_wait);			\
 	ERR_IF_CNT_IS_NEGATIVE(ap_pending_cnt); } while (0)
 
 /* counts how many resync-related answers we still expect from the peer
@@ -1665,7 +1665,7 @@
 static inline void dec_net(drbd_dev* mdev)
 {
 	if(atomic_dec_and_test(&mdev->net_cnt)) {
-		wake_up(&mdev->cstate_wait);
+		wake_up(&mdev->misc_wait);
 	}
 }
 
@@ -1692,7 +1692,7 @@
 static inline void dec_local(drbd_dev* mdev)
 {
 	if(atomic_dec_and_test(&mdev->local_cnt)) {
-		wake_up(&mdev->cstate_wait);
+		wake_up(&mdev->misc_wait);
 	}
 	D_ASSERT(atomic_read(&mdev->local_cnt)>=0);
 }
@@ -1760,10 +1760,10 @@
 
 	spin_lock_irq(&mdev->req_lock);
 	while (!__inc_ap_bio_cond(mdev)) {
-		prepare_to_wait(&mdev->cstate_wait,&wait,TASK_UNINTERRUPTIBLE);
+		prepare_to_wait(&mdev->misc_wait,&wait,TASK_UNINTERRUPTIBLE);
 		spin_unlock_irq(&mdev->req_lock);
 		schedule();
-		finish_wait(&mdev->cstate_wait, &wait);
+		finish_wait(&mdev->misc_wait, &wait);
 		spin_lock_irq(&mdev->req_lock);
 	}
 	spin_unlock_irq(&mdev->req_lock);
@@ -1775,7 +1775,7 @@
 	int ap_bio = atomic_dec_return(&mdev->ap_bio_cnt);
 
 	D_ASSERT(ap_bio>=0);
-	if (ap_bio < mxb) wake_up(&mdev->cstate_wait);
+	if (ap_bio < mxb) wake_up(&mdev->misc_wait);
 }
 
 static inline int seq_cmp(u32 a, u32 b)

Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c	2006-10-24 15:00:12 UTC (rev 2568)
+++ trunk/drbd/drbd_main.c	2006-10-25 09:15:32 UTC (rev 2569)
@@ -757,7 +757,7 @@
 #endif
 
 	mdev->state.i = ns.i;
-	wake_up(&mdev->cstate_wait);
+	wake_up(&mdev->misc_wait);
 	wake_up(&mdev->state_wait);
 
 	/**   post-state-change actions   **/
@@ -882,7 +882,7 @@
 		 * wait_event and inc_ap_bio.
 		 * Note: we may lose connection whilst waiting here.
 		 * no worries though, should work out ok... */
-		wait_event(mdev->cstate_wait,
+		wait_event(mdev->misc_wait,
 			mdev->state.conn != WFBitMapS ||
 			!atomic_read(&mdev->ap_bio_cnt));
 		drbd_bm_lock(mdev);   // {
@@ -998,7 +998,7 @@
 		/* since inc_local() only works as long as disk>=Inconsistent,
 		   and it is Diskless here, local_cnt can only go down, it can
 		   not increase... It will reach zero */
-		wait_event(mdev->cstate_wait, !atomic_read(&mdev->local_cnt));
+		wait_event(mdev->misc_wait, !atomic_read(&mdev->local_cnt));
 
 		drbd_free_bc(mdev->bc);	mdev->bc = NULL;
 		lc_free(mdev->resync);  mdev->resync = NULL;
@@ -1969,7 +1969,7 @@
 	mdev->md_sync_timer.function = md_sync_timer_fn;
 	mdev->md_sync_timer.data = (unsigned long) mdev;
 
-	init_waitqueue_head(&mdev->cstate_wait);
+	init_waitqueue_head(&mdev->misc_wait);
 	init_waitqueue_head(&mdev->state_wait);
 	init_waitqueue_head(&mdev->ee_wait);
 	init_waitqueue_head(&mdev->al_wait);

Modified: trunk/drbd/drbd_nl.c
===================================================================
--- trunk/drbd/drbd_nl.c	2006-10-24 15:00:12 UTC (rev 2568)
+++ trunk/drbd/drbd_nl.c	2006-10-25 09:15:32 UTC (rev 2569)
@@ -253,7 +253,7 @@
 	drbd_sync_me(mdev);
 
 	/* Wait until nothing is on the fly :) */
-	if ( wait_event_interruptible( mdev->cstate_wait,
+	if ( wait_event_interruptible( mdev->misc_wait,
 			         atomic_read(&mdev->ap_pending_cnt) == 0 ) ) {
 		r = GotSignal;
 		goto fail;
@@ -1129,7 +1129,7 @@
 
 	if( retcode < SS_Success ) goto fail;
 
-	if( wait_event_interruptible( mdev->cstate_wait,
+	if( wait_event_interruptible( mdev->misc_wait,
 				      mdev->state.conn==StandAlone) ) {
 		retcode = GotSignal;
 		goto fail;

Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c	2006-10-24 15:00:12 UTC (rev 2568)
+++ trunk/drbd/drbd_receiver.c	2006-10-25 09:15:32 UTC (rev 2569)
@@ -1368,7 +1368,7 @@
 		 *       queue (via done_ee) the DiscardAck; OUT.
 		 *
 		 * if any conflicting request is found:
-		 *       block the receiver, waiting on cstate_wait
+		 *       block the receiver, waiting on misc_wait
 		 *       until no more conflicting requests are there,
 		 *       or we get interrupted (disconnect).
 		 *
@@ -1391,7 +1391,7 @@
 		for(;;) {
 			int have_unacked = 0;
 			int have_conflict = 0;
-			prepare_to_wait(&mdev->cstate_wait,&wait,TASK_INTERRUPTIBLE);
+			prepare_to_wait(&mdev->misc_wait,&wait,TASK_INTERRUPTIBLE);
 			hlist_for_each_entry(i, n, slot, colision) {
 				if (OVERLAPS) {
 					if (first) {
@@ -1426,7 +1426,7 @@
 
 				dec_local(mdev);
 				wake_asender(mdev);
-				finish_wait(&mdev->cstate_wait, &wait);
+				finish_wait(&mdev->misc_wait, &wait);
 				return TRUE;
 			}
 
@@ -1435,7 +1435,7 @@
 
 				spin_unlock_irq(&mdev->req_lock);
 
-				finish_wait(&mdev->cstate_wait, &wait);
+				finish_wait(&mdev->misc_wait, &wait);
 				goto out_interrupted;
 			}
 
@@ -1452,7 +1452,7 @@
 			schedule();
 			spin_lock_irq(&mdev->req_lock);
 		}
-		finish_wait(&mdev->cstate_wait, &wait);
+		finish_wait(&mdev->misc_wait, &wait);
 	}
 
 	/* when using TCQ:
@@ -2323,7 +2323,7 @@
 {
 	Drbd_SyncUUID_Packet *p = (Drbd_SyncUUID_Packet*)h;
 
-	wait_event( mdev->cstate_wait, 
+	wait_event( mdev->misc_wait, 
 		    mdev->state.conn < Connected || mdev->state.conn == WFSyncUUID);
 
 	// D_ASSERT( mdev->state.conn == WFSyncUUID );
@@ -2596,7 +2596,7 @@
 	mdev->rs_total=0;
 	mdev->rs_failed=0;
 	atomic_set(&mdev->rs_pending_cnt,0);
-	wake_up(&mdev->cstate_wait);
+	wake_up(&mdev->misc_wait);
 
 	/* make sure syncer is stopped and w_resume_next_sg queued */
 	del_timer_sync(&mdev->resync_timer);
@@ -2609,7 +2609,7 @@
 	set_bit(WORK_PENDING,&mdev->flags);
 	prev_work_done.cb = w_prev_work_done;
 	drbd_queue_work(&mdev->data.work,&prev_work_done);
-	wait_event(mdev->cstate_wait, !test_bit(WORK_PENDING,&mdev->flags));
+	wait_event(mdev->misc_wait, !test_bit(WORK_PENDING,&mdev->flags));
 
 	if ( mdev->p_uuid ) {
 		kfree(mdev->p_uuid);
@@ -2647,7 +2647,7 @@
 	}
 
 	if(os.conn == Disconnecting) {
-		wait_event( mdev->cstate_wait,atomic_read(&mdev->net_cnt) == 0 );
+		wait_event( mdev->misc_wait,atomic_read(&mdev->net_cnt) == 0 );
 		if(mdev->ee_hash) {
 			kfree(mdev->ee_hash);
 			mdev->ee_hash = NULL;
@@ -2986,7 +2986,7 @@
 		ERR("Requested state change failed by peer: %s\n",
 		    set_st_err_name(retcode));
 	}
-	wake_up(&mdev->cstate_wait);
+	wake_up(&mdev->misc_wait);
 
 	return TRUE;
 }

Modified: trunk/drbd/drbd_req.c
===================================================================
--- trunk/drbd/drbd_req.c	2006-10-24 15:00:12 UTC (rev 2568)
+++ trunk/drbd/drbd_req.c	2006-10-25 09:15:32 UTC (rev 2569)
@@ -179,7 +179,7 @@
 				 * DiscardAck not yet sent by the asender...),
 				 * since we block the receiver thread upon the
 				 * first conflict detection, which will wait on
-				 * cstate_wait.  maybe we want to assert that?
+				 * misc_wait.  maybe we want to assert that?
 				 *
 				 * anyways, if we found one,
 				 * we just have to do a wake_up.  */
@@ -188,7 +188,7 @@
 				slot = ee_hash_slot(mdev,req->sector);
 				hlist_for_each_entry(e, n, slot, colision) {
 					if (OVERLAPS) {
-						wake_up(&mdev->cstate_wait);
+						wake_up(&mdev->misc_wait);
 						break;
 					}
 				}

Modified: trunk/drbd/drbd_worker.c
===================================================================
--- trunk/drbd/drbd_worker.c	2006-10-24 15:00:12 UTC (rev 2568)
+++ trunk/drbd/drbd_worker.c	2006-10-25 09:15:32 UTC (rev 2569)
@@ -558,7 +558,7 @@
 int w_prev_work_done(drbd_dev *mdev, struct drbd_work *w, int cancel)
 {
 	clear_bit(WORK_PENDING,&mdev->flags);
-	wake_up(&mdev->cstate_wait);
+	wake_up(&mdev->misc_wait);
 	return 1;
 }
 



More information about the drbd-cvs mailing list