  | 17 | 17 | | #include "pint-cached-config.h" |
| | 18 | 18 | | #include "PINT-reqproto-encode.h" |
| | 19 | 19 | | #include "pvfs2-internal.h" |
  | | 20 | + | #include "bmi.h" |
| 20 | 21 | | |
  | 21 | | - | |
| 22 | 22 | | extern job_context_id pint_client_sm_context; |
| | 23 | 23 | | |
| | 24 | 24 | | static int mgmt_migrate_comp_fn( |
| | 25 | 25 | | void *v_p, struct PVFS_server_resp *resp, int i); |
| | 26 | 26 | | |
| | 27 | 27 | | %% |
| | 28 | 28 | | |
  | 29 | | - | machine pvfs2_client_mgmt_migrate_sm{ |
| | | 29 | + | machine pvfs2_client_mgmt_migrate_sm |
| | | 30 | + | { |
| 30 | 31 | | |
  | 31 | | - | state init{ |
| | | 32 | + | state init |
| | | 33 | + | { |
| 32 | 34 | | run mgmt_migrate_init; |
| | 33 | 35 | | default => migrate_setup_msgpair; |
| | 34 | 36 | | } |
| | 35 | 37 | | |
  | 36 | | - | state migrate_setup_msgpair{ |
| | | 38 | + | state migrate_setup_msgpair |
| | | 39 | + | { |
| 37 | 40 | | run mgmt_migrate_setup_msgpair; |
| | 38 | 41 | | success => migrate_xfer_msgpair; |
| | 39 | 42 | | default => cleanup; |
| | 40 | 43 | | } |
| | 41 | 44 | | |
  | 42 | | - | state migrate_xfer_msgpair{ |
| | | 45 | + | state migrate_xfer_msgpair |
| | | 46 | + | { |
| 43 | 47 | | jump pvfs2_msgpairarray_sm; |
| | 44 | 48 | | default => cleanup; |
| | 45 | 49 | | } |
| | 46 | 50 | | |
  | 47 | | - | state cleanup{ |
| | | 51 | + | state cleanup |
| | | 52 | + | { |
| 48 | 53 | | run mgmt_migrate_cleanup; |
| | 49 | 54 | | default => terminate; |
| | 50 | 55 | | } |
| |
|
|
 |
… |
| 58 | 63 | | PVFS_object_ref ref, |
| | 59 | 64 | | const PVFS_credentials *credentials, |
| | 60 | 65 | | PVFS_sys_op_id *op_id, |
  | 61 | | - | char *dist_ser, |
| | | 66 | + | char *dest_ser, |
| 62 | 67 | | PVFS_hint hints, |
| | 63 | 68 | | void *user_ptr) |
| | 64 | 69 | | { |
| |
|
|
 |
… |
| 93 | 98 | | PINT_init_sysint_credentials(sm_p->cred_p, credentials); |
| | 94 | 99 | | |
| | 95 | 100 | | /* fill in stuff in the union */ |
  | 96 | | - | sm_p->u.migrate.dist_server = dist_ser; |
| | | 101 | + | sm_p->u.migrate.dest_server = dest_ser; |
| 97 | 102 | | sm_p->error_code = 0; |
| | 98 | 103 | | sm_p->object_ref = ref; |
| | 99 | 104 | | PVFS_hint_copy(hints, &sm_p->hints); |
| |
|
|
 |
… |
| 106 | 111 | | PVFS_error PVFS_mgmt_migrate( |
| | 107 | 112 | | PVFS_object_ref ref, |
| | 108 | 113 | | const PVFS_credentials *credentials, |
  | 109 | | - | char *dist_server, |
| | | 114 | + | char *dest_server, |
| 110 | 115 | | PVFS_hint hints) |
| | 111 | 116 | | { |
  | 112 | | - | PVFS_error ret = -PVFS_EINVAL, error = 0; |
| | | 117 | + | PVFS_error ret = -PVFS_EINVAL, error = 0; |
| 113 | 118 | | PVFS_sys_op_id op_id; |
| | 114 | 119 | | |
| | 115 | 120 | | gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_mgmt_migrate entered\n"); |
| | 116 | 121 | | |
  | 117 | | - | ret = PVFS_imgmt_migrate(ref, credentials, &op_id, dist_server, hints, NULL); |
| | | 122 | + | ret = PVFS_imgmt_migrate(ref, credentials, &op_id, dest_server, hints, NULL); |
| 118 | 123 | | if(ret) |
| | 119 | 124 | | { |
| | 120 | 125 | | PVFS_perror_gossip("PVFS_imgmt_migrate call", ret); |
  | 121 | | - | error = ret; |
| | | 126 | + | error = ret; |
| 122 | 127 | | } |
| | 123 | 128 | | else |
| | 124 | 129 | | { |
| |
|
|
 |
… |
| 163 | 168 | | struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); |
| | 164 | 169 | | int ret = -PVFS_EINVAL; |
| | 165 | 170 | | PINT_sm_msgpair_state *msg_p = NULL; |
  | | 171 | + | |
| | | 172 | + | |
| 166 | 173 | | |
| | 167 | 174 | | js_p->error_code = 0; |
| | 168 | 175 | | |
| | 169 | 176 | | PINT_msgpair_init(&sm_p->msgarray_op); |
| | 170 | 177 | | msg_p = &sm_p->msgarray_op.msgpair; |
| | 171 | 178 | | |
  | | 179 | + | |
| | | 180 | + | fprintf(stderr,"I made it here\n"); |
| | | 181 | + | |
| | | 182 | + | fprintf(stderr,"%s\n", sm_p->u.migrate.dest_server); |
| | | 183 | + | |
| | | 184 | + | |
| | | 185 | + | |
| 172 | 186 | | PINT_SERVREQ_MGMT_MIGRATE_FILL( |
| | 173 | 187 | | msg_p->req, |
| | 174 | 188 | | *sm_p->cred_p, |
| | 175 | 189 | | sm_p->object_ref.fs_id, |
| | 176 | 190 | | sm_p->object_ref.handle, |
  | 177 | | - | sm_p->u.migrate.dist_server, |
| | 178 | | - | sm_p->hints); |
| | | 191 | + | sm_p->u.migrate.dest_server, |
| | | 192 | + | sm_p->hints); |
| 179 | 193 | | |
| | 180 | 194 | | /*stuff here as well */ |
  | 181 | | - | msg_p->fs_id = sm_p->object_ref.fs_id; |
| | 182 | | - | msg_p->handle = sm_p->object_ref.handle; |
| | 183 | | - | msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; |
| | | 195 | + | msg_p->fs_id = sm_p->object_ref.fs_id; |
| | | 196 | + | msg_p->handle = sm_p->object_ref.handle; |
| | | 197 | + | msg_p->retry_flag = PVFS_MSGPAIR_RETRY; |
| 184 | 198 | | msg_p->comp_fn = mgmt_migrate_comp_fn; |
  | 185 | | - | |
| | | 199 | + | fprintf(stderr,"fs_id %d\n",msg_p->fs_id); |
| | | 200 | + | fprintf(stderr,"handle %llu\n",llu(msg_p->handle)); |
| | | 201 | + | |
| 186 | 202 | | ret = PINT_cached_config_map_to_server( |
| | 187 | 203 | | &msg_p->svr_addr, msg_p->handle, msg_p->fs_id); |
  | 188 | | - | |
| | | 204 | + | fprintf(stderr,"server = %lld\n", lld(msg_p->svr_addr)); |
| 189 | 205 | | if(ret) |
| | 190 | 206 | | { |
| | 191 | 207 | | gossip_err("Failed to map to server address\n"); |
| | 192 | 208 | | js_p->error_code = ret; |
| | 193 | 209 | | } |
  | 194 | | - | |
| | | 210 | + | |
| | | 211 | + | |
| 195 | 212 | | PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op); |
| | 196 | 213 | | |
| | 197 | 214 | | return SM_ACTION_COMPLETE; |
| |
|
|
 |
… |
| 207 | 224 | | "mgmt_migrate state: mgmt_migrate_cleanup\n"); |
| | 208 | 225 | | |
| | 209 | 226 | | sm_p->error_code = js_p->error_code; |
  | 210 | | - | |
| | | 227 | + | |
| | | 228 | + | fprintf(stderr,"I made it to client cleanup\n"); |
| | | 229 | + | |
| 211 | 230 | | /*do something involving cache or free allocated stuff*/ |
| | 212 | 231 | | |
| | 213 | 232 | | PINT_SET_OP_COMPLETE; |
| |
|
|
 |
… |
| 222 | 241 | | * End: |
| | 223 | 242 | | * |
| | 224 | 243 | | * vim: ft=c ts=8 sts=4 sw=4 expandtab |
  | 225 | | - | */ |
| | | 244 | + | */ |
| | | 245 | + | |