static void ssd_access_complete_element(ioreq_event *curr) { ssd_t *currdisk; int elem_num; ssd_element *elem; ioreq_event *x; currdisk = getssd (curr->devno); elem_num = currdisk->timing_t->choose_element(currdisk->timing_t, curr->blkno); ASSERT(elem_num == curr->ssd_elem_num); elem = &currdisk->elements[elem_num]; if ((x = ioqueue_physical_access_done(elem->queue,curr)) == NULL) { fprintf(stderr, "ssd_access_complete: ioreq_event not found by ioqueue_physical_access_done call\n"); exit(1); } // all the reqs are over if (ioqueue_get_reqoutstanding(elem->queue) == 0) { elem->media_busy = FALSE; } ssd_complete_parent(curr, currdisk); addtoextraq((event *) curr); ssd_activate_elem(currdisk, elem_num); }
static void ssd_access_complete_element(ioreq_event *curr) { ssd_t *currdisk; int elem_num; ssd_element *elem; ioreq_event *x; int lba; currdisk = getssd (curr->devno); elem_num = ssd_choose_element(currdisk->user_params, curr->blkno); ASSERT(elem_num == curr->ssd_elem_num); elem = &currdisk->elements[elem_num]; lba = ssd_logical_pageno(curr->blkno, currdisk); if(curr->flags & READ){ fprintf(outputfile5, "%10.6f %d %d %d\n", simtime, lba, elem_num, curr->blkno); } else { fprintf(outputfile4, "%10.6f %d %d %d\n", simtime, lba, elem_num, curr->blkno); } if ((x = ioqueue_physical_access_done(elem->queue,curr)) == NULL) { fprintf(stderr, "ssd_access_complete: ioreq_event not found by ioqueue_physical_access_done call\n"); exit(1); } ssd_dpower(currdisk, 0); // all the reqs are over if (ioqueue_get_reqoutstanding(elem->queue) == 0) { elem->media_busy = FALSE; } ssd_complete_parent(curr, currdisk); addtoextraq((event *) curr); // added by tiel // activate request create simtime, type, elem_num //{ // ioreq_event *temp = (ioreq_event *)getfromextraq(); // temp->type = SSD_ACTIVATE_ELEM; // temp->time = simtime + (2*currdisk->params.channel_switch_delay); // //temp->time = simtime; // temp->ssd_elem_num = elem_num; // addtointq ((event *)temp); //} //printf("time %f \n",simtime); ssd_activate_elem(currdisk, elem_num); }
static void ssd_access_complete_element(ioreq_event *curr) { ssd_t *currdisk; int elem_num; ssd_element *elem; ioreq_event *x; int lba; currdisk = getssd (curr->devno); elem_num = ssd_choose_element(currdisk->user_params, curr->blkno); ASSERT(elem_num == curr->ssd_elem_num); elem = &currdisk->elements[elem_num]; lba = ssd_logical_blockno(curr->blkno, currdisk); if(curr->flags & READ){ fprintf(outputfile5, "%10.6f %d %d %d\n", simtime, lba, elem_num, curr->blkno); } else { fprintf(outputfile4, "%10.6f %d %d %d\n", simtime, lba, elem_num, curr->blkno); } if ((x = ioqueue_physical_access_done(elem->queue,curr)) == NULL) { fprintf(stderr, "ssd_access_complete: ioreq_event not found by ioqueue_physical_access_done call\n"); exit(1); } ssd_dpower(currdisk, 0); // all the reqs are over if (ioqueue_get_reqoutstanding(elem->queue) == 0) { elem->media_busy = FALSE; } ssd_complete_parent(curr, currdisk); addtoextraq((event *) curr); ssd_activate_elem(currdisk, elem_num); }