static int posix_signal(struct xseg *xseg, uint32_t portno)
{
+ struct posix_signal_desc *psd;
struct pid *pid;
struct task_struct *task;
int ret = -ENOENT;
if (!port)
return -1;
- struct posix_signal_desc *psd = xseg_get_signal_desc(xseg, port);
+ psd = xseg_get_signal_desc(xseg, port);
if (!psd)
return -1;
{
//assert xsegments[portno] == NULL;
xsegments[portno] = xseg;
+ return 0;
}
static void segdev_local_signal_quit(struct xseg *xseg, xport portno)
static void *segdev_alloc_signal_desc(struct xseg *xseg, void *data)
{
+ struct segdev_signal_desc *ssd;
struct xobject_h *sd_h = (struct xobject_h *) data;
if (!sd_h)
return NULL;
- struct segdev_signal_desc *ssd = xobj_get_obj(sd_h, X_ALLOC);
+ ssd = xobj_get_obj(sd_h, X_ALLOC);
if (!ssd)
return NULL;
ssd->waitcue = 0;
};
int pthread_init_signal_desc(struct xseg *xseg, void *sd)
-{
+{
struct pthread_signal_desc *psd = (struct pthread_signal_desc *)sd;
- xpool_init(&psd->waiters, MAX_WAITERS, &psd->bufs);
+ xpool_init(&psd->waiters, MAX_WAITERS, psd->bufs);
xpool_clear(&psd->waiters, 1);
return 0;
-}
+}
void pthread_quit_signal_desc(struct xseg *xseg, void *sd)
-{
+{
struct pthread_signal_desc *psd = (struct pthread_signal_desc *)sd;
xpool_clear(&psd->waiters, 1);
return;
-}
+}
void * pthread_alloc_data(struct xseg *xseg)
{
struct xseg_request *xreq )
{
void *data;
+ struct xseg_reply_info *xreply;
if (!xreq) {
XSEGLOG("Invalid xreq");
return -EIO;
XSEGLOG("Invalid xsegbd_dev");
return -ENOENT;
}
- struct xseg_reply_info *xreply = (struct xseg_reply_info *)data;
+ xreply = (struct xseg_reply_info *)data;
xsegbd_dev->sectors = xreply->size / 512ULL;
return 0;
}
#include <xseg/protocol.h>
#include <pthread.h>
#include <openssl/sha.h>
+#include <ctype.h>
#ifndef SHA256_DIGEST_SIZE
#define SHA256_DIGEST_SIZE 32
for (i=0; i<SHA256_DIGEST_LENGTH; i++)
sprintf(hex+2*i, "%02x", data[i]);
}
-
+/*
static void unhexlify(char *hex, unsigned char *data)
{
int i;
data[i] |= c & 0x0F;
}
}
-
+*/
enum rados_state {
ACCEPTED = 0,
void get_submits_stats();
void get_responds_stats();
void usage();
-
+void print_req(struct xseg *xseg, struct xseg_request *req);
#ifdef MT
int thread_execute(struct peerd *peer, void (*func)(void *arg), void *arg);
#endif
struct xseg_request *submitted = NULL, *received;
long nr_submitted = 0, nr_received = 0, nr_failed = 0, nr_mismatch = 0, nr_flying = 0;
- int reported = 0, r;
+ int r;
uint64_t offset;
uint32_t targetlen = 10, chunksize = 4096;
struct timeval tv1, tv2;
//FIXME
++nr_flying;
nr_submitted += 1;
- reported = 0;
offset = 0;//pick(size);
submitted->offset = offset;
if (!strcmp(argv[i], "failreq") && (i + 1 < argc)) {
struct xseg_request *req;
- sscanf(argv[i+1], "%lx", &req);
+ sscanf(argv[i+1], "%lx", (unsigned long *)&req);
ret = cmd_request(req, FAIL);
i += 1;
continue;
#include <errno.h>
#include <sys/util.h>
#include <sys/time.h>
-
+#include <execinfo.h>
#include <sys/domain.h>
#include <xtypes/domain.h>
#include <xseg/domain.h>
{
struct xheap_header *h = __get_header(ptr);
struct xheap *heap = XPTR(&h->heap);
+ void *mem;
+ uint64_t size;
+ int r;
+ xptr *free_list;
if (h->magic != 0xdeadbeaf) {
XSEGLOG("for ptr: %lx, magic %lx != 0xdeadbeaf", ptr, h->magic);
}
- void *mem = XPTR(&heap->mem);
- uint64_t size = xheap_get_chunk_size(ptr);
- xptr *free_list = (xptr *) mem;
- int r = __get_index(heap, size);
+ mem = XPTR(&heap->mem);
+ size = xheap_get_chunk_size(ptr);
+ free_list = (xptr *) mem;
+ r = __get_index(heap, size);
//printf("size: %llu, r: %d\n", size, r);
__add_in_free_list(heap, &free_list[r], ptr);
// printf("freed %lx (size: %llu)\n", ptr, __get_header(ptr)->size);
//consistent wit obj_size
int __xobj_check(struct xobject_h *obj_h, void *ptr)
{
- void *container = XPTR(&obj_h->container);
xhash_iter_t it;
uint64_t i, nr_objs;
+ xhashidx key, val;
+ void *mem;
+ void *obj;
+ void *container = XPTR(&obj_h->container);
xhash_t *allocated = XPTR_TAKE(obj_h->allocated, container);
xhash_iter_init(allocated, &it);
- xhashidx key, val;
while (xhash_iterate(allocated, &it, &key, &val)){
- void *mem = XPTR_TAKE(key, container);
- void *obj;
+ mem = XPTR_TAKE(key, container);
nr_objs = xheap_get_chunk_size(mem)/obj_h->obj_size;
for (i = 0; i < nr_objs; i++) {
obj = (void *) ((unsigned long) mem +
int __xobj_isFree(struct xobject_h *obj_h, void *ptr)
{
- int r = 0;
void *container = XPTR(&obj_h->container);
xptr node;
struct xobject *obj;