complete merging speer - mpeer skeletons
authorGiannakos Filippos <philipgian@grnet.gr>
Fri, 2 Nov 2012 15:09:50 +0000 (17:09 +0200)
committerGiannakos Filippos <philipgian@grnet.gr>
Fri, 2 Nov 2012 15:09:50 +0000 (17:09 +0200)
xseg/peers/user/Makefile
xseg/peers/user/dummy.c
xseg/peers/user/monitor.c
xseg/peers/user/mt-mapperd.c
xseg/peers/user/mt-sosd.c
xseg/peers/user/peer.h

index eb41343..30ddd19 100644 (file)
@@ -36,6 +36,9 @@ monitor: monitor.c peer.c peer.h
 mt-vlmcd: mt-vlmcd.c peer.c peer.h $(BASE)/xseg/protocol.h 
        $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lpthread -DMT
 
+mt-pfiled: mt-pfiled.c peer.c peer.h $(BASE)/xseg/protocol.h 
+       $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lpthread -DMT
+
 st-vlmcd: mt-vlmcd.c peer.c peer.h $(BASE)/xseg/protocol.h 
        $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg 
 
@@ -49,4 +52,4 @@ vlmc-xseg: vlmc-tool.c $(BASE)/xseg/xseg.h
        $(CC) $(CFLAGS) -o $@ $< $(INC) -L$(LIB) -lxseg
 
 clean:
-       rm -f filed xseg sosd vlmcd mapperd mt-sosd dummy monitor mt-mapperd pfiled vlmc-xseg st-vlmcd mt-vlmcd
+       rm -f filed xseg sosd vlmcd mapperd mt-sosd dummy monitor mt-mapperd pfiled vlmc-xseg st-vlmcd mt-vlmcd mt-pfiled
index 0b78209..d96b603 100644 (file)
@@ -3,12 +3,10 @@
 #include <sys/types.h>
 #include <pthread.h>
 #include <xseg/xseg.h>
-#include <mpeer.h>
+#include <peer.h>
 #include <time.h>
 #include <sys/util.h>
 
-struct log_ctx lc;
-
 struct timespec delay = {0, 4000000};
 int custom_peer_init(struct peerd *peer, int argc, char *argv[])
 {
index 7f2e571..3959bb3 100644 (file)
@@ -3,7 +3,7 @@
 #include <sys/types.h>
 #include <pthread.h>
 #include <xseg/xseg.h>
-#include <mpeer.h>
+#include <peer.h>
 #include <sys/time.h>
 
 #define INPUT_BUF_SIZE 256
index ec8616b..502d709 100644 (file)
@@ -3,7 +3,7 @@
 #include <sys/types.h>
 #include <pthread.h>
 #include <xseg/xseg.h>
-#include <speer.h>
+#include <peer.h>
 #include <time.h>
 #include <xtypes/xlock.h>
 #include <xtypes/xhash.h>
@@ -36,8 +36,6 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #define MF_OBJECT_DESTROYED    (1 << 5)
 
 #define MF_OBJECT_NOT_READY    (MF_OBJECT_COPYING|MF_OBJECT_WRITING|MF_OBJECT_DELETING)
-extern struct log_ctx lc;
-extern uint32_t ta;
 
 char *magic_string = "This a magic string. Please hash me";
 unsigned char magic_sha256[SHA256_DIGEST_SIZE];        /* sha256 hash value of magic string */
index 881db94..8589068 100644 (file)
@@ -2,15 +2,13 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <xseg/xseg.h>
-#include <mpeer.h>
+#include <peer.h>
 #include <rados/librados.h>
 #include <xseg/protocol.h>
 
 #define MAX_POOL_NAME 64
 #define MAX_OBJ_NAME 256
 
-extern struct log_ctx lc;
-
 enum rados_state {
        ACCEPTED = 0,
        PENDING = 1
index 48b37ba..297e477 100644 (file)
@@ -61,6 +61,14 @@ static inline struct peerd * __get_peerd(void * custom_peerd)
        return (struct peerd *) ((unsigned long) custom_peerd  - offsetof(struct peerd, priv));
 }
 
+
+/* decration of "common" variables */
+extern struct log_ctx lc;
+#ifdef ST_THREADS
+extern uint32_t ta;
+#endif
+
+
 /********************************
  *   mandatory peer functions   *
  ********************************/
@@ -69,7 +77,7 @@ static inline struct peerd * __get_peerd(void * custom_peerd)
 int custom_peer_init(struct peerd *peer, int argc, char *argv[]);
 
 /* dispatch function */
-int dispatch(struct peerd *peer, struct peer_req *pr, struct xseg_request *xseg,
+int dispatch(struct peerd *peer, struct peer_req *pr, struct xseg_request *req,
                enum dispatch_reason reason);
 
 void usage();