/*****************************\
* Check I/O type parameters *
- \*****************************/
+ \*****************************/
//We support 4 xseg operations: X_READ, X_WRITE, X_DELETE, X_INFO
//The I/O pattern of thesee operations can be either synchronous (sync) or
/**************************\
* Check timer parameters *
- \**************************/
+ \**************************/
//Most of the times, not all timers need to be used.
//We can choose which timers will be used by adjusting the "insanity"
/***************************\
* Check object parameters *
- \***************************/
+ \***************************/
if (!total_objects[0]) {
XSEGLOG2(&lc, E,
/*************************\
* Check size parameters *
- \*************************/
+ \*************************/
//Block size (bs): Defaults to 4K.
//It must be a number followed by one of these characters:
prefs->max_requests = prefs->ts / prefs->bs;
}
- /*************************
+ /*************************\
* Check port parameters *
- *************************/
+ \*************************/
if (dst_port < 0){
XSEGLOG2(&lc, E, "Destination port needs to be supplied\n");
prefs->src_port = peer->portno_start; //TODO: allow user to change this
prefs->dst_port = (xport) dst_port;
- /*********************************
+ /*********************************\
* Create timers for all metrics *
- *********************************/
+ \*********************************/
if (init_timer(&prefs->total_tm, TM_SANE))
goto tm_fail;
/********************************\
* Customize struct peerd/prefs *
- \********************************/
+ \********************************/
prefs->peer = peer;
//Create a target of this format: "bench-<obj_no>"
create_target(prefs, req, new);
- if(prefs->op == X_WRITE || prefs->op == X_READ) {
+ if (prefs->op == X_WRITE || prefs->op == X_READ) {
req->size = size;
//Calculate the chunk offset inside the object
req->offset = (new * prefs->bs) % prefs->os;
XSEGLOG2(&lc, D, "Offset of request %lu is %lu\n", new, req->offset);
- if(prefs->op == X_WRITE)
+ if (prefs->op == X_WRITE)
create_chunk(prefs, req, new);
}
pr->portno = srcport;
pr->req = req;
pr->priv = malloc(sizeof(struct timespec));
- if(!pr->priv) {
+ if (!pr->priv) {
perror("malloc");
goto put_peer_request;
}