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

Tom Duffy Tom.Duffy at Sun.COM
Mon Feb 28 14:01:21 PST 2005


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

Index: drivers/infiniband/ulp/sdp/sdp_iocb.c
===================================================================
--- drivers/infiniband/ulp/sdp/sdp_iocb.c	(revision 1929)
+++ drivers/infiniband/ulp/sdp/sdp_iocb.c	(working copy)
@@ -34,7 +34,7 @@
 
 #include "sdp_main.h"
 
-static kmem_cache_t *__sdp_iocb_cache = NULL;
+static kmem_cache_t *sdp_iocb_cache = NULL;
 
 /*
  * memory locking functions
@@ -42,12 +42,12 @@ static kmem_cache_t *__sdp_iocb_cache = 
 #include <linux/utsname.h>
 
 typedef int (*do_mlock_ptr_t)(unsigned long, size_t, int);
-static do_mlock_ptr_t _mlock_ptr = NULL;
+static do_mlock_ptr_t mlock_ptr = NULL;
 
 /*
- * _sdp_iocb_unlock - unlock the memory for an IOCB
+ * do_iocb_unlock - unlock the memory for an IOCB
  */
-static int _sdp_iocb_unlock(struct sdpc_iocb *iocb)
+static int do_iocb_unlock(struct sdpc_iocb *iocb)
 {
 	struct vm_area_struct *vma;
 
@@ -111,7 +111,7 @@ int sdp_iocb_unlock(struct sdpc_iocb *io
 	 */
 	down_write(&iocb->mm->mmap_sem);
 	
-	result = _sdp_iocb_unlock(iocb);
+	result = do_iocb_unlock(iocb);
 
 	up_write(&iocb->mm->mmap_sem);
 
@@ -130,9 +130,9 @@ int sdp_iocb_unlock(struct sdpc_iocb *io
 }
 
 /*
- * _sdp_iocb_page_save - save page information for an IOCB
+ * sdp_iocb_page_save - save page information for an IOCB
  */
-static int _sdp_iocb_page_save(struct sdpc_iocb *iocb)
+static int sdp_iocb_page_save(struct sdpc_iocb *iocb)
 {
 	unsigned int counter;
 	unsigned long addr;
@@ -265,7 +265,7 @@ int sdp_iocb_lock(struct sdpc_iocb *iocb
 	down_write(&iocb->mm->mmap_sem);
 
 	if (!((iocb->page_count + current->mm->locked_vm) > limit))
-		result = (*_mlock_ptr)(addr, size, 1);
+		result = (*mlock_ptr)(addr, size, 1);
 	/*
 	 * process result
 	 */
@@ -313,7 +313,7 @@ int sdp_iocb_lock(struct sdpc_iocb *iocb
 			vma = NULL;
 	}
 
-	result = _sdp_iocb_page_save(iocb);
+	result = sdp_iocb_page_save(iocb);
 	if (result) {
 		sdp_dbg_err("Error <%d> saving pages for IOCB <%lx:%Zu>", 
 			    result, iocb->addr, iocb->size);
@@ -326,7 +326,7 @@ int sdp_iocb_lock(struct sdpc_iocb *iocb
 	return 0;
 err_save:
 
-	(void)_sdp_iocb_unlock(iocb);
+	(void)do_iocb_unlock(iocb);
 err_lock:
 	/*
 	 * unlock the mm and restore capabilities.
@@ -343,20 +343,19 @@ err_lock:
 /*
  * IOCB memory locking init functions
  */
-struct kallsym_iter
-{
-  loff_t pos;
-  struct module *owner;
-  unsigned long value;
-  unsigned int nameoff; /* If iterating in core kernel symbols */
-  char type;
-  char name[128];
+struct kallsym_iter {
+	loff_t pos;
+	struct module *owner;
+	unsigned long value;
+	unsigned int nameoff; /* If iterating in core kernel symbols */
+	char type;
+	char name[128];
 };
 
 /*
- * _sdp_mem_lock_init - initialize the userspace memory locking
+ * sdp_mem_lock_init - initialize the userspace memory locking
  */
-static int _sdp_mem_lock_init(void)
+static int sdp_mem_lock_init(void)
 {
 	struct file *kallsyms;
 	struct seq_file *seq;
@@ -382,9 +381,9 @@ static int _sdp_mem_lock_init(void)
 	     iter != NULL;
 	     iter = seq->op->next(seq, iter, &pos))
 		if (!strcmp(iter->name, "do_mlock"))
-			_mlock_ptr = (do_mlock_ptr_t)iter->value;
+			mlock_ptr = (do_mlock_ptr_t)iter->value;
 
-	if (!_mlock_ptr)
+	if (!mlock_ptr)
 		sdp_warn("Failed to find lock pointer.");
 	else
 		ret = 0;
@@ -396,15 +395,15 @@ done:
 }
 
 /*
- * _sdp_mem_lock_cleanup - cleanup the memory locking tables
+ * sdp_mem_lock_cleanup - cleanup the memory locking tables
  */
-static int _sdp_mem_lock_cleanup(void)
+static int sdp_mem_lock_cleanup(void)
 {
 	sdp_dbg_init("Memory Locking cleanup.");
 	/*
 	 * null out entries.
 	 */
-	_mlock_ptr = NULL;
+	mlock_ptr = NULL;
 	
 	return 0;
 }
@@ -485,9 +484,9 @@ int sdp_iocb_release(struct sdpc_iocb *i
 }
 
 /*
- * _sdp_iocb_complete - complete an IOCB for real in thread context
+ * do_iocb_complete - complete an IOCB for real in thread context
  */
-static void _sdp_iocb_complete(void *arg)
+static void do_iocb_complete(void *arg)
 {
 	struct sdpc_iocb *iocb = (struct sdpc_iocb *)arg;
 	int result;
@@ -536,10 +535,10 @@ int sdp_iocb_complete(struct sdpc_iocb *
 	iocb->status = status;
 	
 	if (in_atomic() || irqs_disabled()) {
-		INIT_WORK(&iocb->completion, _sdp_iocb_complete, (void *)iocb);
+		INIT_WORK(&iocb->completion, do_iocb_complete, (void *)iocb);
 		schedule_work(&iocb->completion);
 	} else
-		_sdp_iocb_complete(iocb);
+		do_iocb_complete(iocb);
 	
 	return 0;
 }
@@ -601,7 +600,7 @@ struct sdpc_iocb *sdp_iocb_create(void)
 {
 	struct sdpc_iocb *iocb;
 
-	iocb = kmem_cache_alloc(__sdp_iocb_cache, SLAB_KERNEL);
+	iocb = kmem_cache_alloc(sdp_iocb_cache, SLAB_KERNEL);
 	if (iocb) {
 		memset(iocb, 0, sizeof(struct sdpc_iocb));
 		/*
@@ -650,7 +649,7 @@ int sdp_iocb_destroy(struct sdpc_iocb *i
 	/*
 	 * return the object to its cache
 	 */
-	kmem_cache_free(__sdp_iocb_cache, iocb);
+	kmem_cache_free(sdp_iocb_cache, iocb);
 
 	return 0;
 }
@@ -664,9 +663,9 @@ struct sdpc_iocb *sdp_iocb_q_look(struct
 }
 
 /*
- * _sdp_iocb_q_get - get, and remove, the object at the tables head
+ * sdp_iocb_q_get - get, and remove, the object at the tables head
  */
-static struct sdpc_iocb *_sdp_iocb_q_get(struct sdpc_iocb_q *table, int head)
+static struct sdpc_iocb *sdp_iocb_q_get(struct sdpc_iocb_q *table, int head)
 {
 	struct sdpc_iocb *iocb;
 	struct sdpc_iocb *next;
@@ -701,11 +700,10 @@ static struct sdpc_iocb *_sdp_iocb_q_get
 }
 
 /*
- * _sdp_iocb_q_put - put the IOCB object at the tables tail
+ * sdp_iocb_q_put - put the IOCB object at the tables tail
  */
-static int _sdp_iocb_q_put(struct sdpc_iocb_q *table,
-			   struct sdpc_iocb *iocb,
-			   int head)
+static int sdp_iocb_q_put(struct sdpc_iocb_q *table, struct sdpc_iocb *iocb,
+			  int head)
 {
 	struct sdpc_iocb *next;
 	struct sdpc_iocb *prev;
@@ -739,7 +737,7 @@ static int _sdp_iocb_q_put(struct sdpc_i
  */
 struct sdpc_iocb *sdp_iocb_q_get_tail(struct sdpc_iocb_q *table)
 {
-	return _sdp_iocb_q_get(table, 0);
+	return sdp_iocb_q_get(table, 0);
 }
 
 /*
@@ -747,7 +745,7 @@ struct sdpc_iocb *sdp_iocb_q_get_tail(st
  */
 struct sdpc_iocb *sdp_iocb_q_get_head(struct sdpc_iocb_q *table)
 {
-	return _sdp_iocb_q_get(table, 1);
+	return sdp_iocb_q_get(table, 1);
 }
 
 /*
@@ -755,7 +753,7 @@ struct sdpc_iocb *sdp_iocb_q_get_head(st
  */
 int sdp_iocb_q_put_tail(struct sdpc_iocb_q *table, struct sdpc_iocb *iocb)
 {
-	return _sdp_iocb_q_put(table, iocb, 0);
+	return sdp_iocb_q_put(table, iocb, 0);
 }
 
 /*
@@ -763,15 +761,13 @@ int sdp_iocb_q_put_tail(struct sdpc_iocb
  */
 int sdp_iocb_q_put_head(struct sdpc_iocb_q *table, struct sdpc_iocb *iocb)
 {
-	return _sdp_iocb_q_put(table, iocb, 1);
+	return sdp_iocb_q_put(table, iocb, 1);
 }
 
 /*
  * sdp_iocb_q_cancel - cancel all outstanding AIOs in a queue
  */
-void sdp_iocb_q_cancel(struct sdpc_iocb_q *table,
-		       u32     mask,
-		       ssize_t comp)
+void sdp_iocb_q_cancel(struct sdpc_iocb_q *table, u32 mask, ssize_t comp)
 {
 	struct sdpc_iocb *iocb;
 	struct sdpc_iocb *next;
@@ -844,7 +840,7 @@ int sdp_main_iocb_init(void)
 	/*
 	 * initialize locking code.
 	 */
-	result =  _sdp_mem_lock_init();
+	result =  sdp_mem_lock_init();
 	if (result < 0) {
 		sdp_warn("Error <%d> initializing memory locking.", result);
 		return result;
@@ -852,23 +848,23 @@ int sdp_main_iocb_init(void)
 	/*
 	 * initialize the caches only once.
 	 */
-	if (__sdp_iocb_cache) {
+	if (sdp_iocb_cache) {
 		sdp_warn("IOCB caches already initialized.");
 		return -EINVAL;
 	}
 
-	__sdp_iocb_cache = kmem_cache_create("sdp_iocb",
+	sdp_iocb_cache = kmem_cache_create("sdp_iocb",
 					     sizeof(struct sdpc_iocb),
 					     0, SLAB_HWCACHE_ALIGN, NULL,
 					     NULL);
-	if (!__sdp_iocb_cache) {
+	if (!sdp_iocb_cache) {
 		result = -ENOMEM;
 		goto error_iocb_c;
 	}
 
 	return 0;
 error_iocb_c:
-	(void)_sdp_mem_lock_cleanup();
+	(void)sdp_mem_lock_cleanup();
 	return result;
 }
 
@@ -881,13 +877,13 @@ void sdp_main_iocb_cleanup(void)
 	/*
 	 * cleanup the caches
 	 */
-	kmem_cache_destroy(__sdp_iocb_cache);
+	kmem_cache_destroy(sdp_iocb_cache);
 	/*
 	 * null out entries.
 	 */
-	__sdp_iocb_cache = NULL;
+	sdp_iocb_cache = NULL;
 	/*
 	 * cleanup memory locking
 	 */
-	(void)_sdp_mem_lock_cleanup();
+	(void)sdp_mem_lock_cleanup();
 }




More information about the general mailing list