[openib-general] [PATCH][SDP][4/22] Remove use of leading underscores in static names in sdp_conn.c

Tom Duffy Tom.Duffy at Sun.COM
Mon Feb 28 14:00:40 PST 2005


Signed-off-by: Tom Duffy <tduffy at sun.com>

Index: drivers/infiniband/ulp/sdp/sdp_conn.c
===================================================================
--- drivers/infiniband/ulp/sdp/sdp_conn.c	(revision 1929)
+++ drivers/infiniband/ulp/sdp/sdp_conn.c	(working copy)
@@ -34,7 +34,7 @@
 
 #include "sdp_main.h"
 
-static struct sdev_root _dev_root_s;
+static struct sdev_root dev_root_s;
 
 static void sdp_device_init_one(struct ib_device *device);
 static void sdp_device_remove_one(struct ib_device *device);
@@ -55,7 +55,7 @@ static u32        psn_seed;
 /*
  * sdp_psn_generate - generate a PSN for connection management.
  */
-static u32 _sdp_psn_generate(void)
+static u32 sdp_psn_generate(void)
 {
         u32 psn;
 
@@ -196,18 +196,18 @@ int sdp_inet_listen_start(struct sdp_opt
 	/*
 	 * table lock
 	 */
-	spin_lock_irqsave(&_dev_root_s.listen_lock, flags);
+	spin_lock_irqsave(&dev_root_s.listen_lock, flags);
 	/*
 	 * insert into listening list.
 	 */
-	conn->lstn_next = _dev_root_s.listen_list;
-	_dev_root_s.listen_list = conn;
-	conn->lstn_p_next = &_dev_root_s.listen_list;
+	conn->lstn_next = dev_root_s.listen_list;
+	dev_root_s.listen_list = conn;
+	conn->lstn_p_next = &dev_root_s.listen_list;
 
 	if (conn->lstn_next)
 		conn->lstn_next->lstn_p_next = &conn->lstn_next;
 
-	spin_unlock_irqrestore(&_dev_root_s.listen_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.listen_lock, flags);
 	return 0;
 }
 
@@ -229,7 +229,7 @@ int sdp_inet_listen_stop(struct sdp_opt 
 	/*
 	 * table lock
 	 */
-	spin_lock_irqsave(&_dev_root_s.listen_lock, flags);
+	spin_lock_irqsave(&dev_root_s.listen_lock, flags);
 	/*
 	 * remove from listening list.
 	 */
@@ -241,7 +241,7 @@ int sdp_inet_listen_stop(struct sdp_opt 
 	listen_conn->lstn_p_next = NULL;
 	listen_conn->lstn_next = NULL;
 
-	spin_unlock_irqrestore(&_dev_root_s.listen_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.listen_lock, flags);
 	/*
 	 * reject and delete all pending connections
 	 */
@@ -281,19 +281,18 @@ struct sdp_opt *sdp_inet_listen_lookup(u
 	/*
 	 * table lock
 	 */
-	spin_lock_irqsave(&_dev_root_s.listen_lock, flags);
+	spin_lock_irqsave(&dev_root_s.listen_lock, flags);
 	/*
 	 * first find a listening connection
 	 */
-	for (conn = _dev_root_s.listen_list; conn;
-	     conn = conn->lstn_next)
+	for (conn = dev_root_s.listen_list; conn; conn = conn->lstn_next)
 		if (port == conn->src_port &&
 		    (INADDR_ANY == conn->src_addr || addr == conn->src_addr)) {
 			sdp_conn_hold(conn);
 			break;
 		}
 
-	spin_unlock_irqrestore(&_dev_root_s.listen_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.listen_lock, flags);
 	return conn;
 }
 
@@ -317,12 +316,12 @@ int sdp_inet_port_get(struct sdp_opt *co
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.bind_lock, flags);
+	spin_lock_irqsave(&dev_root_s.bind_lock, flags);
 	/*
 	 * simple linked list of sockets ordered on local port number.
 	 */
 	if (port > 0) {
-		for (look = _dev_root_s.bind_list, port_ok = 1;
+		for (look = dev_root_s.bind_list, port_ok = 1;
 		     look; look = look->bind_next) {
 			srch = look->sk;
 			/*
@@ -385,7 +384,7 @@ int sdp_inet_port_get(struct sdp_opt *co
 			if (rover < low_port || rover > top_port)
 				rover = low_port;
 
-			for (look = _dev_root_s.bind_list;
+			for (look = dev_root_s.bind_list;
 			     look && look->src_port != port;
 			     look = look->bind_next)
 				do {} while(0); /* pass */
@@ -406,16 +405,16 @@ int sdp_inet_port_get(struct sdp_opt *co
 	/*
 	 * insert into listening list.
 	 */
-	conn->bind_next = _dev_root_s.bind_list;
-	_dev_root_s.bind_list = conn;
-	conn->bind_p_next = &_dev_root_s.bind_list;
+	conn->bind_next = dev_root_s.bind_list;
+	dev_root_s.bind_list = conn;
+	conn->bind_p_next = &dev_root_s.bind_list;
 
 	if (conn->bind_next)
 		conn->bind_next->bind_p_next = &conn->bind_next;
 
 	result = 0;
 done:
-	spin_unlock_irqrestore(&_dev_root_s.bind_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.bind_lock, flags);
 	return result;
 }
 
@@ -431,7 +430,7 @@ int sdp_inet_port_put(struct sdp_opt *co
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.bind_lock, flags);
+	spin_lock_irqsave(&dev_root_s.bind_lock, flags);
 	/*
 	 * remove from bind list.
 	 */
@@ -444,7 +443,7 @@ int sdp_inet_port_put(struct sdp_opt *co
 	conn->bind_next = NULL;
 	conn->src_port = 0;
 
-	spin_unlock_irqrestore(&_dev_root_s.bind_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.bind_lock, flags);
 	return 0;
 }
 
@@ -459,7 +458,7 @@ int sdp_inet_port_inherit(struct sdp_opt
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.bind_lock, flags);
+	spin_lock_irqsave(&dev_root_s.bind_lock, flags);
 
 	if (child->bind_p_next ||
 	    child->src_port != parent->src_port) {
@@ -480,14 +479,14 @@ int sdp_inet_port_inherit(struct sdp_opt
 
 	result = 0;
 done:
-	spin_unlock_irqrestore(&_dev_root_s.bind_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.bind_lock, flags);
 	return result;
 }
 
 /*
- * _sdp_conn_table_insert - insert a connection into the connection table
+ * sdp_conn_table_insert - insert a connection into the connection table
  */
-static int _sdp_conn_table_insert(struct sdp_opt *conn)
+static int sdp_conn_table_insert(struct sdp_opt *conn)
 {
 	u32 counter;
 	int result = -ENOMEM;
@@ -498,20 +497,20 @@ static int _sdp_conn_table_insert(struct
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.sock_lock, flags);
+	spin_lock_irqsave(&dev_root_s.sock_lock, flags);
 	/*
 	 * find an empty slot.
 	 */
 	for (counter = 0;
-	     counter < _dev_root_s.sk_size;
-	     counter++, _dev_root_s.sk_rover++) {
-		if (!(_dev_root_s.sk_rover < _dev_root_s.sk_size))
-			_dev_root_s.sk_rover = 0;
-
-		if (!_dev_root_s.sk_array[_dev_root_s.sk_rover]) {
-			_dev_root_s.sk_array[_dev_root_s.sk_rover] = conn;
-			_dev_root_s.sk_entry++;
-			conn->hashent = _dev_root_s.sk_rover;
+	     counter < dev_root_s.sk_size;
+	     counter++, dev_root_s.sk_rover++) {
+		if (!(dev_root_s.sk_rover < dev_root_s.sk_size))
+			dev_root_s.sk_rover = 0;
+
+		if (!dev_root_s.sk_array[dev_root_s.sk_rover]) {
+			dev_root_s.sk_array[dev_root_s.sk_rover] = conn;
+			dev_root_s.sk_entry++;
+			conn->hashent = dev_root_s.sk_rover;
 
 			result = 0;
 			break;
@@ -519,12 +518,12 @@ static int _sdp_conn_table_insert(struct
 	}
 
 #if 0				/* set for reproducibility from run-run. */
-	_dev_root_s.sk_rover = 0;
+	dev_root_s.sk_rover = 0;
 #endif
 	/*
 	 * unlock table
 	 */
-	spin_unlock_irqrestore(&_dev_root_s.sock_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.sock_lock, flags);
 	return result;
 }
 
@@ -539,29 +538,29 @@ int sdp_conn_table_remove(struct sdp_opt
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.sock_lock, flags);
+	spin_lock_irqsave(&dev_root_s.sock_lock, flags);
 	/*
 	 * validate entry
 	 */
 	if (SDP_DEV_SK_INVALID == conn->hashent)
 		goto done;
 
-	if (conn->hashent < 0 || conn != _dev_root_s.sk_array[conn->hashent]) {
+	if (conn->hashent < 0 || conn != dev_root_s.sk_array[conn->hashent]) {
 		result = -ERANGE;
 		goto done;
 	}
 	/*
 	 * drop entry
 	 */
-	_dev_root_s.sk_array[conn->hashent] = NULL;
-	_dev_root_s.sk_entry--;
+	dev_root_s.sk_array[conn->hashent] = NULL;
+	dev_root_s.sk_entry--;
 	conn->hashent = SDP_DEV_SK_INVALID;
 
 done:
 	/*
 	 * unlock table
 	 */
-	spin_unlock_irqrestore(&_dev_root_s.sock_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.sock_lock, flags);
 	return result;
 }
 
@@ -575,43 +574,42 @@ struct sdp_opt *sdp_conn_table_lookup(s3
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.sock_lock, flags);
+	spin_lock_irqsave(&dev_root_s.sock_lock, flags);
 #if 0
 	/*
 	 * validate range
 	 */
-	if (entry < 0 || entry >= _dev_root_s.sk_size) {
-
+	if (entry < 0 || entry >= dev_root_s.sk_size) {
 		conn = NULL;
 		goto done;
 	}
 #endif
 
-	conn = _dev_root_s.sk_array[entry];
+	conn = dev_root_s.sk_array[entry];
 	if (!conn)
 		goto done;
 
 	sdp_conn_hold(conn);
 done:
-	spin_unlock_irqrestore(&_dev_root_s.sock_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.sock_lock, flags);
 	return conn;
 }
 
 /* 
  * Functions to cancel IOCB requests in a conenctions queues.
  */
-static int _sdp_desc_q_cancel_lookup_func(struct sdpc_desc *element, void *arg)
+static int sdp_desc_q_cancel_lookup_func(struct sdpc_desc *element, void *arg)
 {
 	return ((element->type == SDP_DESC_TYPE_IOCB) ? 0 : -ERANGE);
 }
 
-static void _sdp_desc_q_cancel_iocb(struct sdpc_desc_q *table, ssize_t error)
+static void sdp_desc_q_cancel_iocb(struct sdpc_desc_q *table, ssize_t error)
 {
 	struct sdpc_iocb *iocb;
 
 	while ((iocb = (struct sdpc_iocb *)sdp_desc_q_lookup
 			(table,
-			 _sdp_desc_q_cancel_lookup_func,
+			 sdp_desc_q_cancel_lookup_func,
 			 NULL))) {
 
 		sdp_iocb_q_remove(iocb);
@@ -624,15 +622,15 @@ void sdp_iocb_q_cancel_all_read(struct s
 	sdp_iocb_q_cancel(&conn->r_pend, SDP_IOCB_F_ALL, error);
 	sdp_iocb_q_cancel(&conn->r_snk, SDP_IOCB_F_ALL, error);
 
-	_sdp_desc_q_cancel_iocb(&conn->r_src, error);
+	sdp_desc_q_cancel_iocb(&conn->r_src, error);
 }
 
 void sdp_iocb_q_cancel_all_write(struct sdp_opt *conn, ssize_t error)
 {
 	sdp_iocb_q_cancel(&conn->w_src, SDP_IOCB_F_ALL, error);
 
-	_sdp_desc_q_cancel_iocb(&conn->send_queue, error);
-	_sdp_desc_q_cancel_iocb(&conn->w_snk, error);
+	sdp_desc_q_cancel_iocb(&conn->send_queue, error);
+	sdp_desc_q_cancel_iocb(&conn->w_snk, error);
 }
 
 void sdp_iocb_q_cancel_all(struct sdp_opt *conn, ssize_t error)
@@ -673,10 +671,10 @@ int sdp_conn_destruct(struct sdp_opt *co
 	result = sdp_conn_table_remove(conn);
 	if (result < 0)
 		sdp_dbg_warn(conn, "Error <%d> removing connection <%u:%u>",
-			     result, _dev_root_s.sk_entry,
-			     _dev_root_s.sk_size);
+			     result, dev_root_s.sk_entry,
+			     dev_root_s.sk_size);
 
-	result = __sdp_conn_stat_dump(conn);
+	result = sdp_conn_stat_dump(conn);
 	SDP_EXPECT(result >= 0);
 	/*
 	 * really there shouldn't be anything in these tables, but it's
@@ -771,13 +769,13 @@ int sdp_conn_destruct(struct sdp_opt *co
 		conn->sk = NULL;
 	}
 
-	kmem_cache_free(_dev_root_s.conn_cache, conn);
+	kmem_cache_free(dev_root_s.conn_cache, conn);
 
 	result = 0;
 done:
 
 	if (dump) {
-		result = __sdp_conn_state_dump(conn);
+		result = sdp_conn_state_dump(conn);
 		SDP_EXPECT(result >= 0);
 	}
 
@@ -945,9 +943,9 @@ void sdp_conn_internal_unlock(struct sdp
 }
 
 /*
- * _sdp_conn_lock_init - initialize connection lock
+ * sdp_conn_lock_init - initialize connection lock
  */
-static void _sdp_conn_lock_init(struct sdp_opt *conn)
+static void sdp_conn_lock_init(struct sdp_opt *conn)
 {
 	spin_lock_init(&(conn->lock.slock));
 	conn->lock.users = 0;
@@ -957,10 +955,8 @@ static void _sdp_conn_lock_init(struct s
 /*
  * sdp_conn_alloc_ib - allocate IB structures for a new connection.
  */
-int sdp_conn_alloc_ib(struct sdp_opt *conn,
-		      struct ib_device *device,
-		      u8 hw_port,
-		      u16 pkey)
+int sdp_conn_alloc_ib(struct sdp_opt *conn, struct ib_device *device,
+		      u8 hw_port, u16 pkey)
 {
 	struct ib_qp_init_attr *init_attr;
 	struct ib_qp_attr     *qp_attr;
@@ -1013,10 +1009,8 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 	 * allocate IB CQ's and QP
 	 */
 	if (!conn->send_cq) {
-		conn->send_cq = ib_create_cq(conn->ca,
-					     sdp_cq_event_handler,
-					     NULL,
-					     __hashent_arg(conn->hashent),
+		conn->send_cq = ib_create_cq(conn->ca, sdp_cq_event_handler,
+					     NULL, hashent_arg(conn->hashent),
 					     conn->send_cq_size);
 		if (IS_ERR(conn->send_cq)) {
 			result = PTR_ERR(conn->send_cq);
@@ -1036,10 +1030,8 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 	}
 
 	if (!conn->recv_cq) {
-		conn->recv_cq = ib_create_cq(conn->ca,
-					     sdp_cq_event_handler,
-					     NULL,
-					     __hashent_arg(conn->hashent),
+		conn->recv_cq = ib_create_cq(conn->ca, sdp_cq_event_handler,
+					     NULL, hashent_arg(conn->hashent),
 					     conn->recv_cq_size);
 
 		if (IS_ERR(conn->recv_cq)) {
@@ -1142,10 +1134,10 @@ struct sdp_opt *sdp_conn_alloc(int prior
 	struct sock *sk;
 	int result;
 
-	sk = sk_alloc(_dev_root_s.proto, priority, 1, _dev_root_s.sock_cache);
+	sk = sk_alloc(dev_root_s.proto, priority, 1, dev_root_s.sock_cache);
 	if (!sk) {
 		sdp_dbg_warn(NULL, "socket alloc error for protocol. <%d:%d>",
-			     _dev_root_s.proto, priority);
+			     dev_root_s.proto, priority);
 		return NULL;
 	}
 	/*
@@ -1155,7 +1147,7 @@ struct sdp_opt *sdp_conn_alloc(int prior
 	/*
 	 * other non-zero sock initialization.
 	 */
-	sk->sk_family   = _dev_root_s.proto;
+	sk->sk_family   = dev_root_s.proto;
 	sk->sk_protocol = IPPROTO_TCP;
 	/*
 	 * some callbacks. higher levels of linux (e.g. setsockopt) call
@@ -1170,7 +1162,7 @@ struct sdp_opt *sdp_conn_alloc(int prior
 	 * Allocate must be called from process context, since QP
 	 * create/modifies must be in that context.
 	 */
-	conn = kmem_cache_alloc(_dev_root_s.conn_cache, priority);
+	conn = kmem_cache_alloc(dev_root_s.conn_cache, priority);
 	if (!conn) {
 		sdp_dbg_warn(conn, "connection alloc error. <%d>", priority);
 		result = -ENOMEM;
@@ -1216,8 +1208,8 @@ struct sdp_opt *sdp_conn_alloc(int prior
 	conn->nond_recv = 0;
 	conn->nond_send = 0;
 
-	conn->recv_max  = _dev_root_s.recv_buff_max;
-	conn->send_max  = _dev_root_s.send_buff_max;
+	conn->recv_max  = dev_root_s.recv_buff_max;
+	conn->send_max  = dev_root_s.send_buff_max;
 	conn->rwin_max  = SDP_INET_RECV_SIZE;
 	conn->s_wq_size = 0;
 
@@ -1247,15 +1239,15 @@ struct sdp_opt *sdp_conn_alloc(int prior
 
 	conn->send_usig = 0;
 	conn->send_cons = 0;
-	conn->usig_max  = _dev_root_s.send_usig_max;
+	conn->usig_max  = dev_root_s.send_usig_max;
 
 	conn->s_wq_par = 0;
 
 	conn->plid = 0;
 
-	conn->send_cq_size = _dev_root_s.send_post_max;
-	conn->recv_cq_size = _dev_root_s.recv_post_max;
-	conn->s_wq_cur     = _dev_root_s.send_post_max;
+	conn->send_cq_size = dev_root_s.send_post_max;
+	conn->recv_cq_size = dev_root_s.recv_post_max;
+	conn->s_wq_cur     = dev_root_s.send_post_max;
 
 	conn->send_cq  = NULL;
 	conn->recv_cq  = NULL;
@@ -1266,7 +1258,7 @@ struct sdp_opt *sdp_conn_alloc(int prior
 	conn->fmr_pool = NULL;
 	conn->hw_port  = 0;
 
-	conn->rq_psn   = _sdp_psn_generate();
+	conn->rq_psn   = sdp_psn_generate();
 	/*
 	 * generic send queue
 	 */
@@ -1296,16 +1288,16 @@ struct sdp_opt *sdp_conn_alloc(int prior
 	/*
 	 * connection lock
 	 */
-	_sdp_conn_lock_init(conn);
+	sdp_conn_lock_init(conn);
 	/*
 	 * insert connection into lookup table
 	 */
-	result = _sdp_conn_table_insert(conn);
+	result = sdp_conn_table_insert(conn);
 	if (result < 0) {
 
 		sdp_dbg_warn(conn, "Error <%d> conn table insert <%d:%d>",
-			     result, _dev_root_s.sk_entry,
-			     _dev_root_s.sk_size);
+			     result, dev_root_s.sk_entry,
+			     dev_root_s.sk_size);
 		goto error_conn;
 	}
 	/*
@@ -1321,7 +1313,7 @@ struct sdp_opt *sdp_conn_alloc(int prior
 	 */
 	return conn;
 error_conn:
-	kmem_cache_free(_dev_root_s.conn_cache, conn);
+	kmem_cache_free(dev_root_s.conn_cache, conn);
 error:
 	sk_free(sk);
 	return NULL;
@@ -1350,9 +1342,7 @@ error:
 /*
  * sdp_proc_dump_conn_main - dump the connection table to /proc
  */
-int sdp_proc_dump_conn_main(char *buffer, 
-			    int   max_size, 
-			    off_t start_index, 
+int sdp_proc_dump_conn_main(char *buffer, int max_size, off_t start_index, 
 			    long *end_index)
 {
 	struct sdp_opt *conn;
@@ -1373,23 +1363,23 @@ int sdp_proc_dump_conn_main(char *buffer
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.sock_lock, flags);
+	spin_lock_irqsave(&dev_root_s.sock_lock, flags);
 	/*
 	 * if the entire table has been walked, exit.
 	 */
-	if (!(start_index < _dev_root_s.sk_size))
+	if (!(start_index < dev_root_s.sk_size))
 		goto done;
 	/*
 	 * loop across connections.
 	 */
 	for (counter = start_index; 
-	     counter < _dev_root_s.sk_size &&
+	     counter < dev_root_s.sk_size &&
 		     !(SDP_CONN_PROC_MAIN_SIZE > (max_size - offset));
 	     counter++) {
-		if (!_dev_root_s.sk_array[counter])
+		if (!dev_root_s.sk_array[counter])
 			continue;
 
-		conn = _dev_root_s.sk_array[counter];
+		conn = dev_root_s.sk_array[counter];
 
 		d_guid = cpu_to_be64(conn->d_gid.global.interface_id);
 		s_guid = cpu_to_be64(conn->s_gid.global.interface_id);
@@ -1432,7 +1422,7 @@ int sdp_proc_dump_conn_main(char *buffer
 	*end_index = counter - start_index;
 
 done:
-	spin_unlock_irqrestore(&_dev_root_s.sock_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.sock_lock, flags);
 	return offset;
 }
 
@@ -1456,9 +1446,7 @@ done:
 /*
  * sdp_proc_dump_conn_data - dump the connection table to /proc
  */
-int sdp_proc_dump_conn_data(char *buffer,
-			    int   max_size,
-			    off_t start_index,
+int sdp_proc_dump_conn_data(char *buffer, int max_size, off_t start_index,
 			    long *end_index)
 {
 	struct sock *sk;
@@ -1478,22 +1466,22 @@ int sdp_proc_dump_conn_data(char *buffer
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.sock_lock, flags);
+	spin_lock_irqsave(&dev_root_s.sock_lock, flags);
 	/*
 	 * if the entire table has been walked, exit.
 	 */
-	if (!(start_index < _dev_root_s.sk_size))
+	if (!(start_index < dev_root_s.sk_size))
 		goto done;
 	/*
 	 * loop across connections.
 	 */
-	for (counter = start_index; counter < _dev_root_s.sk_size &&
+	for (counter = start_index; counter < dev_root_s.sk_size &&
 		     !(SDP_CONN_PROC_DATA_SIZE > (max_size - offset));
 	     counter++) {
-		if (!_dev_root_s.sk_array[counter])
+		if (!dev_root_s.sk_array[counter])
 			continue;
 
-		conn = _dev_root_s.sk_array[counter];
+		conn = dev_root_s.sk_array[counter];
 		sk = conn->sk;
 
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_DATA_FORM,
@@ -1535,7 +1523,7 @@ int sdp_proc_dump_conn_data(char *buffer
 
 	*end_index = counter - start_index;
 done:
-	spin_unlock_irqrestore(&_dev_root_s.sock_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.sock_lock, flags);
 	return offset;
 }
 
@@ -1553,9 +1541,7 @@ done:
 /*
  * sdp_proc_dump_conn_rdma - dump the connection table to /proc
  */
-int sdp_proc_dump_conn_rdma(char *buffer, 
-			    int   max_size,
-			    off_t start_index,
+int sdp_proc_dump_conn_rdma(char *buffer, int max_size, off_t start_index,
 			    long *end_index)
 {
 	struct sdp_opt *conn;
@@ -1574,22 +1560,22 @@ int sdp_proc_dump_conn_rdma(char *buffer
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.sock_lock, flags);
+	spin_lock_irqsave(&dev_root_s.sock_lock, flags);
 	/*
 	 * if the entire table has been walked, exit.
 	 */
-	if (!(start_index < _dev_root_s.sk_size))
+	if (!(start_index < dev_root_s.sk_size))
 		goto done;
 	/*
 	 * loop across connections.
 	 */
-	for (counter = start_index; counter < _dev_root_s.sk_size &&
+	for (counter = start_index; counter < dev_root_s.sk_size &&
 		     !(SDP_CONN_PROC_RDMA_SIZE > (max_size - offset));
 	     counter++) {
-		if (!_dev_root_s.sk_array[counter])
+		if (!dev_root_s.sk_array[counter])
 			continue;
 
-		conn = _dev_root_s.sk_array[counter];
+		conn = dev_root_s.sk_array[counter];
 
 		offset += sprintf((buffer + offset),SDP_PROC_CONN_RDMA_FORM,
 				  conn->hashent,
@@ -1617,7 +1603,7 @@ int sdp_proc_dump_conn_rdma(char *buffer
 
 	*end_index = counter - start_index;
 done:
-	spin_unlock_irqrestore(&_dev_root_s.sock_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.sock_lock, flags);
 	return offset;
 }
 
@@ -1632,9 +1618,7 @@ done:
 /*
  * sdp_proc_dump_conn_sopt - dump the options portion of each conn to /proc
  */
-int sdp_proc_dump_conn_sopt(char *buffer,
-			    int   max_size,
-			    off_t start_index,
+int sdp_proc_dump_conn_sopt(char *buffer, int max_size, off_t start_index,
 			    long *end_index)
 {
 	struct sdp_opt *conn;
@@ -1653,22 +1637,22 @@ int sdp_proc_dump_conn_sopt(char *buffer
 	/*
 	 * lock table
 	 */
-	spin_lock_irqsave(&_dev_root_s.sock_lock, flags);
+	spin_lock_irqsave(&dev_root_s.sock_lock, flags);
 	/*
 	 * if the entire table has been walked, exit.
 	 */
-	if (!(start_index < _dev_root_s.sk_size))
+	if (!(start_index < dev_root_s.sk_size))
 		goto done;
 	/*
 	 * loop across connections.
 	 */
-	for (counter = start_index; counter < _dev_root_s.sk_size &&
+	for (counter = start_index; counter < dev_root_s.sk_size &&
 		     !(SDP_SOPT_PROC_DUMP_SIZE > (max_size - offset));
 	     counter++) {
-		if (!_dev_root_s.sk_array[counter])
+		if (!dev_root_s.sk_array[counter])
 			continue;
 
-		conn = _dev_root_s.sk_array[counter];
+		conn = dev_root_s.sk_array[counter];
 
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_SOPT_FORM,
 				  (conn->dst_addr & 0xff),
@@ -1688,16 +1672,14 @@ int sdp_proc_dump_conn_sopt(char *buffer
 
 	*end_index = counter - start_index;
 done:
-	spin_unlock_irqrestore(&_dev_root_s.sock_lock, flags);
+	spin_unlock_irqrestore(&dev_root_s.sock_lock, flags);
 	return offset;
 }
 
 /*
  * sdp_proc_dump_device - dump the primary device table to /proc
  */
-int sdp_proc_dump_device(char *buffer,
-			 int   max_size,
-			 off_t start_index,
+int sdp_proc_dump_device(char *buffer, int max_size, off_t start_index,
 			 long *end_index)
 {
 	int offset = 0;
@@ -1709,29 +1691,29 @@ int sdp_proc_dump_device(char *buffer,
 	if (!start_index) {
 		offset += sprintf((buffer + offset),
 				  "connection table maximum: <%d>\n",
-				  _dev_root_s.sk_size);
+				  dev_root_s.sk_size);
 		offset += sprintf((buffer + offset),
 				  "connection table entries: <%d>\n",
-				  _dev_root_s.sk_entry);
+				  dev_root_s.sk_entry);
 		offset += sprintf((buffer + offset),
 				  "connection table   rover:  <%d>\n",
-				  _dev_root_s.sk_rover);
+				  dev_root_s.sk_rover);
 
 		offset += sprintf((buffer + offset),
 				  "max send posted:          <%d>\n",
-				  _dev_root_s.send_post_max);
+				  dev_root_s.send_post_max);
 		offset += sprintf((buffer + offset),
 				  "max send buffered:        <%d>\n",
-				  _dev_root_s.send_buff_max);
+				  dev_root_s.send_buff_max);
 		offset += sprintf((buffer + offset),
 		      "max send unsignalled:     <%d>\n",
-				  _dev_root_s.send_usig_max);
+				  dev_root_s.send_usig_max);
 		offset += sprintf((buffer + offset),
 				  "max receive posted:       <%d>\n",
-				  _dev_root_s.recv_post_max);
+				  dev_root_s.recv_post_max);
 		offset += sprintf((buffer + offset),
 				  "max receive buffered:     <%d>\n",
-				  _dev_root_s.recv_buff_max);
+				  dev_root_s.recv_buff_max);
 	}
 
 	return offset;
@@ -1910,12 +1892,8 @@ static void sdp_device_remove_one(struct
 /*
  * sdp_conn_table_init - create a sdp connection table
  */
-int sdp_conn_table_init(int proto_family,
-			int conn_size,
-			int recv_post_max,
-			int recv_buff_max,
-			int send_post_max,
-			int send_buff_max,
+int sdp_conn_table_init(int proto_family, int conn_size, int recv_post_max,
+			int recv_buff_max, int send_post_max, int send_buff_max,
 			int send_usig_max)
 {
 	int result;
@@ -1928,27 +1906,27 @@ int sdp_conn_table_init(int proto_family
 	 */
 	get_random_bytes(&psn_seed, sizeof(psn_seed));
 
-	memset(&_dev_root_s, 0, sizeof(struct sdev_root));
+	memset(&dev_root_s, 0, sizeof(struct sdev_root));
 	/*
 	 * list
 	 */
-	_dev_root_s.listen_list = NULL;
-	_dev_root_s.bind_list = NULL;
+	dev_root_s.listen_list = NULL;
+	dev_root_s.bind_list = NULL;
 
-	spin_lock_init(&_dev_root_s.sock_lock);
-	spin_lock_init(&_dev_root_s.bind_lock);
-	spin_lock_init(&_dev_root_s.listen_lock);
+	spin_lock_init(&dev_root_s.sock_lock);
+	spin_lock_init(&dev_root_s.bind_lock);
+	spin_lock_init(&dev_root_s.listen_lock);
 	/*
 	 * Initialize IB
 	 */
-	_dev_root_s.proto = proto_family;
+	dev_root_s.proto = proto_family;
 
-	_dev_root_s.recv_post_max = recv_post_max;
-	_dev_root_s.recv_buff_max = recv_buff_max;
-	_dev_root_s.send_post_max = send_post_max;
-	_dev_root_s.send_buff_max = send_buff_max;
+	dev_root_s.recv_post_max = recv_post_max;
+	dev_root_s.recv_buff_max = recv_buff_max;
+	dev_root_s.send_post_max = send_post_max;
+	dev_root_s.send_buff_max = send_buff_max;
 	
-	_dev_root_s.send_usig_max = send_usig_max;
+	dev_root_s.send_usig_max = send_usig_max;
 	/*
 	 * Get HCA/port list
 	 */
@@ -1968,21 +1946,21 @@ int sdp_conn_table_init(int proto_family
 
 	byte_size = conn_size * sizeof(struct sdp_opt *);
 	page_size = (byte_size >> 12) + ((0xfff & byte_size) > 0 ? 1 : 0);
-	for (_dev_root_s.sk_ordr = 0;
-	     (1 << _dev_root_s.sk_ordr) < page_size; _dev_root_s.sk_ordr++) ;
+	for (dev_root_s.sk_ordr = 0;
+	     (1 << dev_root_s.sk_ordr) < page_size; dev_root_s.sk_ordr++) ;
 
-	_dev_root_s.sk_array = (void *) __get_free_pages(GFP_KERNEL,
-						       _dev_root_s.sk_ordr);
-	if (!_dev_root_s.sk_array) {
+	dev_root_s.sk_array = (void *) __get_free_pages(GFP_KERNEL,
+						        dev_root_s.sk_ordr);
+	if (!dev_root_s.sk_array) {
 		sdp_warn("Failed to create connection table. <%d:%d:%d>",
-			 byte_size, page_size, _dev_root_s.sk_ordr);
+			 byte_size, page_size, dev_root_s.sk_ordr);
 		result = -ENOMEM;
 		goto error_array;
 	}
 
-	memset(_dev_root_s.sk_array, 0, byte_size);
-	_dev_root_s.sk_size = conn_size - 1; /* top is reserved for invalid */
-	_dev_root_s.sk_array++; /* bump table forward so negative -1 index
+	memset(dev_root_s.sk_array, 0, byte_size);
+	dev_root_s.sk_size = conn_size - 1; /* top is reserved for invalid */
+	dev_root_s.sk_array++; /* bump table forward so negative -1 index
 				   is always a null entry to improve invalid
 				   entry processing. */
 	/*
@@ -1994,21 +1972,21 @@ int sdp_conn_table_init(int proto_family
 		goto error_iocb;
 	}
 
-	_dev_root_s.conn_cache = kmem_cache_create("sdp_conn",
+	dev_root_s.conn_cache = kmem_cache_create("sdp_conn",
 						   sizeof(struct sdp_opt),
 						   0, SLAB_HWCACHE_ALIGN,
 						   NULL, NULL);
-	if (!_dev_root_s.conn_cache) {
+	if (!dev_root_s.conn_cache) {
 		sdp_warn("Failed to initialize connection cache.");
 		result = -ENOMEM;
 		goto error_conn;
 	}
 
-        _dev_root_s.sock_cache = kmem_cache_create("sdp_sock",
+        dev_root_s.sock_cache = kmem_cache_create("sdp_sock",
 						   sizeof(struct inet_sock), 
 						   0, SLAB_HWCACHE_ALIGN,
 						   NULL, NULL);
-        if (!_dev_root_s.sock_cache) {
+        if (!dev_root_s.sock_cache) {
 		sdp_warn("Failed to initialize sock cache.");
 		result = -ENOMEM;
 		goto error_sock;
@@ -2017,7 +1995,7 @@ int sdp_conn_table_init(int proto_family
 	/*
 	 * start listening
 	 */
-	result = sdp_cm_listen_start(&_dev_root_s);
+	result = sdp_cm_listen_start(&dev_root_s);
 	if (result < 0) {
 		sdp_warn("Error <%d> listening for connections on HCA.",
 			 result);
@@ -2026,14 +2004,14 @@ int sdp_conn_table_init(int proto_family
 
 	return 0;
 error_listen:
-	kmem_cache_destroy(_dev_root_s.sock_cache);
+	kmem_cache_destroy(dev_root_s.sock_cache);
 error_sock:
-	kmem_cache_destroy(_dev_root_s.conn_cache);
+	kmem_cache_destroy(dev_root_s.conn_cache);
 error_conn:
 	sdp_main_iocb_cleanup();
 error_iocb:
-	_dev_root_s.sk_array--;
-	free_pages((unsigned long)_dev_root_s.sk_array, _dev_root_s.sk_ordr);
+	dev_root_s.sk_array--;
+	free_pages((unsigned long)dev_root_s.sk_array, dev_root_s.sk_ordr);
 error_array:
 error_size:
 	ib_unregister_client(&sdp_client);
@@ -2052,7 +2030,7 @@ int sdp_conn_table_clear(void)
 	/*
 	 * drain all the connections
 	 */
-	while ((conn = _dev_root_s.conn_list)) {
+	while ((conn = dev_root_s.conn_list)) {
 
 	}
 #endif
@@ -2063,20 +2041,20 @@ int sdp_conn_table_clear(void)
 	/*
 	 * drop socket table
 	 */
-	_dev_root_s.sk_array--;
-	free_pages((unsigned long)_dev_root_s.sk_array, _dev_root_s.sk_ordr);
+	dev_root_s.sk_array--;
+	free_pages((unsigned long)dev_root_s.sk_array, dev_root_s.sk_ordr);
 	/*
 	 * delete conn cache
 	 */
-	kmem_cache_destroy(_dev_root_s.conn_cache);
+	kmem_cache_destroy(dev_root_s.conn_cache);
 	/*
 	 * delete sock cache
 	 */
-	kmem_cache_destroy(_dev_root_s.sock_cache);
+	kmem_cache_destroy(dev_root_s.sock_cache);
 	/*
 	 * stop listening
 	 */
-	(void)sdp_cm_listen_stop(&_dev_root_s);
+	(void)sdp_cm_listen_stop(&dev_root_s);
 	/*
 	 * delete IOCB table
 	 */




More information about the general mailing list