Changeset 7826
- Timestamp:
- 06/16/09 16:08:34 (4 years ago)
- Location:
- branches/as-branch/src
- Files:
-
- 4 modified
-
common/misc/state-machine-fns.c (modified) (2 diffs)
-
server/io.sm (modified) (5 diffs)
-
server/pipeline.sm (modified) (7 diffs)
-
server/pvfs2-server.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/as-branch/src/common/misc/state-machine-fns.c
r7822 r7826 309 309 while (smcb->current_state->flag == SM_JUMP) 310 310 { 311 gossip_debug(GOSSIP_STATE_MACHINE_DEBUG, "%s: SM_JUMP\n", __func__); 311 312 PINT_push_state(smcb, smcb->current_state); 312 313 smcb->current_state = … … 657 658 } 658 659 frame_entry = qlist_entry(prev, struct PINT_frame_s, link); 660 gossip_debug(GOSSIP_STATE_MACHINE_DEBUG, "returned frame=%p\n", 661 frame_entry->frame); /* sson */ 659 662 return frame_entry->frame; 660 663 } -
branches/as-branch/src/server/io.sm
r7823 r7826 55 55 success => pvfs2_pipeline_sm; 56 56 } 57 success => send_completion_ack; 57 success => cleanup_pipeline; 58 } 59 60 state cleanup_pipeline 61 { 62 run cleanup_pipeline_sm; 63 success => send_completion_ack; 58 64 default => release; 59 65 } … … 289 295 pipeline_op->u.pipeline.seg_handle = seg_handle; 290 296 pipeline_op->u.pipeline.id = id[i]; 291 pipeline_op->u.pipeline.parent = s_op;297 //pipeline_op->u.pipeline.parent = s_op; 292 298 pipeline_op->u.pipeline.hints = s_op->req->hints; 293 299 pipeline_op->u.pipeline.tag = s_op->tag; … … 358 364 } 359 365 360 /* 361 * Function: io_release() 362 * 363 * Params: server_op *b, 364 * job_status_s* js_p 365 * 366 * Pre: we are done with all steps necessary to service 367 * request 368 * 369 * Post: operation has been released from the scheduler 370 * 371 * Returns: int 372 * 373 * Synopsis: releases the operation from the scheduler 374 */ 375 static PINT_sm_action io_release( 376 struct PINT_smcb *smcb, job_status_s *js_p) 366 static PINT_sm_action cleanup_pipeline_sm(struct PINT_smcb *smcb, 367 job_status_s *js_p) 377 368 { 378 369 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 379 int ret = 0;380 job_id_t i;381 382 /*383 tell the scheduler that we are done with this operation (if it384 was scheduled in the first place)385 */386 ret = job_req_sched_release(387 s_op->scheduled_id, smcb, 0, js_p, &i, server_job_context);388 return ret;389 }390 391 /*392 * Function: io_cleanup()393 *394 * Params: server_op *b,395 * job_status_s* js_p396 *397 * Pre: all jobs done, simply need to clean up398 *399 * Post: everything is free400 *401 * Returns: int402 *403 * Synopsis: free up any buffers associated with the operation,404 * including any encoded or decoded protocol structures405 */406 static PINT_sm_action io_cleanup(407 struct PINT_smcb *smcb, job_status_s *js_p)408 {409 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);410 char status_string[64] = {0};411 370 int i; 412 371 struct PINT_server_op *pipeline_op; … … 414 373 int remaining; 415 374 PVFS_error tmp_err; 416 417 PVFS_strerror_r(s_op->resp.status, status_string, 64);418 PINT_ACCESS_DEBUG(s_op, GOSSIP_ACCESS_DEBUG, "finish (%s)\n", status_string);419 420 if (s_op->u.io.seg_handle) {421 gossip_debug(GOSSIP_IO_DEBUG, "%s: freeing seg_handle\n", __func__);422 PINT_segpool_destroy(s_op->u.io.seg_handle);423 }424 425 if(s_op->u.io.tmp_buffer)426 free(s_op->u.io.tmp_buffer); /* FIXME */427 375 428 376 for(i=0; i<s_op->u.io.parallel_sms; i++) … … 447 395 } 448 396 397 js_p->error_code = 0; 398 return SM_ACTION_COMPLETE; 399 } 400 401 402 /* 403 * Function: io_release() 404 * 405 * Params: server_op *b, 406 * job_status_s* js_p 407 * 408 * Pre: we are done with all steps necessary to service 409 * request 410 * 411 * Post: operation has been released from the scheduler 412 * 413 * Returns: int 414 * 415 * Synopsis: releases the operation from the scheduler 416 */ 417 static PINT_sm_action io_release( 418 struct PINT_smcb *smcb, job_status_s *js_p) 419 { 420 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 421 int ret = 0; 422 job_id_t i; 423 424 /* 425 tell the scheduler that we are done with this operation (if it 426 was scheduled in the first place) 427 */ 428 ret = job_req_sched_release( 429 s_op->scheduled_id, smcb, 0, js_p, &i, server_job_context); 430 return ret; 431 } 432 433 /* 434 * Function: io_cleanup() 435 * 436 * Params: server_op *b, 437 * job_status_s* js_p 438 * 439 * Pre: all jobs done, simply need to clean up 440 * 441 * Post: everything is free 442 * 443 * Returns: int 444 * 445 * Synopsis: free up any buffers associated with the operation, 446 * including any encoded or decoded protocol structures 447 */ 448 static PINT_sm_action io_cleanup( 449 struct PINT_smcb *smcb, job_status_s *js_p) 450 { 451 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 452 char status_string[64] = {0}; 453 454 PVFS_strerror_r(s_op->resp.status, status_string, 64); 455 PINT_ACCESS_DEBUG(s_op, GOSSIP_ACCESS_DEBUG, "finish (%s)\n", status_string); 456 457 if (s_op->u.io.seg_handle) { 458 gossip_debug(GOSSIP_IO_DEBUG, "%s: freeing seg_handle\n", __func__); 459 PINT_segpool_destroy(s_op->u.io.seg_handle); 460 } 461 #if 0 462 if(s_op->u.io.tmp_buffer) 463 free(s_op->u.io.tmp_buffer); /* FIXME */ 464 #endif 449 465 gen_mutex_destroy(&s_op->u.io.mutex); /* FIXME: */ 450 466 -
branches/as-branch/src/server/pipeline.sm
r7825 r7826 124 124 125 125 gossip_debug(GOSSIP_IO_DEBUG, "smcb->base_frame=%d, frame_count=%d\n", smcb->base_frame, smcb->frame_count); 126 gossip_debug(GOSSIP_IO_DEBUG, "smcb=%p, smcb->parent_smcb=%p\n", smcb, smcb->parent_smcb);127 126 s_op->u.pipeline.buffer_used = 0; 128 127 bytes = s_op->u.pipeline.buffer_size; … … 221 220 job_id_t tmp_id; 222 221 struct server_configuration_s *user_opts = get_server_config_struct(); 223 struct PINT_server_op *parent_s_op = s_op->u.pipeline.parent;222 struct PINT_server_op *parent_s_op = PINT_sm_frame(smcb->parent_smcb, 0); 224 223 225 224 if(s_op->u.pipeline.segs == 0) { … … 310 309 { 311 310 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 312 struct PINT_server_op *parent_s_op = s_op->u.pipeline.parent;311 struct PINT_server_op *parent_s_op = PINT_sm_frame(smcb->parent_smcb, 0); 313 312 js_p->error_code = 0; 314 313 PVFS_size file_req_offset = parent_s_op->u.io.file_req_offset; … … 366 365 { 367 366 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 368 struct PINT_server_op *parent_s_op = s_op->u.pipeline.parent;367 struct PINT_server_op *parent_s_op = PINT_sm_frame(smcb->parent_smcb, 0); 369 368 PINT_sm_msgpair_state *msg_p = NULL; 370 369 struct server_configuration_s *user_opts = get_server_config_struct(); … … 504 503 { 505 504 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 506 struct PINT_server_op *parent_s_op = s_op->u.pipeline.parent;505 struct PINT_server_op *parent_s_op = PINT_sm_frame(smcb->parent_smcb, 0); 507 506 js_p->error_code = 0; 508 507 … … 754 753 { 755 754 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 756 struct PINT_server_op *parent_s_op = s_op->u.pipeline.parent;755 struct PINT_server_op *parent_s_op = PINT_sm_frame(smcb->parent_smcb, 0); 757 756 int ret, tmp_id; 758 757 struct server_configuration_s *user_opts = get_server_config_struct(); … … 808 807 { 809 808 struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 810 struct PINT_server_op *parent_s_op = s_op->u.pipeline.parent;809 struct PINT_server_op *parent_s_op = PINT_sm_frame(smcb->parent_smcb, 0); 811 810 PINT_segpool_handle_t h = s_op->u.pipeline.seg_handle; 812 811 js_p->error_code = 0; -
branches/as-branch/src/server/pvfs2-server.h
r7821 r7826 380 380 enum PVFS_io_type io_type; 381 381 382 void *parent;383 382 char *buffer; 384 383 PVFS_size buffer_size;
