[Pvfs2-cvs] commit by pw in pvfs2/src/io/bmi/bmi_ib: ib.c ib.h mem.c openib.c util.c vapi.c

CVS commit program cvs at parl.clemson.edu
Fri Feb 22 15:04:44 EST 2008


Update of /projects/cvsroot/pvfs2/src/io/bmi/bmi_ib
In directory parlweb1:/tmp/cvs-serv23394/src/io/bmi/bmi_ib

Modified Files:
	ib.c ib.h mem.c openib.c util.c vapi.c 
Log Message:
bmi_ib: Malloc rename

Avoid exporting Malloc symbol; it may clash in the global namespace.



Index: ib.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_ib/ib.c,v
diff -u -p -p -u -r1.65 -r1.66
--- ib.c	15 Feb 2008 15:10:14 -0000	1.65
+++ ib.c	22 Feb 2008 20:04:43 -0000	1.66
@@ -452,7 +452,7 @@ find_matching_recv(rq_state_t statemask,
 static struct ib_work *
 alloc_new_recv(ib_connection_t *c, struct buf_head *bh)
 {
-    struct ib_work *rq = Malloc(sizeof(*rq));
+    struct ib_work *rq = bmi_ib_malloc(sizeof(*rq));
     rq->type = BMI_RECV;
     rq->c = c;
     ++rq->c->refcnt;
@@ -730,7 +730,7 @@ send_cts(struct ib_work *rq)
 	reg_recv_buflist.buf.recv = &reg_recv_buflist_buf;
 	reg_recv_buflist.len = &reg_recv_buflist_len;
 	reg_recv_buflist.tot_len = reg_recv_buflist_len;
-	reg_recv_buflist_buf = Malloc(reg_recv_buflist_len);
+	reg_recv_buflist_buf = bmi_ib_malloc(reg_recv_buflist_len);
 	memcache_register(ib_device->memcache, &reg_recv_buflist);
     }
     if (rq->buflist.tot_len > reg_recv_buflist_len)
@@ -818,7 +818,7 @@ post_send(bmi_op_id_t *id, struct bmi_me
     ibmap = remote_map->method_data;
 
     /* alloc and build new sendq structure */
-    sq = Malloc(sizeof(*sq));
+    sq = bmi_ib_malloc(sizeof(*sq));
     sq->type = BMI_SEND;
     sq->state.send = SQ_WAITING_BUFFER;
 
@@ -869,7 +869,7 @@ post_send(bmi_op_id_t *id, struct bmi_me
     qlist_add_tail(&sq->list, &ib_device->sendq);
 
     /* generate identifier used by caller to test for message later */
-    mop = Malloc(sizeof(*mop));
+    mop = bmi_ib_malloc(sizeof(*mop));
     id_gen_fast_register(&mop->op_id, mop);
     mop->addr = remote_map;  /* set of function pointers, essentially */
     mop->method_data = sq;
@@ -995,7 +995,7 @@ post_recv(bmi_op_id_t *id, struct bmi_me
 	  __func__, lld(tot_expected_len), lld(rq->buflist.tot_len));
 
     /* generate identifier used by caller to test for message later */
-    mop = Malloc(sizeof(*mop));
+    mop = bmi_ib_malloc(sizeof(*mop));
     id_gen_fast_register(&mop->op_id, mop);
     mop->addr = remote_map;  /* set of function pointers, essentially */
     mop->method_data = rq;
@@ -1386,7 +1386,7 @@ restart:
 	    debug(2, "%s: found waiting testunexpected", __func__);
 	    ui->error_code = 0;
 	    ui->addr = c->remote_map;  /* hand back permanent method_addr */
-	    ui->buffer = Malloc((unsigned long) rq->actual_len);
+	    ui->buffer = bmi_ib_malloc((unsigned long) rq->actual_len);
 	    ui->size = rq->actual_len;
 	    memcpy(ui->buffer,
 	           (msg_header_eager_t *) rq->bh->buf + 1,
@@ -1575,7 +1575,7 @@ static struct bmi_method_addr *BMI_ib_me
 	error("%s: no ':' found", __func__);
 
     /* copy to permanent storage */
-    hostname = Malloc((unsigned long) (cp - s + 1));
+    hostname = bmi_ib_malloc((unsigned long) (cp - s + 1));
     strncpy(hostname, s, (size_t) (cp-s));
     hostname[cp-s] = '\0';
 
@@ -1623,19 +1623,19 @@ static ib_connection_t *ib_new_connectio
     ib_connection_t *c;
     int i, ret;
 
-    c = Malloc(sizeof(*c));
+    c = bmi_ib_malloc(sizeof(*c));
     c->peername = strdup(peername);
 
     /* fill send and recv free lists and buf heads */
-    c->eager_send_buf_contig = Malloc(ib_device->eager_buf_num
+    c->eager_send_buf_contig = bmi_ib_malloc(ib_device->eager_buf_num
       * ib_device->eager_buf_size);
-    c->eager_recv_buf_contig = Malloc(ib_device->eager_buf_num
+    c->eager_recv_buf_contig = bmi_ib_malloc(ib_device->eager_buf_num
       * ib_device->eager_buf_size);
     INIT_QLIST_HEAD(&c->eager_send_buf_free);
     INIT_QLIST_HEAD(&c->eager_recv_buf_free);
-    c->eager_send_buf_head_contig = Malloc(ib_device->eager_buf_num
+    c->eager_send_buf_head_contig = bmi_ib_malloc(ib_device->eager_buf_num
       * sizeof(*c->eager_send_buf_head_contig));
-    c->eager_recv_buf_head_contig = Malloc(ib_device->eager_buf_num
+    c->eager_recv_buf_head_contig = bmi_ib_malloc(ib_device->eager_buf_num
       * sizeof(*c->eager_recv_buf_head_contig));
     for (i=0; i<ib_device->eager_buf_num; i++) {
 	struct buf_head *ebs = &c->eager_send_buf_head_contig[i];
@@ -1982,7 +1982,7 @@ static int BMI_ib_initialize(struct bmi_
 
     bmi_ib_method_id = method_id;
 
-    ib_device = Malloc(sizeof(*ib_device));
+    ib_device = bmi_ib_malloc(sizeof(*ib_device));
 
     /* try, in order, OpenIB then VAPI; set up function pointers */
     ret = 1;

Index: ib.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_ib/ib.h,v
diff -u -p -p -u -r1.31 -r1.32
--- ib.h	10 Feb 2008 16:56:29 -0000	1.31
+++ ib.h	22 Feb 2008 20:04:43 -0000	1.32
@@ -398,7 +398,7 @@ void warning_errno(const char *fmt, ...)
 void warning_xerrno(int errnum, const char *fmt, ...)
   __attribute__((format(printf,2,3)));
 void info(const char *fmt, ...) __attribute__((format(printf,1,2)));
-void *Malloc(unsigned long n) __attribute__((malloc));
+void *bmi_ib_malloc(unsigned long n) __attribute__((malloc));
 void *qlist_del_head(struct qlist_head *list);
 void *qlist_try_del_head(struct qlist_head *list);
 const char *sq_state_name(sq_state_t num);

Index: mem.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_ib/mem.c,v
diff -u -p -p -u -r1.15 -r1.16
--- mem.c	10 Feb 2008 16:56:29 -0000	1.15
+++ mem.c	22 Feb 2008 20:04:43 -0000	1.16
@@ -228,7 +228,8 @@ memcache_register(void *md, ib_buflist_t
     int i, ret;
     memcache_device_t *memcache_device = md;
 
-    buflist->memcache = Malloc(buflist->num * sizeof(*buflist->memcache));
+    buflist->memcache = bmi_ib_malloc(buflist->num *
+				      sizeof(*buflist->memcache));
     gen_mutex_lock(&memcache_device->mutex);
     for (i=0; i<buflist->num; i++) {
 #if ENABLE_MEMCACHE
@@ -256,7 +257,7 @@ memcache_register(void *md, ib_buflist_t
 	}
 	buflist->memcache[i] = c;
 #else
-	memcache_entry_t cp = Malloc(sizeof(*cp));
+	memcache_entry_t cp = bmi_ib_malloc(sizeof(*cp));
 	cp->buf = buflist->buf.recv[i];
 	cp->len = buflist->len[i];
 	cp->type = type;
@@ -337,7 +338,7 @@ void *memcache_init(int (*mem_register)(
 {
     memcache_device_t *memcache_device;
 
-    memcache_device = Malloc(sizeof(*memcache_device));
+    memcache_device = bmi_ib_malloc(sizeof(*memcache_device));
     INIT_QLIST_HEAD(&memcache_device->list);
     gen_mutex_init(&memcache_device->mutex);
     INIT_QLIST_HEAD(&memcache_device->free_chunk_list);

Index: openib.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_ib/openib.c,v
diff -u -p -p -u -r1.15 -r1.16
--- openib.c	10 Feb 2008 16:56:29 -0000	1.15
+++ openib.c	22 Feb 2008 20:04:43 -0000	1.16
@@ -115,7 +115,7 @@ static int openib_new_connection(ib_conn
     } ch_in, ch_out;
 
     /* build new connection/context */
-    oc = Malloc(sizeof(*oc));
+    oc = bmi_ib_malloc(sizeof(*oc));
     c->priv = oc;
 
     /* register memory region, Recv side */
@@ -163,7 +163,8 @@ static int openib_new_connection(ib_conn
 	od->sg_max_len = att.cap.max_send_sge;
 	if (att.cap.max_recv_sge < od->sg_max_len)
 	    od->sg_max_len = att.cap.max_recv_sge;
-	od->sg_tmp_array = Malloc(od->sg_max_len * sizeof(*od->sg_tmp_array));
+	od->sg_tmp_array = bmi_ib_malloc(od->sg_max_len *
+					 sizeof(*od->sg_tmp_array));
     } else {
 	if (att.cap.max_send_sge < od->sg_max_len)
 	    error("%s: new conn has smaller send SG array size %d vs %d",
@@ -477,7 +478,7 @@ static void openib_post_sr_rdmaw(struct 
         reg_send_buflist.buf.recv = &reg_send_buflist_buf;
         reg_send_buflist.len = &reg_send_buflist_len;
         reg_send_buflist.tot_len = reg_send_buflist_len;
-        reg_send_buflist_buf = Malloc(reg_send_buflist_len);
+	reg_send_buflist_buf = bmi_ib_malloc(reg_send_buflist_len);
         memcache_register(ib_device->memcache, &reg_send_buflist, BMI_SEND);
     }
     if (sq->buflist.tot_len > reg_send_buflist_len)
@@ -877,7 +878,7 @@ int openib_ib_initialize(void)
     }
     VALGRIND_MAKE_MEM_DEFINED(ctx, sizeof(*ctx));
 
-    od = Malloc(sizeof(*od));
+    od = bmi_ib_malloc(sizeof(*od));
     ib_device->priv = od;
 
     /* set the function pointers for openib */

Index: util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_ib/util.c,v
diff -u -p -p -u -r1.13 -r1.14
--- util.c	10 Feb 2008 16:56:29 -0000	1.13
+++ util.c	22 Feb 2008 20:04:43 -0000	1.14
@@ -94,7 +94,7 @@ warning_xerrno(int errnum, const char *f
 }
 
 void * __attribute__((malloc)) __hidden
-Malloc(unsigned long n)
+bmi_ib_malloc(unsigned long n)
 {
     char *x;
 

Index: vapi.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_ib/vapi.c,v
diff -u -p -p -u -r1.14 -r1.15
--- vapi.c	10 Feb 2008 16:56:29 -0000	1.14
+++ vapi.c	22 Feb 2008 20:04:43 -0000	1.15
@@ -115,7 +115,7 @@ static int vapi_new_connection(ib_connec
 	VAPI_qp_num_t qp_num;
     } ch_in, ch_out;
 
-    vc = Malloc(sizeof(*vc));
+    vc = bmi_ib_malloc(sizeof(*vc));
     c->priv = vc;
 
     /* register memory region, recv */
@@ -248,7 +248,8 @@ static void verify_prop_caps(VAPI_qp_cap
 	vd->sg_max_len = cap->max_sg_size_sq;
 	if (cap->max_sg_size_rq < vd->sg_max_len)
 	    vd->sg_max_len = cap->max_sg_size_rq;
-	vd->sg_tmp_array = Malloc(vd->sg_max_len * sizeof(*vd->sg_tmp_array));
+	vd->sg_tmp_array = bmi_ib_malloc(vd->sg_max_len *
+					 sizeof(*vd->sg_tmp_array));
     } else {
 	if (cap->max_sg_size_sq < vd->sg_max_len)
 	    error(
@@ -487,7 +488,7 @@ static void vapi_post_sr_rdmaw(struct ib
 	reg_send_buflist.buf.recv = &reg_send_buflist_buf;
 	reg_send_buflist.len = &reg_send_buflist_len;
 	reg_send_buflist.tot_len = reg_send_buflist_len;
-	reg_send_buflist_buf = Malloc(reg_send_buflist_len);
+	reg_send_buflist_buf = bmi_ib_malloc(reg_send_buflist_len);
 	memcache_register(ib_device->memcache, &reg_send_buflist);
     }
     if (sq->buflist.tot_len > reg_send_buflist_len)
@@ -897,7 +898,7 @@ int vapi_ib_initialize(void)
     if (num_hcas > 1)
 	warning("%s: found %d HCAs, choosing the first", __func__, num_hcas);
 
-    vd = Malloc(sizeof(*vd));
+    vd = bmi_ib_malloc(sizeof(*vd));
     ib_device->priv = vd;
 
     /* set the function pointers for vapi */



More information about the Pvfs2-cvs mailing list