Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jan 2008 18:18:05 GMT
From:      Scott Long <scottl@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 133567 for review
Message-ID:  <200801181818.m0III5UH010674@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133567

Change 133567 by scottl@scottl-ix on 2008/01/18 18:17:17

	Reduce the size of the hammer used in the message passer, and
	fix some nearby style.

Affected files ...

.. //depot/projects/xen31-xenbus/sys/xen/xenbus/xenbus_xs.c#3 edit

Differences ...

==== //depot/projects/xen31-xenbus/sys/xen/xenbus/xenbus_xs.c#3 (text+ko) ====

@@ -142,41 +142,40 @@
 
 static void *read_reply(enum xsd_sockmsg_type *type, unsigned int *len)
 {
-		struct xs_stored_msg *msg;
-		char *body;
-		int i;
-			 
-		
-		spin_lock(&xs_state.reply_lock);
+	struct xs_stored_msg *msg;
+	char *body;
+	int i;
+
+	spin_lock(&xs_state.reply_lock);
 
-		while (list_empty(&xs_state.reply_list)) {
-			spin_unlock(&xs_state.reply_lock);
-			if (scheduler_running == 0) {
-				/*
-				 * Give other domain time to run :-/
-				 */
-				for (i = 0; i < 1000000; i++)
-					HYPERVISOR_yield();
-				xs_process_msg();
-			}
-			wait_event_interruptible(&xs_state.reply_waitq,
-			    !list_empty(&xs_state.reply_list));
-			spin_lock(&xs_state.reply_lock);
+	while (list_empty(&xs_state.reply_list)) {
+		spin_unlock(&xs_state.reply_lock);
+		if (scheduler_running == 0) {
+			/*
+			 * Give other domain time to run :-/
+			 */
+			for (i = 0; i < 1000; i++)
+				HYPERVISOR_yield();
+			xs_process_msg();
 		}
+		wait_event_interruptible(&xs_state.reply_waitq,
+		    !list_empty(&xs_state.reply_list));
+		spin_lock(&xs_state.reply_lock);
+	}
 
-		msg = TAILQ_FIRST(&xs_state.reply_list);
-		list_del(&xs_state.reply_list, msg);
+	msg = TAILQ_FIRST(&xs_state.reply_list);
+	list_del(&xs_state.reply_list, msg);
 
-		spin_unlock(&xs_state.reply_lock);
+	spin_unlock(&xs_state.reply_lock);
 
-		*type = msg->hdr.type;
-		if (len)
-				*len = msg->hdr.len;
-		body = msg->u.reply.body;
+	*type = msg->hdr.type;
+	if (len)
+		*len = msg->hdr.len;
+	body = msg->u.reply.body;
 
-		kfree(msg);
+	kfree(msg);
 
-		return body;
+	return body;
 }
 
 #if 0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801181818.m0III5UH010674>