Преглед изворни кода

corotype: drop deprecated CPG_ defines

the only user of those obsoleted defines is dlm master (already ported)
to use CS_ and cmirror (that needs full porting to new corosync either way).

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Fabio M. Di Nitto пре 14 година
родитељ
комит
62bbe076a8

+ 0 - 23
include/corosync/corotypes.h

@@ -210,29 +210,6 @@ static inline cs_error_t qb_to_cs_error (int result)
 	return err;
 }
 
-
-/*
- * DEPRECATED
- */
-#define CPG_DISPATCH_ONE			CS_DISPATCH_ONE
-#define CPG_DISPATCH_ALL			CS_DISPATCH_ALL
-#define CPG_DISPATCH_BLOCKING		CS_DISPATCH_BLOCKING
-#define CPG_OK						CS_OK
-#define CPG_ERR_LIBRARY				CS_ERR_LIBRARY
-#define CPG_ERR_TIMEOUT				CS_ERR_TIMEOUT
-#define CPG_ERR_TRY_AGAIN			CS_ERR_TRY_AGAIN
-#define CPG_ERR_INVALID_PARAM		CS_ERR_INVALID_PARAM
-#define CPG_ERR_NO_MEMORY			CS_ERR_NO_MEMORY
-#define CPG_ERR_BAD_HANDLE			CS_ERR_BAD_HANDLE
-#define CPG_ERR_ACCESS				CS_ERR_ACCESS
-#define CPG_ERR_BUSY				CS_ERR_BUSY
-#define CPG_ERR_NOT_EXIST			CS_ERR_NOT_EXIST
-#define CPG_ERR_EXIST				CS_ERR_EXIST
-#define CPG_ERR_NOT_SUPPORTED		CS_ERR_NOT_SUPPORTED
-#define CPG_ERR_SECURITY			CS_ERR_SECURITY
-#define CPG_ERR_TOO_MANY_GROUPS		CS_ERR_TOO_MANY_GROUPS
-#define cpg_error_t cs_error_t
-
 /*
  * static inline so multiple libraries can link into same binary
  */

+ 1 - 1
lib/cfg.c

@@ -177,7 +177,7 @@ corosync_cfg_dispatch (
 		}
 		if (error == CS_ERR_TRY_AGAIN) {
 			error = CS_OK;
-			if (dispatch_flags == CPG_DISPATCH_ALL) {
+			if (dispatch_flags == CS_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
 				continue; /* next poll */

+ 7 - 7
lib/cpg.c

@@ -158,7 +158,7 @@ cs_error_t cpg_model_initialize (
 	struct cpg_inst *cpg_inst;
 
 	if (model != CPG_MODEL_V1) {
-		error = CPG_ERR_INVALID_PARAM;
+		error = CS_ERR_INVALID_PARAM;
 		goto error_no_destroy;
 	}
 
@@ -227,7 +227,7 @@ cs_error_t cpg_finalize (
 	 */
 	if (cpg_inst->finalize) {
 		hdb_handle_put (&cpg_handle_t_db, handle);
-		return (CPG_ERR_BAD_HANDLE);
+		return (CS_ERR_BAD_HANDLE);
 	}
 
 	cpg_inst->finalize = 1;
@@ -346,7 +346,7 @@ cs_error_t cpg_dispatch (
 	 * Timeout instantly for CS_DISPATCH_ONE or CS_DISPATCH_ALL and
 	 * wait indefinately for CS_DISPATCH_BLOCKING
 	 */
-	if (dispatch_types == CPG_DISPATCH_ALL) {
+	if (dispatch_types == CS_DISPATCH_ALL) {
 		timeout = 0;
 	}
 
@@ -364,7 +364,7 @@ cs_error_t cpg_dispatch (
 		}
 		if (error == CS_ERR_TRY_AGAIN) {
 			error = CS_OK;
-			if (dispatch_types == CPG_DISPATCH_ALL) {
+			if (dispatch_types == CS_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
 				continue; /* next poll */
@@ -521,7 +521,7 @@ cs_error_t cpg_join (
 		if (error != CS_OK) {
 			goto error_exit;
 		}
-	} while (response.header.error == CPG_ERR_BUSY);
+	} while (response.header.error == CS_ERR_BUSY);
 
 	error = response.header.error;
 
@@ -562,7 +562,7 @@ cs_error_t cpg_leave (
 		if (error != CS_OK) {
 			goto error_exit;
 		}
-	} while (res_lib_cpg_leave.header.error == CPG_ERR_BUSY);
+	} while (res_lib_cpg_leave.header.error == CS_ERR_BUSY);
 
 	error = res_lib_cpg_leave.header.error;
 
@@ -613,7 +613,7 @@ cs_error_t cpg_membership_get (
 		if (error != CS_OK) {
 			goto error_exit;
 		}
-	} while (res_lib_cpg_membership_get.header.error == CPG_ERR_BUSY);
+	} while (res_lib_cpg_membership_get.header.error == CS_ERR_BUSY);
 
 	error = res_lib_cpg_membership_get.header.error;
 

+ 1 - 1
lib/quorum.c

@@ -387,7 +387,7 @@ cs_error_t quorum_dispatch (
 		}
 		if (error == CS_ERR_TRY_AGAIN) {
 			error = CS_OK;
-			if (dispatch_types == CPG_DISPATCH_ALL) {
+			if (dispatch_types == CS_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
 				continue; /* next poll */

+ 1 - 1
lib/votequorum.c

@@ -461,7 +461,7 @@ cs_error_t votequorum_dispatch (
 		}
 		if (error == CS_ERR_TRY_AGAIN) {
 			error = CS_OK;
-			if (dispatch_types == CPG_DISPATCH_ALL) {
+			if (dispatch_types == CS_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
 				continue; /* next poll */

+ 1 - 1
man/cpg_context_get.3

@@ -44,7 +44,7 @@ The
 function is used to retrieve the context variable previously stored using
 .B cpg_context_set(3)
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_context_set.3

@@ -46,7 +46,7 @@ meaning inside libcpg itself and will not be touched by the library. It can
 be retrieved using
 .B cpg_context_get(3)
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 7 - 7
man/cpg_dispatch.3

@@ -60,9 +60,9 @@ defined by the structure:
 .nf
 .ta 4n 30n 33n
 typedef enum {
-        CPG_DISPATCH_ONE,
-        CPG_DISPATCH_ALL,
-        CPG_DISPATCH_BLOCKING
+        CS_DISPATCH_ONE,
+        CS_DISPATCH_ALL,
+        CS_DISPATCH_BLOCKING
 } cpg_dispatch_t;
 .ta
 .fi
@@ -72,19 +72,19 @@ typedef enum {
 .PP
 The dispatch values have the following meanings:
 .TP
-.B CPG_DISPATCH_ONE
+.B CS_DISPATCH_ONE
 Dispatch atleast one callback, blocking until the callback is dispatched.
 .TP
-.B CPG_DISPATCH_ALL
+.B CS_DISPATCH_ALL
 Dispatch all waiting callbacks without blocking to wait for any callbacks.
 .TP
-.B CPG_DISPATCH_BLOCKING
+.B CS_DISPATCH_BLOCKING
 Dispatch all callbacks, blocking indefinitely.  This is used in a threaded
 program where a thread is created, and then cpg_dispatch() is called immediately
 from the created thread to execute callbacks.
 
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_fd_get.3

@@ -51,7 +51,7 @@ argument may not be used directly with
 because it is not the file descriptor, but instead an internal identifier used
 by the CPG library.
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_finalize.3

@@ -47,7 +47,7 @@ No more callbacks will be dispatched from the
 .B cpg_dispatch function.
 .PP
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_initialize.3

@@ -150,7 +150,7 @@ CPG_REASON_PROCDOWN - the process left a group without calling cpg_leave()
 .IP
 .PP
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_join.3

@@ -87,7 +87,7 @@ struct cpg_name {
 .PP
 .PP
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, CPG_ERR_INVALID_PARAM if the
+This call returns the CS_OK value if successful, CS_ERR_INVALID_PARAM if the
 handle is already joined to a group.
 .PP
 .SH ERRORS

+ 1 - 1
man/cpg_leave.3

@@ -53,7 +53,7 @@ is used to specify the group to leave. It is currently ignored as only one group
 can be joined per handle. It is included here for to allow for future development.
 
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_mcast_joined.3

@@ -117,7 +117,7 @@ argument describes the number of entires in the
 argument.
 
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_model_initialize.3

@@ -206,7 +206,7 @@ is if of node of current Totem leader and seq is increasing number.
 
 .PP
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_zcb_alloc.3

@@ -60,7 +60,7 @@ The
 argument is set to the buffer address that is allocated by this operatoin.
 
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_zcb_free.3

@@ -52,7 +52,7 @@ The argument
 is the zero copy buffer to free.
 
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
man/cpg_zcb_mcast_joined.3

@@ -103,7 +103,7 @@ The
 argument describes the number of bytes to be transmitted in the zero copy buffer.
 
 .SH RETURN VALUE
-This call returns the CPG_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .SH ERRORS
 The errors are undocumented.

+ 1 - 1
test/cpgbench.c

@@ -150,7 +150,7 @@ static struct cpg_name group_name = {
 
 static void* dispatch_thread (void *arg)
 {
-	cpg_dispatch (handle, CPG_DISPATCH_BLOCKING);
+	cpg_dispatch (handle, CS_DISPATCH_BLOCKING);
 	return NULL;
 }