[SSI] openssi/kernel/cluster/ssi/ipc namesvr_func.c,1.22,1.23

Roger Tsang <[email protected]> Thu, 06 May 2010 05:24:39 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/ipc
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12372/cluster/ssi/ipc

Modified Files:
      Tag: OPENSSI-FC
	namesvr_func.c 
Log Message:
Get rid of compiler warnings in objsvr_find_key() and nsc_ipcremove() when CONFIG_PREEMPT is defined. (#ifdef SSI_IPC_OBJ_DB_LOCKLESS)


Index: namesvr_func.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/ipc/namesvr_func.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- namesvr_func.c	29 Mar 2010 06:17:00 -0000	1.22
+++ namesvr_func.c	6 May 2010 05:24:36 -0000	1.23
@@ -560,12 +560,10 @@
 #ifdef SSI_IPC_OBJ_DB_LOCKLESS
 	ipc_obj_t *objp;
 	int idx;
-	char found;
 
 	if (key == IPC_PRIVATE)
 		return NULL;
 
-	found = 0;
 	rcu_read_lock();
 	for (idx = 0; idx < objdbp->iodb_size; idx++) {
 		objp = rcu_dereference(objdbp->iodb_active[idx]);
@@ -575,13 +573,14 @@
 			continue;
 		if (view && objp->io_svr_node != node)
 			continue;
-		if (atomic_test_and_add(1, &objp->io_refcnt))
-			found = 1;
-		break;
+		if (!atomic_test_and_add(1, &objp->io_refcnt))
+			continue;
+		goto found;
 	}
+	objp = NULL;
+found:
 	rcu_read_unlock();
-
-	return found ? objp : NULL;
+	return objp;
 #else /* SSI_IPC_OBJ_DB_LOCKLESS */
 	ipc_obj_t **objp = objdbp->iodb_active;
 	int idx;
@@ -1383,9 +1382,8 @@
 	ipc_obj_t *op;
 	clusternode_t svr_node;
 	int idx;
-#ifdef SSI_IPC_OBJ_DB_LOCKLESS
-	char found = 0;
 
+#ifdef SSI_IPC_OBJ_DB_LOCKLESS
 	rcu_read_lock();
 	for (idx = 0; idx < objdbp->iodb_size; idx++) {
 		op = rcu_dereference(objdbp->iodb_active[idx]);
@@ -1393,11 +1391,12 @@
 			continue;
 		if (!atomic_test_and_add(1, &op->io_refcnt))
 			continue;
-		found = 1;
-		break;
+		goto found;
 	}
+	op = NULL;
+found:
 	rcu_read_unlock();
-	if (!found)
+	if (!op)
 		return -ESRCH;
 
 	svr_node = op->io_svr_node;


------------------------------------------------------------------------------