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
$(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
#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[])
{
#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
#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>
#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 */
#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
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 *
********************************/
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();