Reviewed-by: Steven Dake <sdake@xxxxxxxxxx> On 02/08/2012 03:44 AM, Fabio M. Di Nitto wrote: > From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx> > > 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@xxxxxxxxxx> > --- > include/corosync/corotypes.h | 23 ----------------------- > lib/cfg.c | 2 +- > lib/cpg.c | 14 +++++++------- > lib/quorum.c | 2 +- > lib/votequorum.c | 2 +- > man/cpg_context_get.3 | 2 +- > man/cpg_context_set.3 | 2 +- > man/cpg_dispatch.3 | 14 +++++++------- > man/cpg_fd_get.3 | 2 +- > man/cpg_finalize.3 | 2 +- > man/cpg_initialize.3 | 2 +- > man/cpg_join.3 | 2 +- > man/cpg_leave.3 | 2 +- > man/cpg_mcast_joined.3 | 2 +- > man/cpg_model_initialize.3 | 2 +- > man/cpg_zcb_alloc.3 | 2 +- > man/cpg_zcb_free.3 | 2 +- > man/cpg_zcb_mcast_joined.3 | 2 +- > test/cpgbench.c | 2 +- > 19 files changed, 30 insertions(+), 53 deletions(-) > > diff --git a/include/corosync/corotypes.h b/include/corosync/corotypes.h > index 1cd31e8..98b54fb 100644 > --- a/include/corosync/corotypes.h > +++ b/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 > */ > diff --git a/lib/cfg.c b/lib/cfg.c > index 23d6768..2a12cf4 100644 > --- a/lib/cfg.c > +++ b/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 */ > diff --git a/lib/cpg.c b/lib/cpg.c > index e8d8614..171d6b4 100644 > --- a/lib/cpg.c > +++ b/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; > > diff --git a/lib/quorum.c b/lib/quorum.c > index 8feabe3..7e42fd0 100644 > --- a/lib/quorum.c > +++ b/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 */ > diff --git a/lib/votequorum.c b/lib/votequorum.c > index 2e810d8..159d697 100644 > --- a/lib/votequorum.c > +++ b/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 */ > diff --git a/man/cpg_context_get.3 b/man/cpg_context_get.3 > index 0cefec3..b9d5fde 100644 > --- a/man/cpg_context_get.3 > +++ b/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. > diff --git a/man/cpg_context_set.3 b/man/cpg_context_set.3 > index afdf6f5..87d18de 100644 > --- a/man/cpg_context_set.3 > +++ b/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. > diff --git a/man/cpg_dispatch.3 b/man/cpg_dispatch.3 > index 67197f1..bac516c 100644 > --- a/man/cpg_dispatch.3 > +++ b/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. > diff --git a/man/cpg_fd_get.3 b/man/cpg_fd_get.3 > index 8eab867..33d9af6 100644 > --- a/man/cpg_fd_get.3 > +++ b/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. > diff --git a/man/cpg_finalize.3 b/man/cpg_finalize.3 > index 08d6927..cc1382c 100644 > --- a/man/cpg_finalize.3 > +++ b/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. > diff --git a/man/cpg_initialize.3 b/man/cpg_initialize.3 > index 6d4bc51..5012986 100644 > --- a/man/cpg_initialize.3 > +++ b/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. > diff --git a/man/cpg_join.3 b/man/cpg_join.3 > index b85a2cf..f79b6f5 100644 > --- a/man/cpg_join.3 > +++ b/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 > diff --git a/man/cpg_leave.3 b/man/cpg_leave.3 > index fb79fd0..c1cdb81 100644 > --- a/man/cpg_leave.3 > +++ b/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. > diff --git a/man/cpg_mcast_joined.3 b/man/cpg_mcast_joined.3 > index 26ffea8..dc02350 100644 > --- a/man/cpg_mcast_joined.3 > +++ b/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. > diff --git a/man/cpg_model_initialize.3 b/man/cpg_model_initialize.3 > index f9e48ae..259f77d 100644 > --- a/man/cpg_model_initialize.3 > +++ b/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. > diff --git a/man/cpg_zcb_alloc.3 b/man/cpg_zcb_alloc.3 > index fd9bae8..607922b 100644 > --- a/man/cpg_zcb_alloc.3 > +++ b/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. > diff --git a/man/cpg_zcb_free.3 b/man/cpg_zcb_free.3 > index 8f6a40b..f26e2c0 100644 > --- a/man/cpg_zcb_free.3 > +++ b/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. > diff --git a/man/cpg_zcb_mcast_joined.3 b/man/cpg_zcb_mcast_joined.3 > index c5131c1..bebded2 100644 > --- a/man/cpg_zcb_mcast_joined.3 > +++ b/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. > diff --git a/test/cpgbench.c b/test/cpgbench.c > index 431006b..88a50a4 100644 > --- a/test/cpgbench.c > +++ b/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; > } > _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss