[PVFS2-CVS] commit by slang in pvfs2/src/io/bmi: bmi-method-support.h bmi-types.h bmi.c bmi.h reference-list.c

CVS commit program cvs at parl.clemson.edu
Thu Aug 25 17:38:20 EDT 2005


Update of /projects/cvsroot/pvfs2/src/io/bmi
In directory parlweb:/tmp/cvs-serv7520/src/io/bmi

Modified Files:
      Tag: slang-event-changes-branch
	bmi-method-support.h bmi-types.h bmi.c bmi.h reference-list.c 
Log Message:
updates to my event changes to bring them inline with trunk


Index: bmi-method-support.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi-method-support.h,v
diff -p -u -r1.22 -r1.22.6.1
--- bmi-method-support.h	2 Dec 2004 18:09:22 -0000	1.22
+++ bmi-method-support.h	25 Aug 2005 20:38:19 -0000	1.22.6.1
@@ -155,6 +155,7 @@ struct bmi_method_ops
     int (*BMI_meth_open_context)(bmi_context_id);
     void (*BMI_meth_close_context)(bmi_context_id);
     int (*BMI_meth_cancel)(bmi_op_id_t, bmi_context_id);
+    const char* (*BMI_meth_rev_lookup_unexpected)(method_addr_p);
 };
 
 

Index: bmi-types.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi-types.h,v
diff -p -u -r1.22 -r1.22.6.1
--- bmi-types.h	11 Jan 2005 17:24:18 -0000	1.22
+++ bmi-types.h	25 Aug 2005 20:38:19 -0000	1.22.6.1
@@ -128,10 +128,19 @@ enum
 #define BMI_EHOSTDOWN       (PVFS_EHOSTDOWN | PVFS_ERROR_BMI)
 #define BMI_EHOSTUNREACH    (PVFS_EHOSTUNREACH | PVFS_ERROR_BMI)
 #define BMI_EALREADY        (PVFS_EALREADY | PVFS_ERROR_BMI)
+#define BMI_EACCES          (PVFS_EACCES | PVFS_ERROR_BMI)
+
 #define BMI_EREMOTEIO       (PVFS_EREMOTEIO | PVFS_ERROR_BMI)
 #define BMI_ENOMEDIUM       (PVFS_ENOMEDIUM | PVFS_ERROR_BMI)
 #define BMI_EMEDIUMTYPE     (PVFS_EMEDIUMTYPE | PVFS_ERROR_BMI)
+
 #define BMI_ECANCEL	    (PVFS_ECANCEL | PVFS_ERROR_BMI)
+#define BMI_EDEVINIT	    (PVFS_EDEVINIT | PVFS_ERROR_BMI)
+#define BMI_EDETAIL	    (PVFS_EDETAIL | PVFS_ERROR_BMI)
+#define BMI_EHOSTNTFD	    (PVFS_EHOSTNTFD | PVFS_ERROR_BMI)
+#define BMI_EADDRNTFD	    (PVFS_EADDRNTFD | PVFS_ERROR_BMI)
+#define BMI_ENORECVR	    (PVFS_ENORECVR | PVFS_ERROR_BMI)
+#define BMI_ETRYAGAIN	    (PVFS_ETRYAGAIN | PVFS_ERROR_BMI)
 
 /** default bmi error translation function */
 int bmi_errno_to_pvfs(int error);

Index: bmi.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi.c,v
diff -p -u -r1.61 -r1.61.6.1
--- bmi.c	21 Dec 2004 17:52:18 -0000	1.61
+++ bmi.c	25 Aug 2005 20:38:19 -0000	1.61.6.1
@@ -1011,6 +1011,39 @@ const char* BMI_addr_rev_lookup(PVFS_BMI
     return(tmp_str);
 }
 
+/** Performs a reverse lookup, returning a string
+ *  address for a given opaque address.  Works on any address, even those
+ *  generated unexpectedly, but only gives hostname instead of full
+ *  BMI URL style address
+ *
+ *  NOTE: caller must not free or modify returned string
+ *
+ *  \return Pointer to string on success, NULL on failure.
+ */
+const char* BMI_addr_rev_lookup_unexpected(PVFS_BMI_addr_t addr)
+{
+    ref_st_p tmp_ref = NULL;
+
+    /* find a reference that matches this address */
+    gen_mutex_lock(&ref_mutex);
+    tmp_ref = ref_list_search_addr(cur_ref_list, addr);
+    if (!tmp_ref)
+    {
+	gen_mutex_unlock(&ref_mutex);
+	return ("UNKNOWN");
+    }
+    gen_mutex_unlock(&ref_mutex);
+    
+    if(!tmp_ref->interface->BMI_meth_rev_lookup_unexpected)
+    {
+        return("UNKNOWN");
+    }
+
+    return(tmp_ref->interface->BMI_meth_rev_lookup_unexpected(
+        tmp_ref->method_addr));
+}
+
+
 /** Allocates memory that can be used in native mode by the BMI layer.
  *
  *  \return Pointer to buffer on success, NULL on failure.
@@ -1572,7 +1605,7 @@ int BMI_cancel(bmi_op_id_t id, 
     int ret = -1;
 
     gossip_debug(GOSSIP_BMI_DEBUG_CONTROL,
-                 "%s: cancel context_id %Lu\n", __func__, Lu(id));
+                 "%s: cancel id %Lu\n", __func__, Lu(id));
 
     target_op = id_gen_safe_lookup(id);
     assert(target_op->op_id == id);
@@ -1798,6 +1831,7 @@ case err: bmi_errno = BMI_##err; break
         __CASE(EHOSTDOWN);
         __CASE(EHOSTUNREACH);
         __CASE(EALREADY);
+        __CASE(EACCES);
 #undef __CASE
     }
     return bmi_errno;

Index: bmi.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi.h,v
diff -p -u -r1.26 -r1.26.6.1
--- bmi.h	21 Dec 2004 17:52:18 -0000	1.26
+++ bmi.h	25 Aug 2005 20:38:19 -0000	1.26.6.1
@@ -124,6 +124,8 @@ int BMI_addr_lookup(PVFS_BMI_addr_t * ne
 
 const char* BMI_addr_rev_lookup(PVFS_BMI_addr_t addr);
 
+const char* BMI_addr_rev_lookup_unexpected(PVFS_BMI_addr_t addr);
+
 int BMI_post_send_list(bmi_op_id_t * id,
 		       PVFS_BMI_addr_t dest,
 		       const void *const *buffer_list,

Index: reference-list.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/reference-list.c,v
diff -p -u -r1.9 -r1.9.6.1
--- reference-list.c	28 Jul 2004 14:32:39 -0000	1.9
+++ reference-list.c	25 Aug 2005 20:38:20 -0000	1.9.6.1
@@ -174,7 +174,7 @@ void ref_list_cleanup(ref_list_p rlp)
     {
 	tmp_entry = qlist_entry(tmp_link, struct ref_st,
 				list_link);
-	free(tmp_entry);
+        dealloc_ref_st(tmp_entry);
     }
 
     free(rlp);



More information about the PVFS2-CVS mailing list