[openib-general] [PATCH][10/19] kDAPL: Remove typedef DAT_MEM_PRIV_FLAGS

Tom Duffy Tom.Duffy at Sun.COM
Sun May 15 11:27:17 PDT 2005


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

diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/dat/dat.h linux-kernel10/dat/dat.h
--- linux-kernel9/dat/dat.h	2005-05-13 14:18:22.224001000 -0700
+++ linux-kernel10/dat/dat.h	2005-05-13 14:21:13.415001000 -0700
@@ -533,14 +533,14 @@ enum dat_mem_type {
 };
 
 /* Memory privileges */
-typedef enum dat_mem_priv_flags {
+enum dat_mem_priv_flags {
 	DAT_MEM_PRIV_NONE_FLAG = 0x00,
 	DAT_MEM_PRIV_LOCAL_READ_FLAG = 0x01,
 	DAT_MEM_PRIV_REMOTE_READ_FLAG = 0x02,
 	DAT_MEM_PRIV_LOCAL_WRITE_FLAG = 0x10,
 	DAT_MEM_PRIV_REMOTE_WRITE_FLAG = 0x20,
 	DAT_MEM_PRIV_ALL_FLAG = 0x33
-} DAT_MEM_PRIV_FLAGS;
+};
 
 #define DAT_MEM_PRIV_READ_FLAG \
 	(DAT_MEM_PRIV_LOCAL_READ_FLAG | DAT_MEM_PRIV_REMOTE_READ_FLAG)
@@ -552,7 +552,7 @@ struct dat_rmr_param {
 	DAT_IA_HANDLE ia_handle;
 	DAT_PZ_HANDLE pz_handle;
 	struct dat_lmr_triplet lmr_triplet;
-	DAT_MEM_PRIV_FLAGS mem_priv;
+	enum dat_mem_priv_flags mem_priv;
 	DAT_RMR_CONTEXT rmr_context;
 };
 
@@ -982,7 +982,7 @@ struct dat_lmr_param {
 	DAT_REGION_DESCRIPTION region_desc;
 	u64 length;
 	DAT_PZ_HANDLE pz_handle;
-	DAT_MEM_PRIV_FLAGS mem_priv;
+	enum dat_mem_priv_flags mem_priv;
 	DAT_LMR_CONTEXT lmr_context;
 	DAT_RMR_CONTEXT rmr_context;
 	u64 registered_size;
@@ -1203,7 +1203,7 @@ typedef u32 (*DAT_RMR_CREATE_FUNC)(DAT_P
 typedef u32 (*DAT_RMR_QUERY_FUNC)(DAT_RMR_HANDLE, struct dat_rmr_param *);
 
 typedef u32 (*DAT_RMR_BIND_FUNC)(DAT_RMR_HANDLE, const struct dat_lmr_triplet *,
-				 DAT_MEM_PRIV_FLAGS, DAT_EP_HANDLE,
+				 enum dat_mem_priv_flags, DAT_EP_HANDLE,
 				 DAT_RMR_COOKIE, enum dat_completion_flags,
 				 DAT_RMR_CONTEXT *);
 
@@ -1249,7 +1249,7 @@ typedef u32 (*DAT_SRQ_POST_RECV_FUNC)(DA
 
 typedef u32 (*DAT_LMR_KCREATE_FUNC)(DAT_IA_HANDLE, enum dat_mem_type,
 				    DAT_REGION_DESCRIPTION, u64,
-				    DAT_PZ_HANDLE, DAT_MEM_PRIV_FLAGS,
+				    DAT_PZ_HANDLE, enum dat_mem_priv_flags,
 				    DAT_MEM_OPTIMIZE_FLAGS, DAT_LMR_HANDLE *,
 				    DAT_LMR_CONTEXT *, DAT_RMR_CONTEXT *,
 				    u64 *, u64 *);
@@ -1664,7 +1664,7 @@ static inline u32 dat_rmr_query(DAT_RMR_
 
 static inline u32 dat_rmr_bind(DAT_RMR_HANDLE rmr,
 			       const struct dat_lmr_triplet *iov,
-			       DAT_MEM_PRIV_FLAGS mem_flags,
+			       enum dat_mem_priv_flags mem_flags,
 			       DAT_EP_HANDLE ep, DAT_RMR_COOKIE cookie,
 			       enum dat_completion_flags comp_flags,
 			       DAT_RMR_CONTEXT *context)
@@ -1776,7 +1776,7 @@ static inline u32 dat_srq_set_lw(DAT_SRQ
 static inline u32 dat_lmr_kcreate(DAT_IA_HANDLE ia, enum dat_mem_type type,
 				  DAT_REGION_DESCRIPTION region, u64 len,
 				  DAT_PZ_HANDLE pz,
-				  DAT_MEM_PRIV_FLAGS privileges,
+				  enum dat_mem_priv_flags privileges,
 				  DAT_MEM_OPTIMIZE_FLAGS optimization,
 				  DAT_LMR_HANDLE *lmr_handle,
 				  DAT_LMR_CONTEXT *lmr_context,
diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/dat-provider/dapl_adapter_util.h linux-kernel10/dat-provider/dapl_adapter_util.h
--- linux-kernel9/dat-provider/dapl_adapter_util.h	2005-05-13 13:48:10.178969000 -0700
+++ linux-kernel10/dat-provider/dapl_adapter_util.h	2005-05-13 14:20:59.246005000 -0700
@@ -103,16 +103,16 @@ u32 dapl_ib_pd_alloc(DAPL_IA *ia_ptr, DA
 u32 dapl_ib_pd_free(DAPL_PZ *pz);
 
 u32 dapl_ib_mr_register(DAPL_IA *ia_ptr, DAPL_LMR *lmr, void *virt_addr,
-			u64 length, DAT_MEM_PRIV_FLAGS privileges);
+			u64 length, enum dat_mem_priv_flags privileges);
 
 u32 dapl_ib_mr_register_physical(DAPL_IA *ia_ptr, DAPL_LMR *lmr,
 				 void *phys_addr, u64 length,
-				 DAT_MEM_PRIV_FLAGS privileges);
+				 enum dat_mem_priv_flags privileges);
 
 u32 dapl_ib_mr_deregister(DAPL_LMR *lmr);
 
 u32 dapl_ib_mr_register_shared(DAPL_IA *ia_ptr, DAPL_LMR *lmr,
-			       DAT_MEM_PRIV_FLAGS privileges);
+			       enum dat_mem_priv_flags privileges);
 
 u32 dapl_ib_mw_alloc(DAPL_RMR *rmr);
 
@@ -120,7 +120,7 @@ u32 dapl_ib_mw_free(DAPL_RMR *rmr);
 
 u32 dapl_ib_mw_bind(DAPL_RMR *rmr, DAPL_LMR *lmr, DAPL_EP *ep,
 		    DAPL_COOKIE *cookie, u64 virtual_address,
-		    u64 length, DAT_MEM_PRIV_FLAGS mem_priv,
+		    u64 length, enum dat_mem_priv_flags mem_priv,
 		    boolean_t is_signaled);
 
 u32 dapl_ib_mw_unbind(DAPL_RMR *rmr, DAPL_EP *ep, DAPL_COOKIE *cookie,
diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/dat-provider/dapl.h linux-kernel10/dat-provider/dapl.h
--- linux-kernel9/dat-provider/dapl.h	2005-05-13 14:18:52.134000000 -0700
+++ linux-kernel10/dat-provider/dapl.h	2005-05-13 14:22:36.958045000 -0700
@@ -627,7 +627,7 @@ extern u32 dapl_ep_set_watermark(DAT_EP_
 extern u32 dapl_lmr_kcreate(DAT_IA_HANDLE ia_handle, enum dat_mem_type mem_type,
 			    DAT_REGION_DESCRIPTION region_description,
 			    u64 length, DAT_PZ_HANDLE pz_handle,
-			    DAT_MEM_PRIV_FLAGS privileges,
+			    enum dat_mem_priv_flags privileges,
 			    DAT_MEM_OPT optimization,
 			    DAT_LMR_HANDLE *lmr_handle,
 			    DAT_LMR_CONTEXT *lmr_context,
@@ -656,7 +656,8 @@ extern u32 dapl_rmr_query(DAT_RMR_HANDLE
 
 extern u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_handle,
 			 const struct dat_lmr_triplet *lmr_triplet,
-			 DAT_MEM_PRIV_FLAGS mem_priv, DAT_EP_HANDLE ep_handle,
+			 enum dat_mem_priv_flags mem_priv,
+			 DAT_EP_HANDLE ep_handle,
 			 DAT_RMR_COOKIE user_cookie,
 			 enum dat_completion_flags completion_flags,
 			 DAT_RMR_CONTEXT *context);
diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/dat-provider/dapl_lmr_kcreate.c linux-kernel10/dat-provider/dapl_lmr_kcreate.c
--- linux-kernel9/dat-provider/dapl_lmr_kcreate.c	2005-05-13 14:14:08.090970000 -0700
+++ linux-kernel10/dat-provider/dapl_lmr_kcreate.c	2005-05-13 14:23:13.154000000 -0700
@@ -39,7 +39,7 @@
 
 static inline u32 dapl_lmr_create_virtual(DAPL_IA *ia, void *virt_addr,
 					  u64 length, DAPL_PZ *pz,
-					  DAT_MEM_PRIV_FLAGS privileges,
+					  enum dat_mem_priv_flags privileges,
 					  DAT_LMR_HANDLE *lmr_handle,
 					  DAT_LMR_CONTEXT *lmr_context,
 					  DAT_RMR_CONTEXT *rmr_context,
@@ -117,7 +117,7 @@ bail:
 static inline u32 dapl_lmr_create_physical(DAPL_IA *ia,
 					   DAT_REGION_DESCRIPTION phys_addr,
 					   u64 page_count, DAPL_PZ *pz,
-					   DAT_MEM_PRIV_FLAGS privileges,
+					   enum dat_mem_priv_flags privileges,
 					   DAT_LMR_HANDLE *lmr_handle,
 					   DAT_LMR_CONTEXT *lmr_context,
 					   DAT_RMR_CONTEXT *rmr_context,
@@ -192,7 +192,7 @@ bail:
 
 static inline u32 dapl_lmr_create_lmr(DAPL_IA *ia, DAPL_LMR *original_lmr,
 				      DAPL_PZ *pz,
-				      DAT_MEM_PRIV_FLAGS privileges,
+				      enum dat_mem_priv_flags privileges,
 				      DAT_LMR_HANDLE *lmr_handle,
 				      DAT_LMR_CONTEXT *lmr_context,
 				      DAT_RMR_CONTEXT *rmr_context,
@@ -303,7 +303,8 @@ bail:
  */
 u32 dapl_lmr_kcreate(DAT_IA_HANDLE ia_handle, enum dat_mem_type mem_type,
 		     DAT_REGION_DESCRIPTION region_description, u64 length,
-		     DAT_PZ_HANDLE pz_handle, DAT_MEM_PRIV_FLAGS privileges,
+		     DAT_PZ_HANDLE pz_handle,
+		     enum dat_mem_priv_flags privileges,
 		     DAT_MEM_OPT optimization, DAT_LMR_HANDLE *lmr_handle,
 		     DAT_LMR_CONTEXT *lmr_context, DAT_RMR_CONTEXT *rmr_context,		     u64 *registered_length, u64 *registered_address)
 {
diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/dat-provider/dapl_lmr_util.c linux-kernel10/dat-provider/dapl_lmr_util.c
--- linux-kernel9/dat-provider/dapl_lmr_util.c	2005-05-13 14:14:08.094964000 -0700
+++ linux-kernel10/dat-provider/dapl_lmr_util.c	2005-05-13 14:23:32.165001000 -0700
@@ -42,7 +42,8 @@ DAPL_LMR *dapl_lmr_alloc(DAPL_IA * ia,
 			 enum dat_mem_type mem_type,
 			 DAT_REGION_DESCRIPTION region_desc,
 			 u64 length,
-			 DAT_PZ_HANDLE pz_handle, DAT_MEM_PRIV_FLAGS mem_priv)
+			 DAT_PZ_HANDLE pz_handle,
+			 enum dat_mem_priv_flags mem_priv)
 {
 	DAPL_LMR *lmr;
 
diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/dat-provider/dapl_lmr_util.h linux-kernel10/dat-provider/dapl_lmr_util.h
--- linux-kernel9/dat-provider/dapl_lmr_util.h	2005-05-13 14:14:08.096974000 -0700
+++ linux-kernel10/dat-provider/dapl_lmr_util.h	2005-05-13 14:20:59.256013000 -0700
@@ -50,7 +50,7 @@ extern DAPL_LMR *dapl_lmr_alloc(DAPL_IA 
 				DAT_REGION_DESCRIPTION region_desc,
 				u64 length,
 				DAT_PZ_HANDLE pz_handle,
-				DAT_MEM_PRIV_FLAGS mem_priv);
+				enum dat_mem_priv_flags mem_priv);
 
 extern void dapl_lmr_dealloc(DAPL_LMR * lmr);
 
diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/dat-provider/dapl_openib_util.c linux-kernel10/dat-provider/dapl_openib_util.c
--- linux-kernel9/dat-provider/dapl_openib_util.c	2005-05-13 11:38:08.167002000 -0700
+++ linux-kernel10/dat-provider/dapl_openib_util.c	2005-05-13 14:26:12.927003000 -0700
@@ -111,7 +111,7 @@ static struct ib_status_map {
  * Convert DAPL mem privileges to provider equivalents
  *
  * Input:
- *	DAT_MEM_PRIV_FLAGS
+ *	enum dat_mem_priv_flags
  *
  * Output:
  *	none
@@ -120,21 +120,20 @@ static struct ib_status_map {
  *	provider equivalent memory flags
  *
  */
-static __inline__ int
-dapl_ib_convert_mem_privileges(DAT_MEM_PRIV_FLAGS privileges)
+static inline int dapl_ib_convert_mem_privileges(enum dat_mem_priv_flags priv)
 {
 	enum ib_access_flags value = 0;
 
 	/*
-	 * if (DAT_MEM_PRIV_LOCAL_READ_FLAG & privileges) do nothing
+	 * if (DAT_MEM_PRIV_LOCAL_READ_FLAG & priv) do nothing
 	 */
-	if (DAT_MEM_PRIV_LOCAL_WRITE_FLAG & privileges)
+	if (DAT_MEM_PRIV_LOCAL_WRITE_FLAG & priv)
 		value |= IB_ACCESS_LOCAL_WRITE;
 
-	if (DAT_MEM_PRIV_REMOTE_READ_FLAG & privileges)
+	if (DAT_MEM_PRIV_REMOTE_READ_FLAG & priv)
 		value |= IB_ACCESS_REMOTE_READ;
 
-	if (DAT_MEM_PRIV_REMOTE_WRITE_FLAG & privileges)
+	if (DAT_MEM_PRIV_REMOTE_WRITE_FLAG & priv)
 		value |= IB_ACCESS_REMOTE_WRITE;
 
 	return value;
@@ -391,7 +390,7 @@ u32 dapl_ib_pd_free(DAPL_PZ *pz)
  *
  */
 u32 dapl_ib_mr_register(DAPL_IA *ia, DAPL_LMR *lmr, void *virt_addr,
-			u64 length, DAT_MEM_PRIV_FLAGS privileges)
+			u64 length, enum dat_mem_priv_flags privileges)
 {
 	/* ITBD virtual memory registration ??? */
 	return (DAT_SUCCESS);
@@ -399,7 +398,7 @@ u32 dapl_ib_mr_register(DAPL_IA *ia, DAP
 
 u32 dapl_ib_mr_register_physical(DAPL_IA *ia_ptr, DAPL_LMR *lmr,
 				 void *phys_addr, u64 length,
-				 DAT_MEM_PRIV_FLAGS privileges)
+				 enum dat_mem_priv_flags privileges)
 {
 	int ib_status;
 	int i;
@@ -578,7 +577,7 @@ u32 dapl_ib_mw_free(DAPL_RMR *rmr)
  */
 u32 dapl_ib_mw_bind(DAPL_RMR *rmr, DAPL_LMR *lmr, DAPL_EP *ep,
 		    DAPL_COOKIE *cookie, u64 virtual_address,
-		    u64 length, DAT_MEM_PRIV_FLAGS mem_priv,
+		    u64 length, enum dat_mem_priv_flags mem_priv,
 		    boolean_t is_signaled)
 {
 	int ib_status;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/dat-provider/dapl_rmr_bind.c linux-kernel10/dat-provider/dapl_rmr_bind.c
--- linux-kernel9/dat-provider/dapl_rmr_bind.c	2005-05-13 12:55:03.339011000 -0700
+++ linux-kernel10/dat-provider/dapl_rmr_bind.c	2005-05-13 14:20:59.266003000 -0700
@@ -48,7 +48,7 @@
 
 static inline u32 dapl_rmr_bind_fuse(DAPL_RMR *rmr,
 				     const struct dat_lmr_triplet *lmr_triplet,
-				     DAT_MEM_PRIV_FLAGS mem_priv,
+				     enum dat_mem_priv_flags mem_priv,
 				     DAPL_EP *ep_ptr,
 				     DAT_RMR_COOKIE user_cookie,
 				     enum dat_completion_flags completion_flags,
@@ -249,7 +249,7 @@ static inline u32 dapl_rmr_bind_unfuse(D
  */
 u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_handle,
 		  const struct dat_lmr_triplet *lmr_triplet,
-		  DAT_MEM_PRIV_FLAGS mem_priv, DAT_EP_HANDLE ep_handle,
+		  enum dat_mem_priv_flags mem_priv, DAT_EP_HANDLE ep_handle,
 		  DAT_RMR_COOKIE user_cookie,
 		  enum dat_completion_flags completion_flags,
 		  DAT_RMR_CONTEXT *rmr_context)
diff -Nurp -X /home/tduffy/dontdiff linux-kernel9/test/dapltest/test/dapl_bpool.c linux-kernel10/test/dapltest/test/dapl_bpool.c
--- linux-kernel9/test/dapltest/test/dapl_bpool.c	2005-05-13 14:14:08.140007000 -0700
+++ linux-kernel10/test/dapltest/test/dapl_bpool.c	2005-05-13 14:20:59.279008000 -0700
@@ -209,7 +209,7 @@ DT_BpoolAlloc (
     {
     	struct dat_lmr_triplet iov;
     	DAT_RMR_COOKIE  cookie;
-    	DAT_MEM_PRIV_FLAGS mflags;
+    	enum dat_mem_priv_flags mflags;
     	struct dat_rmr_bind_completion_event_data rmr_stat;
     
     	/* create the RMR */




More information about the general mailing list