Changeset 8935

Show
Ignore:
Timestamp:
07/12/11 10:49:42 (23 months ago)
Author:
mtmoore
Message:

uuid converstation, PVFS_x_position changes, server/client side first pass done

Location:
branches/orange-next
Files:
59 modified

Legend:

Unmodified
Added
Removed
  • branches/orange-next/configure

    r8929 r8935  
    1149511495fi 
    1149611496 
     11497for ac_header 
     11498do : 
     11499  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     11500ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 
     11501if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 
     11502  cat >>confdefs.h <<_ACEOF 
     11503#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 
     11504_ACEOF 
     11505 
     11506fi 
     11507 
     11508done 
     11509 
     11510for ac_header in uuid/uuid.h 
     11511do : 
     11512  ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" 
     11513if test "x$ac_cv_header_uuid_uuid_h" = xyes; then : 
     11514  cat >>confdefs.h <<_ACEOF 
     11515#define HAVE_UUID_UUID_H 1 
     11516_ACEOF 
     11517 LDFLAGS="$LDFLAGS -luuid" 
     11518         SERVER_LDFLAGS="$LDFLAGS -luuid" 
     11519 
     11520fi 
     11521 
     11522done 
     11523 
     11524 
    1149711525{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU-style strerror_r" >&5 
    1149811526$as_echo_n "checking for GNU-style strerror_r... " >&6; } 
  • branches/orange-next/configure.in

    r8929 r8935  
    11041104   AC_MSG_RESULT(no) 
    11051105fi 
     1106 
     1107dnl check for uuid  
     1108AC_CHECK_HEADERS 
     1109AC_CHECK_HEADERS(uuid/uuid.h, 
     1110    LDFLAGS="$LDFLAGS -luuid" 
     1111                ) 
    11061112 
    11071113dnl Which form of strerror? 
  • branches/orange-next/include/pvfs2-mgmt.h

    r8891 r8935  
    274274    PVFS_handle **handle_matrix, 
    275275    int *handle_count_array, 
    276     PVFS_ds_position *position_array, 
     276    PVFS_ds_position *ds_position_array, 
     277    PVFS_kv_position *kv_position_array, 
     278    unsigned int *position_flag_array, 
    277279    PVFS_BMI_addr_t *addr_array, 
    278280    int server_count, 
     
    288290    PVFS_handle **handle_matrix, 
    289291    int *handle_count_array, 
    290     PVFS_ds_position *position_array, 
     292    PVFS_ds_position *ds_position_array, 
     293    PVFS_kv_position *kv_position_array, 
     294    unsigned int *position_flag_array, 
    291295    PVFS_BMI_addr_t *addr_array, 
    292296    int server_count, 
  • branches/orange-next/include/pvfs2-sysint.h

    r8933 r8935  
    213213struct PVFS_sysresp_listeattr_s 
    214214{ 
    215     PVFS_ds_position token; 
     215    PVFS_kv_position token; 
     216    uint32_t token_flag; 
    216217    int32_t         nkey; 
    217218    PVFS_ds_keyval *key_array; 
     
    333334    PVFS_object_ref ref, 
    334335    PVFS_kv_position token, 
    335     uint32_t token_flag, 
     336    uint32_t *token_flag_p, 
    336337    int32_t pvfs_dirent_incount, 
    337338    const PVFS_credentials *credentials, 
     
    343344PVFS_error PVFS_sys_readdir( 
    344345    PVFS_object_ref ref, 
    345     PVFS_ds_position token, 
     346    PVFS_kv_position token, 
     347    uint32_t *token_flag_p, 
    346348    int32_t pvfs_dirent_incount, 
    347349    const PVFS_credentials *credentials, 
     
    351353PVFS_error PVFS_isys_readdirplus( 
    352354    PVFS_object_ref ref, 
    353     PVFS_ds_position token, 
     355    PVFS_kv_position token, 
     356    uint32_t *token_flag_p, 
    354357    int32_t pvfs_dirent_incount, 
    355358    const PVFS_credentials *credentials, 
     
    363366    PVFS_object_ref ref, 
    364367    PVFS_kv_position token, 
     368    uint32_t *token_flag_p, 
    365369    int32_t pvfs_dirent_incount, 
    366370    const PVFS_credentials *credentials, 
     
    629633PVFS_error PVFS_isys_listeattr( 
    630634    PVFS_object_ref ref, 
    631     PVFS_ds_position token, 
     635    PVFS_kv_position token, 
     636    uint32_t token_flag, 
    632637    int32_t nkey, 
    633638    const PVFS_credentials *credentials, 
     
    639644PVFS_error PVFS_sys_listeattr( 
    640645    PVFS_object_ref ref, 
    641     PVFS_ds_position token, 
     646    PVFS_kv_position token, 
     647    uint32_t token_flag, 
    642648    int32_t nkey, 
    643649    const PVFS_credentials *credentials, 
  • branches/orange-next/pvfs2-config.h.in

    r8842 r8935  
    467467/* Define if file_operations struct has unlocked_ioctl member */ 
    468468#undef HAVE_UNLOCKED_IOCTL_HANDLER 
     469 
     470/* Define to 1 if you have the <uuid/uuid.h> header file. */ 
     471#undef HAVE_UUID_UUID_H 
    469472 
    470473/* Define if include file valgrind.h exists */ 
  • branches/orange-next/src/apps/admin/pvfs2-ls.c

    r8317 r8935  
    440440             * the old fashioned way 
    441441             */ 
    442             ref.handle = handle; 
     442            PVFS_handle_copy(ref.handle, handle); 
    443443            ref.fs_id = fs_id; 
    444444 
  • branches/orange-next/src/client/sysint/acache.c

    r8861 r8935  
    789789    PVFS_object_ref* real_key = (PVFS_object_ref*)key; 
    790790    int tmp_ret = 0; 
    791  
    792     tmp_ret = (real_key->handle)%table_size; 
     791    long unsigned int h_hash = 0; 
     792 
     793    PVFS_handle_to_hash(real_key->handle, &h_hash); 
     794 
     795    tmp_ret = h_hash % table_size; 
    793796    return(tmp_ret); 
    794797} 
  • branches/orange-next/src/client/sysint/client-state-machine.h

    r8933 r8935  
    394394    PVFS_handle **handle_matrix; 
    395395    int *handle_count_array; 
    396     PVFS_ds_position *position_array; 
     396    PVFS_ds_position *ds_position_array; 
     397    PVFS_kv_position *kv_position_array; 
     398    unsigned int *position_flag_array; 
    397399    PVFS_error_details *details; 
    398400    int flags; 
     
    466468} PINT_sm_getattr_state; 
    467469 
    468 #define PINT_SM_GETATTR_STATE_FILL(_state, _objref, _mask, _reftype, _flags) \ 
    469     do { \ 
    470         memset(&(_state), 0, sizeof(PINT_sm_getattr_state)); \ 
    471         (_state).object_ref.fs_id = (_objref).fs_id; \ 
    472         (_state).object_ref.handle = (_objref).handle; \ 
    473         (_state).req_attrmask = _mask; \ 
    474         (_state).ref_type = _reftype; \ 
    475         (_state).flags = _flags; \ 
     470#define PINT_SM_GETATTR_STATE_FILL(_state, _objref, _mask, _reftype, _flags)  \ 
     471    do {                                                                      \ 
     472        memset(&(_state), 0, sizeof(PINT_sm_getattr_state));                  \ 
     473        (_state).object_ref.fs_id = (_objref).fs_id;                          \ 
     474        PVFS_handle_copy((_state).object_ref.handle, (_objref).handle);      \ 
     475        (_state).req_attrmask = _mask;                                        \ 
     476        (_state).ref_type = _reftype;                                         \ 
     477        (_state).flags = _flags;                                              \ 
    476478    } while(0) 
    477479 
     
    518520struct PINT_client_listeattr_sm 
    519521{ 
    520     PVFS_ds_position pos_token;         /* input parameter */ 
     522    PVFS_kv_position pos_token;         /* input parameter */ 
     523    uint32_t pos_token_flag;            /* input parameter */ 
    521524    int32_t nkey;                       /* input parameter */ 
    522525    PVFS_size *size_array;              /* Input/Output */ 
     
    544547    PVFS_dirent **dirent_array; 
    545548    uint32_t      *dirent_outcount; 
    546     PVFS_ds_position *token; 
     549    PVFS_kv_position *token; 
     550    uint32_t         *token_flag;  /* out parameter */ 
    547551    uint64_t         *directory_version; 
    548     PVFS_ds_position pos_token;     /* input parameter */ 
     552    PVFS_kv_position pos_token;     /* input parameter */ 
     553    uint32_t        pos_token_flag; /* input paramter */ 
    549554    int32_t      dirent_limit;      /* input parameter */ 
    550555} PINT_sm_readdir_state; 
  • branches/orange-next/src/client/sysint/fs-add.sm

    r8317 r8935  
    634634 
    635635        msg_p->fs_id = PVFS_FS_ID_NULL; 
    636         msg_p->handle = PVFS_HANDLE_NULL; 
     636        PVFS_handle_clear(msg_p->handle); 
    637637        /* only try once to retrieve a config file from each server */ 
    638638        msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
  • branches/orange-next/src/client/sysint/mgmt-create-dirent.sm

    r7471 r8935  
    8080                 "PVFS_imgmt_create_dirent entered\n"); 
    8181 
    82     if ((parent_ref.handle == PVFS_HANDLE_NULL) || 
     82    if ((PVFS_handle_is_null(parent_ref.handle)) || 
    8383        (parent_ref.fs_id == PVFS_FS_ID_NULL) || 
    84         (entry_handle == PVFS_HANDLE_NULL) || !entry) 
     84        (PVFS_handle_is_null(entry_handle)) || !entry) 
    8585    { 
    8686        gossip_err("invalid (NULL) required argument\n"); 
     
    103103    sm_p->parent_ref = parent_ref; 
    104104    sm_p->u.mgmt_create_dirent.entry = entry; 
    105     sm_p->u.mgmt_create_dirent.entry_handle = entry_handle; 
     105    PVFS_handle_copy(sm_p->u.mgmt_create_dirent.entry_handle, entry_handle); 
    106106    PVFS_hint_copy(hints, &sm_p->hints); 
    107107 
     
    191191 
    192192    msg_p->fs_id = sm_p->parent_ref.fs_id; 
    193     msg_p->handle = sm_p->parent_ref.handle; 
     193    PVFS_handle_copy(msg_p->handle, sm_p->parent_ref.handle); 
    194194    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    195195    msg_p->comp_fn = mgmt_create_dirent_comp_fn; 
  • branches/orange-next/src/client/sysint/mgmt-event-mon-list.sm

    r7471 r8935  
    175175 
    176176        msg_p->fs_id = sm_p->u.event_mon_list.fs_id; 
    177         msg_p->handle = PVFS_HANDLE_NULL; 
     177        PVFS_handle_clear(msg_p->handle); 
    178178        msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    179179        msg_p->comp_fn = event_mon_list_comp_fn; 
  • branches/orange-next/src/client/sysint/mgmt-get-dirdata-handle.sm

    r7471 r8935  
    8282                 "PVFS_imgmt_get_dirdata_handle entered\n"); 
    8383 
    84     if ((parent_ref.handle == PVFS_HANDLE_NULL) || 
     84    if ((PVFS_handle_is_null(parent_ref.handle)) || 
    8585        (parent_ref.fs_id == PVFS_FS_ID_NULL) || !out_dirdata_handle) 
    8686    { 
     
    180180 
    181181    msg_p->fs_id = sm_p->parent_ref.fs_id; 
    182     msg_p->handle = sm_p->parent_ref.handle; 
     182    PVFS_handle_copy(msg_p->handle, sm_p->parent_ref.handle); 
    183183    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    184184    msg_p->comp_fn = mgmt_get_dirdata_handle_comp_fn; 
     
    209209        assert(sm_p->u.mgmt_get_dirdata_handle.dirdata_handle); 
    210210 
    211         *sm_p->u.mgmt_get_dirdata_handle.dirdata_handle = 
    212             resp_p->u.mgmt_get_dirdata_handle.handle; 
     211        PVFS_handle_copy(*sm_p->u.mgmt_get_dirdata_handle.dirdata_handle, 
     212            resp_p->u.mgmt_get_dirdata_handle.handle); 
    213213 
    214214        gossip_debug( 
  • branches/orange-next/src/client/sysint/mgmt-iterate-handles-list.sm

    r8932 r8935  
    6262    PVFS_handle **handle_matrix, 
    6363    int *handle_count_array, 
    64     PVFS_ds_position *position_array, 
     64    PVFS_ds_position *ds_position_array, 
     65    PVFS_kv_position *kv_position_array, 
     66    unsigned int *position_flag_array, 
    6567    PVFS_BMI_addr_t *addr_array, 
    6668    int server_count, 
     
    7880                 "PVFS_imgmt_iterate_handles_list() entered.\n"); 
    7981 
    80     if (server_count < 1 || !handle_matrix || !position_array  
     82    if (server_count < 1 || !handle_matrix ||  
     83        !( ds_position_array || kv_position_array) 
    8184        || !handle_count_array || !addr_array) 
    8285    { 
     
    102105    sm_p->u.iterate_handles_list.handle_matrix = handle_matrix; 
    103106    sm_p->u.iterate_handles_list.handle_count_array = handle_count_array; 
    104     sm_p->u.iterate_handles_list.position_array = position_array; 
     107    sm_p->u.iterate_handles_list.ds_position_array = ds_position_array; 
     108    sm_p->u.iterate_handles_list.kv_position_array = kv_position_array; 
     109    sm_p->u.iterate_handles_list.position_flag_array = position_flag_array; 
    105110    sm_p->u.iterate_handles_list.details = details; 
    106111    PVFS_hint_copy(hints, &sm_p->hints); 
     
    125130    PVFS_handle **handle_matrix, 
    126131    int *handle_count_array, 
    127     PVFS_ds_position *position_array, 
     132    PVFS_ds_position *ds_position_array, 
     133    PVFS_kv_position *kv_position_array, 
     134    unsigned int *position_flag_array, 
    128135    PVFS_BMI_addr_t *addr_array, 
    129136    int server_count, 
     
    140147    ret = PVFS_imgmt_iterate_handles_list( 
    141148        fs_id, credentials, handle_matrix, handle_count_array, 
    142         position_array, addr_array, server_count, flags, details, hints, &op_id, NULL); 
     149        ds_position_array, kv_position_array, position_flag_array, 
     150        addr_array, server_count, flags, details, hints, &op_id, NULL); 
    143151 
    144152    if (ret) 
     
    182190        /* TODO: use a better #define or something for ITERATE_END */ 
    183191        /* FIX: position stuff changed to use small int and flag */ 
    184         if(sm_p->u.iterate_handles_list.position_array[j] 
     192        if(sm_p->u.iterate_handles_list.position_flag_array[j] 
    185193            == PVFS_ITERATE_END) 
    186194        { 
     
    192200        else 
    193201        { 
     202            /* FIX: need to handle is ds or kv_position_array is null */ 
    194203            PINT_SERVREQ_MGMT_ITERATE_HANDLES_FILL( 
    195204                msg_p->req, 
     
    197206                sm_p->u.iterate_handles_list.fs_id, 
    198207                sm_p->u.iterate_handles_list.handle_count_array[j], 
    199                 sm_p->u.iterate_handles_list.position_array[j], 
     208                sm_p->u.iterate_handles_list.ds_position_array[j], 
     209                sm_p->u.iterate_handles_list.kv_position_array[j], 
     210                sm_p->u.iterate_handles_list.position_flag_array[j], 
    200211                sm_p->u.iterate_handles_list.flags, 
    201212                sm_p->hints); 
    202213            msg_p->fs_id = sm_p->u.iterate_handles_list.fs_id; 
    203             msg_p->handle = PVFS_HANDLE_NULL; 
     214            PVFS_handle_clear(msg_p->handle); 
    204215            msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    205216            msg_p->comp_fn = iterate_handles_list_comp_fn; 
     
    287298        sm_p->u.iterate_handles_list.handle_count_array[j] = 
    288299            resp_p->u.mgmt_iterate_handles.handle_count; 
    289         sm_p->u.iterate_handles_list.position_array[j] = 
    290             resp_p->u.mgmt_iterate_handles.position; 
     300        memcpy(&(sm_p->u.iterate_handles_list.kv_position_array[j]), 
     301            &(resp_p->u.mgmt_iterate_handles.kv_position),  
     302            sizeof(PVFS_kv_position)); 
     303        PVFS_handle_copy(sm_p->u.iterate_handles_list.ds_position_array[j], 
     304            resp_p->u.mgmt_iterate_handles.ds_position); 
     305        sm_p->u.iterate_handles_list.position_flag_array[j] = 
     306            resp_p->u.mgmt_iterate_handles.position_flag; 
    291307        memcpy(sm_p->u.iterate_handles_list.handle_matrix[j], 
    292308               resp_p->u.mgmt_iterate_handles.handle_array, 
  • branches/orange-next/src/client/sysint/mgmt-perf-mon-list.sm

    r8891 r8935  
    192192 
    193193        msg_p->fs_id = sm_p->u.perf_mon_list.fs_id; 
    194         msg_p->handle = PVFS_HANDLE_NULL; 
     194        PVFS_handle_clear(msg_p->handle); 
    195195        msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    196196        msg_p->comp_fn = perf_mon_list_comp_fn; 
  • branches/orange-next/src/client/sysint/mgmt-remove-dirent.sm

    r7471 r8935  
    8080                 "PVFS_imgmt_remove_dirent entered\n"); 
    8181 
    82     if ((parent_ref.handle == PVFS_HANDLE_NULL) || 
     82    if ((PVFS_handle_is_null(parent_ref.handle)) || 
    8383        (parent_ref.fs_id == PVFS_FS_ID_NULL)) 
    8484    { 
     
    184184 
    185185    msg_p->fs_id = sm_p->parent_ref.fs_id; 
    186     msg_p->handle = sm_p->parent_ref.handle; 
     186    PVFS_handle_copy(msg_p->handle, sm_p->parent_ref.handle); 
    187187    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    188188    msg_p->comp_fn = mgmt_remove_dirent_comp_fn; 
  • branches/orange-next/src/client/sysint/mgmt-remove-object.sm

    r7471 r8935  
    7979                 "PVFS_imgmt_remove_object entered\n"); 
    8080 
    81     if ((object_ref.handle == PVFS_HANDLE_NULL) || 
     81    if ((PVFS_handle_is_null(object_ref.handle)) || 
    8282        (object_ref.fs_id == PVFS_FS_ID_NULL)) 
    8383    { 
     
    180180 
    181181    msg_p->fs_id = sm_p->object_ref.fs_id; 
    182     msg_p->handle = sm_p->object_ref.handle; 
     182    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    183183    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    184184    msg_p->comp_fn = mgmt_remove_object_comp_fn; 
  • branches/orange-next/src/client/sysint/mgmt-statfs-list.sm

    r7471 r8935  
    195195 
    196196        msg_p->fs_id = sm_p->u.statfs_list.fs_id; 
    197         msg_p->handle = PVFS_HANDLE_NULL; 
     197        PVFS_handle_clear(msg_p->handle); 
    198198        msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    199199        msg_p->comp_fn = statfs_list_comp_fn; 
  • branches/orange-next/src/client/sysint/ncache.c

    r5687 r8935  
    240240   
    241241    entry_key.entry_name = entry; 
    242     entry_key.parent_ref.handle = parent_ref->handle; 
     242    PVFS_handle_copy(entry_key.parent_ref.handle, parent_ref->handle); 
    243243    entry_key.parent_ref.fs_id = parent_ref->fs_id; 
    244244 
     
    305305   
    306306    entry_key.entry_name = entry; 
    307     entry_key.parent_ref.handle = parent_ref->handle; 
     307    PVFS_handle_copy(entry_key.parent_ref.handle, parent_ref->handle); 
    308308    entry_key.parent_ref.fs_id = parent_ref->fs_id; 
    309309 
     
    371371    } 
    372372 
    373     tmp_payload->parent_ref.handle = parent_ref->handle; 
     373    PVFS_handle_copy(tmp_payload->parent_ref.handle, parent_ref->handle); 
    374374    tmp_payload->parent_ref.fs_id = parent_ref->fs_id; 
    375     tmp_payload->entry_ref.handle = entry_ref->handle; 
     375    PVFS_handle_copy(tmp_payload->entry_ref.handle, entry_ref->handle); 
    376376    tmp_payload->entry_ref.fs_id = entry_ref->fs_id; 
    377377 
     
    388388 
    389389    entry_key.entry_name = entry; 
    390     entry_key.parent_ref.handle = parent_ref->handle; 
     390    PVFS_handle_copy(entry_key.parent_ref.handle, parent_ref->handle); 
    391391    entry_key.parent_ref.fs_id = parent_ref->fs_id; 
    392392 
     
    500500    struct ncache_key* real_key = (struct ncache_key*) key; 
    501501    int tmp_ret = 0; 
    502     unsigned int sum = 0, i = 0; 
     502    unsigned int sum = 0, i = 0, h_hash = 0; 
    503503 
    504504    while(real_key->entry_name[i] != '\0') 
     
    507507        i++; 
    508508    } 
    509     sum += real_key->parent_ref.handle + real_key->parent_ref.fs_id; 
     509 
     510    PVFS_handle_to_hash(real_key->parent_ref.handle, &h_hash); 
     511    sum += h_hash + real_key->parent_ref.fs_id; 
    510512    tmp_ret =  sum % table_size; 
    511513    return(tmp_ret); 
  • branches/orange-next/src/client/sysint/pint-sysint-utils.c

    r7471 r8935  
    6262        } 
    6363        gossip_err("cannot get parent directory of %s\n", filename); 
    64         *handle = PVFS_HANDLE_NULL; 
     64        PVFS_handle_clear(*handle); 
    6565        return ret; 
    6666    } 
     
    7171    { 
    7272        gossip_err("Lookup failed on %s\n", buf); 
    73         *handle = PVFS_HANDLE_NULL; 
     73        PVFS_handle_clear(*handle); 
    7474        return ret; 
    7575    } 
    7676 
    77     *handle = resp_look.ref.handle; 
     77    PVFS_handle_copy(*handle, resp_look.ref.handle); 
    7878    return 0; 
    7979} 
  • branches/orange-next/src/client/sysint/remove.sm

    r8098 r8935  
    201201     
    202202    msg_p->fs_id = sm_p->object_ref.fs_id; 
    203     msg_p->handle = attr->u.meta.dfile_array[0]; 
     203    PVFS_handle_copy(msg_p->handle, attr->u.meta.dfile_array[0]); 
    204204    msg_p->retry_flag = PVFS_MSGPAIR_RETRY;     /* TODO: Do we want retry? */ 
    205205    msg_p->comp_fn = NULL; 
     
    241241 
    242242    msg_p->fs_id = sm_p->object_ref.fs_id; 
    243     msg_p->handle = sm_p->object_ref.handle; 
     243    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    244244    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    245245    msg_p->comp_fn = NULL; 
  • branches/orange-next/src/client/sysint/server-get-config.sm

    r8317 r8935  
    243243 
    244244    msg_p->fs_id = PVFS_FS_ID_NULL; 
    245     msg_p->handle = PVFS_HANDLE_NULL; 
     245    PVFS_handle_clear(msg_p->handle); 
    246246    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    247247    msg_p->comp_fn = server_get_config_comp_fn; 
  • branches/orange-next/src/client/sysint/sys-create.sm

    r8891 r8935  
    148148    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_isys_create entered\n"); 
    149149 
    150     if ((parent_ref.handle == PVFS_HANDLE_NULL) || 
     150    if ((PVFS_handle_is_null(parent_ref.handle)) || 
    151151        (parent_ref.fs_id == PVFS_FS_ID_NULL) || 
    152152        (object_name == NULL) || (resp == NULL)) 
     
    362362    PINT_smcb *smcb = v_p; 
    363363    PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_MSGPAIR_PARENT_SM); 
     364    int i = 0; 
    364365 
    365366    gossip_debug(GOSSIP_CLIENT_DEBUG, "create_create_comp_fn\n"); 
     
    373374 
    374375    /* otherwise, just stash the newly created meta handle */ 
    375     sm_p->u.create.metafile_handle = 
    376         resp_p->u.create.metafile_handle; 
     376    PVFS_handle_copy(sm_p->u.create.metafile_handle, 
     377        resp_p->u.create.metafile_handle); 
    377378    sm_p->u.create.datafile_count = resp_p->u.create.datafile_count; 
    378379    sm_p->u.create.datafile_handles = malloc( 
     
    383384        return -PVFS_ENOMEM; 
    384385    } 
    385     memcpy(sm_p->u.create.datafile_handles, 
    386            resp_p->u.create.datafile_handles, 
    387            (sizeof(*sm_p->u.create.datafile_handles) * 
    388            resp_p->u.create.datafile_count)); 
     386 
     387    for( i=0; i < resp_p->u.create.datafile_count; i++ ) 
     388    { 
     389        PVFS_handle_copy(sm_p->u.create.datafile_handles[i], 
     390                         resp_p->u.create.datafile_handles[i]); 
     391    } 
    389392    sm_p->u.create.stuffed = resp_p->u.create.stuffed; 
    390393 
     
    464467 
    465468    msg_p->fs_id = sm_p->object_ref.fs_id; 
    466     msg_p->handle = meta_handle_extent_array.extent_array[0].first; 
     469    PVFS_handle_copy(msg_p->handle,  
     470        meta_handle_extent_array.extent_array[0].first); 
    467471    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    468472    msg_p->comp_fn = create_comp_fn; 
     
    509513 
    510514    msg_p->fs_id = sm_p->object_ref.fs_id; 
    511     msg_p->handle = sm_p->object_ref.handle; 
     515    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    512516    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    513517    msg_p->comp_fn = create_crdirent_comp_fn; 
     
    565569    if (sm_p->error_code == 0) 
    566570    { 
    567         metafile_ref.handle = sm_p->u.create.metafile_handle; 
     571        PVFS_handle_copy(metafile_ref.handle, sm_p->u.create.metafile_handle); 
    568572        metafile_ref.fs_id = sm_p->object_ref.fs_id; 
    569573 
     
    596600        { 
    597601            sm_p->u.create.attr.u.meta.dist = sm_p->u.create.dist; 
    598             sm_p->u.create.attr.u.meta.dist_size = PINT_DIST_PACK_SIZE(sm_p->u.create.dist); 
     602            sm_p->u.create.attr.u.meta.dist_size =  
     603                PINT_DIST_PACK_SIZE(sm_p->u.create.dist); 
    599604            sm_p->u.create.attr.mask |= PVFS_ATTR_META_DIST; 
    600605        } 
     
    994999 
    9951000            msg_p->fs_id = sm_p->object_ref.fs_id; 
    996             msg_p->handle = sm_p->u.create.metafile_handle; 
     1001            PVFS_handle_copy(msg_p->handle, sm_p->u.create.metafile_handle); 
    9971002            msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    9981003            msg_p->comp_fn = create_delete_handles_comp_fn; 
     
    10111016 
    10121017            msg_p->fs_id = sm_p->object_ref.fs_id; 
    1013             msg_p->handle = sm_p->u.create.datafile_handles[i]; 
     1018            PVFS_handle_copy(msg_p->handle, sm_p->u.create.datafile_handles[i]); 
    10141019            msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    10151020            msg_p->comp_fn = create_delete_handles_comp_fn; 
  • branches/orange-next/src/client/sysint/sys-del-eattr.sm

    r7471 r8935  
    6565    gossip_debug(GOSSIP_CLIENT_DEBUG, "PINT_isys_del_eattr entered\n"); 
    6666 
    67     if ((ref.handle == PVFS_HANDLE_NULL) || 
     67    if ((PVFS_handle_is_null(ref.handle)) || 
    6868       (ref.fs_id == PVFS_FS_ID_NULL)) 
    6969    { 
     
    150150 
    151151    msg_p->fs_id = sm_p->object_ref.fs_id; 
    152     msg_p->handle = sm_p->object_ref.handle; 
     152    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    153153    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    154154    msg_p->comp_fn = del_eattr_comp_fn; 
  • branches/orange-next/src/client/sysint/sys-flush.sm

    r7471 r8935  
    8282 
    8383    if ((ref.fs_id == PVFS_FS_ID_NULL) || 
    84         (ref.handle == PVFS_HANDLE_NULL)) 
     84        (PVFS_handle_is_null(ref.handle))) 
    8585    { 
    8686        gossip_err("Invalid handle/fs_id specified\n"); 
     
    197197 
    198198            msg_p->fs_id = sm_p->object_ref.fs_id; 
    199             msg_p->handle = attr->u.meta.dfile_array[i]; 
     199            PVFS_handle_copy(msg_p->handle, attr->u.meta.dfile_array[i]); 
    200200            msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    201201            msg_p->comp_fn = NULL; 
     
    216216 
    217217            msg_p->fs_id = sm_p->object_ref.fs_id; 
    218             msg_p->handle = sm_p->object_ref.handle; 
     218            PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    219219            msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    220220            msg_p->comp_fn = NULL; 
  • branches/orange-next/src/client/sysint/sys-get-eattr.sm

    r8891 r8935  
    7373                 "PINT_isys_geteattr entered\n"); 
    7474 
    75     if ((ref.handle == PVFS_HANDLE_NULL) || 
     75    if ((PVFS_handle_is_null(ref.handle)) || 
    7676       (ref.fs_id == PVFS_FS_ID_NULL) || (resp_p == NULL)) 
    7777    { 
     
    189189 
    190190    msg_p->fs_id = sm_p->object_ref.fs_id; 
    191     msg_p->handle = sm_p->object_ref.handle; 
     191    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    192192    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    193193    msg_p->comp_fn = get_eattr_comp_fn; 
  • branches/orange-next/src/client/sysint/sys-getattr.sm

    r8451 r8935  
    176176    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_isys_getattr entered\n"); 
    177177 
    178     if ((ref.handle == PVFS_HANDLE_NULL) || 
     178    if (PVFS_handle_is_null(ref.handle) || 
    179179        (ref.fs_id == PVFS_FS_ID_NULL) || (resp_p == NULL)) 
    180180    { 
     
    312312    object_ref = sm_p->getattr.object_ref; 
    313313 
    314     assert(object_ref.handle != PVFS_HANDLE_NULL); 
     314    assert(!PVFS_handle_is_null(object_ref.handle)); 
    315315    assert(object_ref.fs_id != PVFS_FS_ID_NULL); 
    316316 
     
    491491 
    492492    assert(object_ref.fs_id != PVFS_FS_ID_NULL); 
    493     assert(object_ref.handle != PVFS_HANDLE_NULL); 
     493    assert(!PVFS_handle_is_null(object_ref.handle)); 
    494494 
    495495    /* setup the msgpair to do a getattr operation */ 
     
    503503     
    504504    msg_p->fs_id = object_ref.fs_id; 
    505     msg_p->handle = object_ref.handle; 
     505    PVFS_handle_copy(msg_p->handle, object_ref.handle); 
    506506    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    507507    msg_p->comp_fn = getattr_object_getattr_comp_fn; 
     
    753753    for (i=0; i<getattr->mir_ctx_count; i++) 
    754754    { 
    755        getattr->mir_ctx_array[i].original_datahandle = attr->u.meta.dfile_array[i]; 
     755       PVFS_handle_copy(getattr->mir_ctx_array[i].original_datahandle, 
     756                        attr->u.meta.dfile_array[i]); 
    756757       getattr->mir_ctx_array[i].original_server_nr = i; 
    757758    } 
     
    795796 
    796797    msg_p->fs_id = sm_p->getattr.object_ref.fs_id; 
    797     msg_p->handle = handles[0]; 
     798    PVFS_handle_copy(msg_p->handle, handles[0]); 
    798799    msg_p->comp_fn = getattr_datafile_getattr_comp_fn; 
    799800 
     
    10291030        { 
    10301031            ctx->retry_original = 0; 
    1031             tmp_handles[j]   = ctx->original_datahandle; 
     1032            PVFS_handle_copy(tmp_handles[j], ctx->original_datahandle); 
    10321033            tmp_server_nr[j] = ctx->original_server_nr; 
    10331034            j++; 
     
    10461047            if (meta->mirror_dfile_array[index] != 0) 
    10471048            {  /* we have found a valid mirrored handle */ 
    1048                tmp_handles[j]   = meta->mirror_dfile_array[index]; 
     1049               PVFS_handle_copy(tmp_handles[j],  
     1050                                meta->mirror_dfile_array[index]); 
    10491051               tmp_server_nr[j] = server_nr; 
    10501052               j++; 
     
    10581060        if ( copies == meta->mirror_copies_count ) 
    10591061        { 
    1060            tmp_handles[j]   = ctx->original_datahandle; 
     1062           PVFS_handle_copy(tmp_handles[j], ctx->original_datahandle); 
    10611063           tmp_server_nr[j] = ctx->original_server_nr; 
    10621064           j++; 
     
    10831085     
    10841086    /*replace values in old message request*/ 
    1085     msg->handle = tmp_handles[0]; 
     1087    PVFS_handle_copy(msg->handle, tmp_handles[0]); 
    10861088    msg->svr_addr=0; 
    10871089    ret = PINT_cached_config_map_to_server(&msg->svr_addr 
  • branches/orange-next/src/client/sysint/sys-io.sm

    r8416 r8935  
    302302                 llu(ref.handle)); 
    303303 
    304     if ((ref.handle == PVFS_HANDLE_NULL) || 
     304    if ((PVFS_handle_is_null(ref.handle)) || 
    305305        (ref.fs_id == PVFS_FS_ID_NULL) || (resp_p == NULL)) 
    306306    { 
     
    524524 
    525525    msg_p->fs_id = sm_p->object_ref.fs_id; 
    526     msg_p->handle = sm_p->object_ref.handle; 
     526    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    527527    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    528528    msg_p->comp_fn = unstuff_comp_fn; 
     
    10661066        { 
    10671067            /* setup context to retry the original */ 
    1068            ctx->data_handle     = meta->dfile_array[ctx->server_nr]; 
     1068           PVFS_handle_copy(ctx->data_handle,  
     1069                            meta->dfile_array[ctx->server_nr]); 
    10691070           ctx->retry_original  =  0; 
    1070            msg->handle          = ctx->data_handle; 
    1071            msg->req.u.io.handle = ctx->data_handle; 
     1071           PVFS_handle_copy(msg->handle, ctx->data_handle); 
     1072           PVFS_handle_copy(msg->req.u.io.handle, ctx->data_handle); 
     1073           ret = PINT_cached_config_map_to_server(&(msg->svr_addr), 
     1074                                                   msg->handle, msg->fs_id); 
     1075           if (ret) 
     1076           { 
     1077              gossip_lerr("Unable to determine the server address " 
     1078                          "for this handle (%llu)", 
     1079                           llu(msg->handle)); 
     1080              js_p->error_code = ret; 
     1081              return SM_ACTION_COMPLETE; 
     1082           } 
     1083           PINT_flow_reset(&(ctx->flow_desc)); 
     1084           continue; 
     1085        } 
     1086 
     1087        /* get next mirrored handle.  note:  if a mirrored handle is zero, then 
     1088         * this means that the creation of this mirrored object failed for its 
     1089         * particular server.  if so, then get the next valid handle.  as a  
     1090         * last resort, retry the original handle. 
     1091        */ 
     1092        copies = ctx->current_copies_count; 
     1093        for (;copies < meta->mirror_copies_count; copies++) 
     1094        { 
     1095            index = (copies*meta->dfile_count) + ctx->server_nr; 
     1096            if (meta->mirror_dfile_array[index] != 0) 
     1097            {  /* we have found a valid mirrored handle */ 
     1098               PVFS_handle_copy(ctx->data_handle,  
     1099                                meta->mirror_dfile_array[index]); 
     1100               break; 
     1101            } 
     1102        } 
     1103 
     1104        /* we have NOT found a valid mirrored handle, so retry the primary */ 
     1105        if ( copies == meta->mirror_copies_count ) 
     1106        { 
     1107           PVFS_handle_copy(ctx->data_handle,  
     1108                            meta->dfile_array[ctx->server_nr]); 
     1109           ctx->retry_original = 0; 
     1110           ctx->current_copies_count = 0; 
     1111           io->retry_count++; 
     1112           /* setup context to retry original */ 
     1113           PVFS_handle_copy(msg->handle, ctx->data_handle); 
     1114           PVFS_handle_copy(msg->req.u.io.handle, ctx->data_handle); 
    10721115           ret=PINT_cached_config_map_to_server(&(msg->svr_addr) 
    10731116                                               ,msg->handle 
     
    10851128        } 
    10861129 
    1087         /* get next mirrored handle.  note:  if a mirrored handle is zero, then 
    1088          * this means that the creation of this mirrored object failed for its 
    1089          * particular server.  if so, then get the next valid handle.  as a  
    1090          * last resort, retry the original handle. 
    1091         */ 
    1092         copies = ctx->current_copies_count; 
    1093         for (;copies < meta->mirror_copies_count; copies++) 
    1094         { 
    1095             index = (copies*meta->dfile_count) + ctx->server_nr; 
    1096             if (meta->mirror_dfile_array[index] != 0) 
    1097             {  /* we have found a valid mirrored handle */ 
    1098                ctx->data_handle = meta->mirror_dfile_array[index]; 
    1099                break; 
    1100             } 
    1101         } 
    1102  
    1103         /* we have NOT found a valid mirrored handle, so retry the primary */ 
    1104         if ( copies == meta->mirror_copies_count ) 
    1105         { 
    1106            ctx->data_handle = meta->dfile_array[ctx->server_nr]; 
    1107            ctx->retry_original = 0; 
    1108            ctx->current_copies_count = 0; 
    1109            io->retry_count++; 
    1110            /* setup context to retry original */ 
    1111            msg->handle          = ctx->data_handle; 
    1112            msg->req.u.io.handle = ctx->data_handle; 
    1113            ret=PINT_cached_config_map_to_server(&(msg->svr_addr) 
    1114                                                ,msg->handle 
    1115                                                ,msg->fs_id); 
    1116            if (ret) 
    1117            { 
    1118               gossip_lerr("Unable to determine the server address " 
    1119                           "for this handle (%llu)" 
    1120                           ,llu(msg->handle)); 
    1121               js_p->error_code = ret; 
    1122               return SM_ACTION_COMPLETE; 
    1123            } 
    1124            PINT_flow_reset(&(ctx->flow_desc)); 
    1125            continue; 
    1126         } 
    1127  
    11281130        /* setup the context for the discovered mirrored handle */ 
    1129         msg->handle          = ctx->data_handle; 
    1130         msg->req.u.io.handle = ctx->data_handle; 
    1131         ret=PINT_cached_config_map_to_server(&(msg->svr_addr) 
    1132                                             ,msg->handle 
    1133                                             ,msg->fs_id); 
     1131        PVFS_handle_copy(msg->handle, ctx->data_handle); 
     1132        PVFS_handle_copy(msg->req.u.io.handle, ctx->data_handle); 
     1133        ret = PINT_cached_config_map_to_server(&(msg->svr_addr), 
     1134                                               msg->handle, 
     1135                                               msg->fs_id); 
    11341136        if (ret) 
    11351137        { 
     
    30843086 
    30853087        msg->fs_id = sm_p->object_ref.fs_id; 
    3086         msg->handle = 
    3087             attr->u.meta.dfile_array[ 
    3088                 sm_p->u.io.datafile_index_array[i]]; 
     3088        PVFS_handle_copy(msg->handle, 
     3089            attr->u.meta.dfile_array[sm_p->u.io.datafile_index_array[i]]); 
    30893090        msg->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    30903091        msg->comp_fn = NULL; 
     
    31043105        cur_ctx->index = i; 
    31053106        cur_ctx->server_nr = sm_p->u.io.datafile_index_array[i]; 
    3106         cur_ctx->data_handle = 
    3107             attr->u.meta.dfile_array[cur_ctx->server_nr]; 
     3107        PVFS_handle_copy(cur_ctx->data_handle,  
     3108            attr->u.meta.dfile_array[cur_ctx->server_nr]); 
    31083109 
    31093110        PINT_flow_reset(&cur_ctx->flow_desc); 
  • branches/orange-next/src/client/sysint/sys-list-eattr.sm

    r8932 r8935  
    5353PVFS_error PVFS_isys_listeattr( 
    5454        PVFS_object_ref ref, 
    55         PVFS_ds_position token, 
     55        PVFS_kv_position token, 
     56        uint32_t token_flag, 
    5657        int32_t nkey, 
    5758        const PVFS_credentials *credentials, 
     
    6970                 "PINT_isys_listeattr entered\n"); 
    7071 
    71     if ((ref.handle == PVFS_HANDLE_NULL) || 
     72    if ((PVFS_handle_is_null(ref.handle)) || 
    7273       (ref.fs_id == PVFS_FS_ID_NULL) || (resp_p == NULL)) 
    7374    { 
     
    114115    sm_p->u.listeattr.nkey = nkey; 
    115116    sm_p->u.listeattr.resp_p = resp_p; 
    116     sm_p->u.listeattr.pos_token = token; 
     117    memcpy(&(sm_p->u.listeattr.pos_token), &token, sizeof(PVFS_kv_position)); 
     118    sm_p->u.listeattr.pos_token_flag = token_flag; 
    117119    sm_p->error_code = 0; 
    118120    sm_p->object_ref = ref; 
     
    125127PVFS_error PVFS_sys_listeattr( 
    126128        PVFS_object_ref ref, 
    127         PVFS_ds_position token, 
     129        PVFS_kv_position token, 
     130        uint32_t token_flag, 
    128131        int32_t nkey, 
    129132        const PVFS_credentials *credentials, 
     
    136139    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_sys_listeattr entered\n"); 
    137140 
    138     ret = PVFS_isys_listeattr(ref, token, nkey, credentials, 
     141    ret = PVFS_isys_listeattr(ref, token, token_flag, nkey, credentials, 
    139142            resp_p, &op_id, hints, NULL); 
    140143 
     
    187190            sm_p->object_ref.handle, 
    188191            sm_p->u.listeattr.pos_token, 
     192            sm_p->u.listeattr.pos_token_flag, 
    189193            sm_p->u.listeattr.nkey, 
    190194            sm_p->u.listeattr.size_array, 
     
    193197 
    194198    msg_p->fs_id = sm_p->object_ref.fs_id; 
    195     msg_p->handle = sm_p->object_ref.handle; 
     199    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    196200    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    197201    msg_p->comp_fn = list_eattr_comp_fn; 
     
    249253        return sm_p->msgarray_op.msgarray[i].op_status; 
    250254    } 
    251     sm_p->u.listeattr.resp_p->token = resp_p->u.listeattr.token; 
     255    memcpy(&(sm_p->u.listeattr.resp_p->token), &(resp_p->u.listeattr.token),  
     256           sizeof(PVFS_kv_position)); 
    252257    sm_p->u.listeattr.resp_p->nkey  = resp_p->u.listeattr.nkey; 
    253258 
     
    261266    else 
    262267    { 
    263         gossip_debug(GOSSIP_LISTEATTR_DEBUG,"listeattr returned %d keys\n", 
    264                 sm_p->u.listeattr.resp_p->nkey); 
     268        gossip_debug(GOSSIP_LISTEATTR_DEBUG,"listeattr returned %llu keys\n", 
     269                sm_p->u.listeattr.resp_p->token.count); 
    265270        /* Copy the token and reset it */ 
    266         sm_p->u.listeattr.resp_p->nkey = sm_p->u.listeattr.resp_p->token; 
    267         /* FIX: position stuff changed to use small int and flag */ 
    268         sm_p->u.listeattr.resp_p->token = PVFS_ITERATE_START; 
     271        sm_p->u.listeattr.resp_p->token_flag = PVFS_ITERATE_START; 
    269272        return 0; 
    270273    } 
    271     if (sm_p->u.listeattr.resp_p->nkey > 0) 
     274 
     275    if (sm_p->u.listeattr.resp_p->token.count > 0) 
    272276    { 
    273277        int k; 
     
    277281            return -1; 
    278282        } 
    279         for (k = 0; k < sm_p->u.listeattr.resp_p->nkey; k++) 
     283        for (k = 0; k < sm_p->u.listeattr.resp_p->token.count; k++) 
    280284        { 
    281285            gossip_debug(GOSSIP_LISTEATTR_DEBUG,"resp_read_sz = %d\n", 
  • branches/orange-next/src/client/sysint/sys-lookup.sm

    r8706 r8935  
    568568    if (name && resp) 
    569569    { 
    570         parent.handle = 0; 
     570        PVFS_handle_clear(parent.handle); 
    571571        parent.fs_id = fs_id; 
    572572 
     
    582582        if (strcmp(name, "/") == 0) 
    583583        { 
    584             resp->ref.handle = parent.handle; 
     584            PVFS_handle_copy(resp->ref.handle, parent.handle); 
    585585            resp->ref.fs_id = fs_id; 
    586586            ret = 0; 
     
    629629 
    630630    parent_ref.fs_id = cur_seg->seg_starting_refn.fs_id; 
    631     parent_ref.handle = cur_seg->seg_starting_refn.handle; 
     631    PVFS_handle_copy(parent_ref.handle, cur_seg->seg_starting_refn.handle); 
    632632 
    633633    ret = PINT_ncache_get_cached_entry(cur_seg->seg_name, &object_ref, 
     
    640640                     object_ref.fs_id); 
    641641 
    642         cur_seg->seg_resolved_refn.handle = object_ref.handle; 
     642        PVFS_handle_copy(cur_seg->seg_resolved_refn.handle, object_ref.handle); 
    643643        cur_seg->seg_resolved_refn.fs_id = object_ref.fs_id; 
    644644        js_p->error_code = 0;  /* hit */ 
     
    705705 
    706706    msg_p->fs_id = cur_seg->seg_starting_refn.fs_id; 
    707     msg_p->handle = cur_seg->seg_starting_refn.handle; 
     707    PVFS_handle_copy(msg_p->handle, cur_seg->seg_starting_refn.handle); 
    708708    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    709709    msg_p->comp_fn = lookup_segment_lookup_comp_fn; 
     
    11631163        } 
    11641164 
    1165         last_resolved_refn.handle = resp_p->u.lookup_path.handle_array[i]; 
     1165        PVFS_handle_copy(last_resolved_refn.handle,  
     1166            resp_p->u.lookup_path.handle_array[i]); 
    11661167        last_resolved_refn.fs_id = cur_seg->seg_starting_refn.fs_id; 
    11671168 
  • branches/orange-next/src/client/sysint/sys-mkdir.sm

    r7499 r8935  
    169169    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_isys_mkdir entered\n"); 
    170170 
    171     if ((parent_ref.handle == PVFS_HANDLE_NULL) || 
     171    if ((PVFS_handle_is_null(parent_ref.handle)) || 
    172172        (parent_ref.fs_id == PVFS_FS_ID_NULL) || 
    173173        (object_name == NULL) || (resp == NULL)) 
     
    305305 
    306306    /* otherwise, just stash the newly created meta handle */ 
    307     sm_p->u.mkdir.metafile_handle = resp_p->u.mkdir.handle; 
     307    PVFS_handle_copy(sm_p->u.mkdir.metafile_handle, resp_p->u.mkdir.handle); 
    308308 
    309309    /* also insert entry into attr cache */ 
     
    376376 
    377377    msg_p->fs_id = sm_p->object_ref.fs_id; 
    378     msg_p->handle = meta_handle_extent_array.extent_array[0].first; 
     378    PVFS_handle_copy(msg_p->handle,  
     379                     meta_handle_extent_array.extent_array[0].first); 
    379380    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    380381    msg_p->comp_fn = mkdir_msg_comp_fn; 
     
    426427 
    427428    msg_p->fs_id = sm_p->object_ref.fs_id; 
    428     msg_p->handle = sm_p->object_ref.handle; 
     429    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    429430    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    430431    msg_p->comp_fn = mkdir_crdirent_comp_fn; 
     
    491492 
    492493    msg_p->fs_id = sm_p->object_ref.fs_id; 
    493     msg_p->handle = sm_p->u.mkdir.metafile_handle; 
     494    PVFS_handle_copy(msg_p->handle, sm_p->u.mkdir.metafile_handle); 
    494495    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    495496    msg_p->comp_fn = mkdir_delete_handle_comp_fn; 
     
    535536        PVFS_object_ref directory_ref; 
    536537 
    537         directory_ref.handle = sm_p->u.mkdir.metafile_handle; 
     538        PVFS_handle_copy(directory_ref.handle, sm_p->u.mkdir.metafile_handle); 
    538539        directory_ref.fs_id = sm_p->object_ref.fs_id; 
    539540 
    540         sm_p->u.mkdir.mkdir_resp->ref.handle = directory_ref.handle; 
     541        PVFS_handle_copy(sm_p->u.mkdir.mkdir_resp->ref.handle, 
     542                         directory_ref.handle); 
    541543        sm_p->u.mkdir.mkdir_resp->ref.fs_id = directory_ref.fs_id; 
    542544 
     
    713715 
    714716    msg_p->fs_id = sm_p->object_ref.fs_id; 
    715     msg_p->handle = sm_p->u.mkdir.metafile_handle; 
     717    PVFS_handle_copy(msg_p->handle, sm_p->u.mkdir.metafile_handle); 
    716718    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    717719    /* NOTE: no comp_fn needed. */ 
  • branches/orange-next/src/client/sysint/sys-readdir.sm

    r8933 r8935  
    9999    PVFS_object_ref ref, 
    100100    PVFS_kv_position token,  
    101     uint32_t token_flag, 
     101    uint32_t *token_flag_p, 
    102102    int32_t pvfs_dirent_incount, 
    103103    const PVFS_credentials *credentials, 
     
    107107    void *user_ptr) 
    108108{ 
     109    /* FIX: use token_flag */ 
    109110    PVFS_error ret = -PVFS_EINVAL; 
    110111    PINT_smcb *smcb = NULL; 
     
    113114    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_isys_readdir entered\n"); 
    114115 
    115     if ((ref.handle == PVFS_HANDLE_NULL) || 
     116    if ((PVFS_handle_is_null(ref.handle)) || 
    116117        (ref.fs_id == PVFS_FS_ID_NULL) || 
    117118        (resp == NULL)) 
     
    151152    sm_p->readdir.dirent_outcount = &resp->pvfs_dirent_outcount; 
    152153    sm_p->readdir.token = &resp->token; 
    153     sm_p->readdir.token_flag = &resp->token; 
     154    sm_p->readdir.token_flag = token_flag_p; 
    154155    sm_p->readdir.directory_version = &resp->directory_version; 
    155156 
    156     sm_p->readdir.pos_token = sm_p->u.readdir.pos_token = token; 
     157    memcpy(&(sm_p->readdir.pos_token), &token, sizeof(PVFS_kv_position)); 
     158    memcpy(&(sm_p->u.readdir.pos_token), &token, sizeof(PVFS_kv_position)); 
     159    sm_p->readdir.pos_token_flag = *token_flag_p; 
    157160    sm_p->readdir.dirent_limit = sm_p->u.readdir.dirent_limit = pvfs_dirent_incount; 
    158161 
     
    174177    PVFS_object_ref ref, 
    175178    PVFS_kv_position token,  
    176     uint32_t token_flag, 
     179    uint32_t *token_flag_p, 
    177180    int32_t pvfs_dirent_incount, 
    178181    const PVFS_credentials *credentials, 
     
    185188    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_sys_readdir entered\n"); 
    186189 
    187     ret = PVFS_isys_readdir(ref, token, token_flag, pvfs_dirent_incount, 
     190    ret = PVFS_isys_readdir(ref, token, token_flag_p, pvfs_dirent_incount, 
    188191                            credentials, resp, &op_id, hints, NULL); 
    189192    if (ret) 
     
    245248 
    246249    gossip_debug( 
    247         GOSSIP_READDIR_DEBUG, "%llu|%d | token is %llu | limit is %d\n", 
     250        GOSSIP_READDIR_DEBUG, "%llu|%d | token is session(%llu), count(%llu) |" 
     251                              "limit is %d\n", 
    248252        llu(sm_p->object_ref.handle), 
    249253        sm_p->object_ref.fs_id, 
    250         llu(sm_p->readdir.pos_token), 
     254        llu(sm_p->readdir.pos_token.session), 
     255        llu(sm_p->readdir.pos_token.count), 
    251256        sm_p->readdir.dirent_limit); 
    252257 
     
    265270 
    266271    msg_p->fs_id = sm_p->object_ref.fs_id; 
    267     msg_p->handle = sm_p->object_ref.handle; 
     272    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    268273    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    269274    msg_p->comp_fn = readdir_msg_comp_fn; 
     
    307312    *(sm_p->readdir.dirent_outcount) = 
    308313        resp_p->u.readdir.dirent_count; 
    309     *(sm_p->readdir.token_flag( = resp_p->u.readdir.token_flag; 
     314    *(sm_p->readdir.token_flag) = resp_p->u.readdir.token_flag; 
    310315 
    311316    if (*(sm_p->readdir.dirent_outcount) > 0) 
     
    353358        for(i = 0; i < *(sm_p->readdir.dirent_outcount); i++) 
    354359        { 
    355             tmp_ref.handle = (*(sm_p->readdir.dirent_array))[i].handle; 
     360            PVFS_handle_copy(tmp_ref.handle,  
     361                (*(sm_p->readdir.dirent_array))[i].handle); 
    356362            PINT_ncache_update( 
    357363                (const char *) (*(sm_p->readdir.dirent_array))[i].d_name, 
  • branches/orange-next/src/client/sysint/sys-readdirplus.sm

    r8869 r8935  
    109109PVFS_error PVFS_isys_readdirplus( 
    110110    PVFS_object_ref ref, 
    111     PVFS_ds_position token,  
     111    PVFS_kv_position token,  
     112    uint32_t *token_flag_p, 
    112113    int32_t pvfs_dirent_incount, 
    113114    const PVFS_credentials *credentials, 
     
    124125    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_isys_readdirplus entered\n"); 
    125126 
    126     if ((ref.handle == PVFS_HANDLE_NULL) || 
     127    if ((PVFS_handle_is_null(ref.handle)) || 
    127128        (ref.fs_id == PVFS_FS_ID_NULL) || 
    128129        (resp == NULL)) 
     
    150151    sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
    151152 
     153    /* FIX: this needs to be changed to be like readdir w.r.t token/token_flag 
     154     * usage */ 
    152155    PINT_init_msgarray_params(sm_p, ref.fs_id); 
    153156    PINT_init_sysint_credentials(sm_p->cred_p, credentials); 
    154157    sm_p->object_ref = ref; 
    155158    PVFS_hint_copy(hints, &sm_p->hints); 
    156     /* point the sm dirent array and outcount to the readdirplus response field */ 
     159    /* point the sm dirent array and outcount to the readdirplus response  
     160     * field */ 
    157161    sm_p->readdir.dirent_array = &resp->dirent_array; 
    158162    sm_p->readdir.dirent_outcount = &resp->pvfs_dirent_outcount; 
     
    190194PVFS_error PVFS_sys_readdirplus( 
    191195    PVFS_object_ref ref, 
    192     PVFS_ds_position token,  
     196    PVFS_kv_position token,  
     197    uint32_t *token_flag_p, 
    193198    int32_t pvfs_dirent_incount, 
    194199    const PVFS_credentials *credentials, 
     
    202207    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_sys_readdirplus entered\n"); 
    203208 
    204     ret = PVFS_isys_readdirplus(ref, token, pvfs_dirent_incount, 
     209    ret = PVFS_isys_readdirplus(ref, token, token_flag_p, pvfs_dirent_incount, 
    205210                            credentials, attrmask, resp, &op_id, NULL, hints); 
    206211    if (ret) 
     
    381386                break; 
    382387            } 
    383             (*per_server_handles)[svr_index][(*per_server_handle_count)[svr_index] - 1] = input_handle_array[i].handle; 
     388            PVFS_handle_copy( (*per_server_handles)[svr_index][(*per_server_handle_count)[svr_index] - 1], 
     389                             input_handle_array[i].handle); 
    384390        } 
    385391        if (i != input_handle_count) 
     
    456462    for (i = 0; i < sm_p->u.readdirplus.nhandles; i++) 
    457463    { 
    458         sm_p->u.readdirplus.input_handle_array[i].handle =  
    459                 readdirplus_resp->dirent_array[i].handle; 
     464        PVFS_handle_copy(sm_p->u.readdirplus.input_handle_array[i].handle,  
     465            readdirplus_resp->dirent_array[i].handle); 
    460466        sm_p->u.readdirplus.input_handle_array[i].handle_index = i; 
    461467        /* aux index is not used for meta handles */ 
     
    525531            sm_p->hints); 
    526532        msg_p->fs_id = sm_p->object_ref.fs_id; 
    527         msg_p->handle = PVFS_HANDLE_NULL; 
     533        PVFS_handle_clear(msg_p->handle); 
    528534        msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    529535        msg_p->comp_fn = readdirplus_fetch_attrs_comp_fn; 
     
    677683             for (j = 0; j < sm_p->u.readdirplus.obj_attr_array[i].u.meta.dfile_count; j++)  
    678684             { 
    679                  sm_p->u.readdirplus.input_handle_array[nhandles].handle =  
    680                     sm_p->u.readdirplus.obj_attr_array[i].u.meta.dfile_array[j]; 
    681                  sm_p->u.readdirplus.input_handle_array[nhandles].handle_index = i; 
     685                 PVFS_handle_copy( 
     686                    sm_p->u.readdirplus.input_handle_array[nhandles].handle, 
     687                    sm_p->u.readdirplus.obj_attr_array[i].u.meta.dfile_array[j] 
     688                                 ); 
     689                 sm_p->u.readdirplus.input_handle_array[nhandles].handle_index = 
     690                    i; 
    682691                 sm_p->u.readdirplus.input_handle_array[nhandles].aux_index = j; 
    683692                 nhandles++; 
     
    746755            sm_p->hints); 
    747756        msg_p->fs_id = sm_p->object_ref.fs_id; 
    748         msg_p->handle = PVFS_HANDLE_NULL; 
     757        PVFS_handle_clear(msg_p->handle); 
    749758        msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    750759        msg_p->comp_fn = readdirplus_fetch_sizes_comp_fn; 
  • branches/orange-next/src/client/sysint/sys-remove.sm

    r7471 r8935  
    164164    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_isys_remove entered\n"); 
    165165 
    166     if ((parent_ref.handle == PVFS_HANDLE_NULL) || 
     166    if ((PVFS_handle_is_null(parent_ref.handle)) || 
    167167        (parent_ref.fs_id == PVFS_FS_ID_NULL) || 
    168168        (object_name == NULL)) 
     
    283283 
    284284    msg_p->fs_id = sm_p->parent_ref.fs_id; 
    285     msg_p->handle = sm_p->parent_ref.handle; 
     285    PVFS_handle_copy(msg_p->handle, sm_p->parent_ref.handle); 
    286286    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    287287    msg_p->comp_fn = remove_rmdirent_comp_fn; 
     
    334334 
    335335    msg_p->fs_id = sm_p->parent_ref.fs_id; 
    336     msg_p->handle = sm_p->parent_ref.handle; 
     336    PVFS_handle_copy(msg_p->handle, sm_p->parent_ref.handle); 
    337337    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    338338    msg_p->comp_fn = remove_crdirent_comp_fn; 
     
    363363    if (resp_p->status == 0) 
    364364    { 
    365         assert(resp_p->u.rmdirent.entry_handle != PVFS_HANDLE_NULL); 
     365        assert(!PVFS_handle_is_null(resp_p->u.rmdirent.entry_handle)); 
    366366        assert(sm_p->parent_ref.fs_id != PVFS_FS_ID_NULL); 
    367367 
    368368        /* pull handle out of response, also copy in fs_id from before */ 
    369         sm_p->object_ref.handle = resp_p->u.rmdirent.entry_handle; 
     369        PVFS_handle_copy(sm_p->object_ref.handle,  
     370                         resp_p->u.rmdirent.entry_handle); 
    370371        sm_p->object_ref.fs_id  = sm_p->parent_ref.fs_id; 
    371372 
  • branches/orange-next/src/client/sysint/sys-rename.sm

    r8700 r8935  
    235235 
    236236    if ((old_entry == NULL) || (new_entry == NULL) || 
    237         (old_parent_ref.handle == PVFS_HANDLE_NULL) || 
     237        (PVFS_handle_is_null(old_parent_ref.handle)) || 
    238238        (old_parent_ref.fs_id == PVFS_FS_ID_NULL) || 
    239         (new_parent_ref.handle == PVFS_HANDLE_NULL) || 
     239        (PVFS_handle_is_null(new_parent_ref.handle)) || 
    240240        (new_parent_ref.fs_id == PVFS_FS_ID_NULL)) 
    241241    { 
     
    245245 
    246246    /* don't even try to rename a file to itself */ 
    247     if ((old_parent_ref.handle == new_parent_ref.handle) && 
    248         (old_parent_ref.fs_id == new_parent_ref.fs_id) && 
     247    if ((PVFS_handle_compare(old_parent_ref.handle, new_parent_ref.handle)==0)  
     248         && (old_parent_ref.fs_id == new_parent_ref.fs_id) && 
    249249        (strcmp(old_entry, new_entry) == 0)) 
    250250    { 
     
    407407    */ 
    408408    assert(resp_p->u.lookup_path.handle_count == 1); 
    409     sm_p->u.rename.refns[index].handle = 
    410         resp_p->u.lookup_path.handle_array[0]; 
     409    PVFS_handle_copy(sm_p->u.rename.refns[index].handle,  
     410                     resp_p->u.lookup_path.handle_array[0]); 
    411411    sm_p->u.rename.refns[index].fs_id = 
    412412        sm_p->u.rename.parent_refns[index].fs_id; 
     
    508508      with the target name; store it for later removal 
    509509    */ 
    510     sm_p->u.rename.old_dirent_handle = 
    511         resp_p->u.chdirent.old_dirent_handle; 
     510    PVFS_handle_copy(sm_p->u.rename.old_dirent_handle,  
     511                     resp_p->u.chdirent.old_dirent_handle); 
    512512 
    513513    gossip_debug(GOSSIP_CLIENT_DEBUG, "got back old dirent handle %llu\n", 
     
    553553        /* fill in msgpair structure components */ 
    554554        msg_p->fs_id = sm_p->u.rename.parent_refns[i].fs_id; 
    555         msg_p->handle = sm_p->u.rename.parent_refns[i].handle; 
     555        PVFS_handle_copy(msg_p->handle, sm_p->u.rename.parent_refns[i].handle); 
    556556        msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    557557        msg_p->comp_fn = rename_lookups_comp_fn; 
     
    610610 
    611611    msg_p->fs_id = sm_p->u.rename.parent_refns[1].fs_id; 
    612     msg_p->handle = sm_p->u.rename.parent_refns[1].handle; 
     612    PVFS_handle_copy(msg_p->handle, sm_p->u.rename.parent_refns[1].handle); 
    613613    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    614614    msg_p->comp_fn = rename_crdirent_comp_fn; 
     
    663663    msg_p->fs_id = sm_p->u.rename.parent_refns[ 
    664664        sm_p->u.rename.rmdirent_index].fs_id; 
    665     msg_p->handle = sm_p->u.rename.parent_refns[ 
    666         sm_p->u.rename.rmdirent_index].handle; 
     665    PVFS_handle_copy(msg_p->handle,  
     666        sm_p->u.rename.parent_refns[sm_p->u.rename.rmdirent_index].handle); 
    667667    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    668668    msg_p->comp_fn = rename_rmdirent_comp_fn; 
     
    792792 
    793793    msg_p->fs_id = sm_p->u.rename.parent_refns[1].fs_id; 
    794     msg_p->handle = sm_p->u.rename.parent_refns[1].handle; 
     794    PVFS_handle_copy(msg_p->handle, sm_p->u.rename.parent_refns[1].handle); 
    795795    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    796796    msg_p->comp_fn = rename_chdirent_comp_fn; 
     
    828828 
    829829    /* setup the handle to be removed */ 
    830     sm_p->object_ref.handle = sm_p->u.rename.old_dirent_handle; 
     830    PVFS_handle_copy(sm_p->object_ref.handle, sm_p->u.rename.old_dirent_handle); 
    831831    sm_p->object_ref.fs_id = sm_p->u.rename.parent_refns[1].fs_id; 
    832832 
  • branches/orange-next/src/client/sysint/sys-set-eattr.sm

    r8891 r8935  
    9090    } /*end if*/ 
    9191 
    92     if ((ref.handle == PVFS_HANDLE_NULL) || 
     92    if ((PVFS_handle_is_null(ref.handle)) || 
    9393       (ref.fs_id == PVFS_FS_ID_NULL)) 
    9494    { 
     
    207207 
    208208    msg_p->fs_id = sm_p->object_ref.fs_id; 
    209     msg_p->handle = sm_p->object_ref.handle; 
     209    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    210210    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    211211    msg_p->comp_fn = set_eattr_comp_fn; 
  • branches/orange-next/src/client/sysint/sys-setattr.sm

    r8679 r8935  
    8585    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_isys_setattr entered\n"); 
    8686 
    87     if ((ref.handle == PVFS_HANDLE_NULL) || 
     87    if ((PVFS_handle_is_null(ref.handle)) || 
    8888        (ref.fs_id == PVFS_FS_ID_NULL)) 
    8989    { 
     
    230230 
    231231    msg_p->fs_id = sm_p->object_ref.fs_id; 
    232     msg_p->handle = sm_p->object_ref.handle; 
     232    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    233233    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    234234    msg_p->comp_fn = setattr_msg_comp_fn; 
  • branches/orange-next/src/client/sysint/sys-small-io.sm

    r8869 r8935  
    119119    foreach_msgpair(&sm_p->msgarray_op, msg_p, i) 
    120120    { 
    121         datafile_handle = attr->u.meta.dfile_array[ 
    122             sm_p->u.io.datafile_index_array[i]]; 
     121        PVFS_handle_copy(datafile_handle, 
     122            attr->u.meta.dfile_array[sm_p->u.io.datafile_index_array[i]]); 
    123123 
    124124        gossip_debug(GOSSIP_IO_DEBUG, "   small_io_setup_msgpairs: " 
     
    198198 
    199199        msg_p->fs_id  = sm_p->object_ref.fs_id; 
    200         msg_p->handle = datafile_handle; 
     200        PVFS_handle_copy(msg_p->handle, datafile_handle); 
    201201 
    202202        /*if we are processing a read request and the source file has mirrored 
     
    227227        /*store the original datahandle for later use.*/ 
    228228        server_nr = msg_p->req.u.small_io.server_nr; 
    229         sm_p->u.io.small_io_ctx[server_nr].original_datahandle = msg_p->handle; 
     229        PVFS_handle_copy(sm_p->u.io.small_io_ctx[server_nr].original_datahandle, 
     230                         msg_p->handle); 
    230231    } 
    231232 
     
    493494        { 
    494495            ctx->retry_original = 0; 
    495             msg->handle                = ctx->original_datahandle; 
    496             msg->req.u.small_io.handle = ctx->original_datahandle; 
     496            PVFS_handle_copy(msg->handle, ctx->original_datahandle); 
     497            PVFS_handle_copy(msg->req.u.small_io.handle, 
     498                             ctx->original_datahandle); 
    497499            msg->svr_addr = 0; 
    498500            ret = PINT_cached_config_map_to_server(&msg->svr_addr 
     
    521523            if (meta->mirror_dfile_array[index] != 0) 
    522524            {  /* we have found a valid mirrored handle */ 
    523                msg->handle = meta->mirror_dfile_array[index]; 
     525               PVFS_handle_copy(msg->handle, meta->mirror_dfile_array[index]); 
    524526               break; 
    525527            } 
     
    531533        if ( copies == meta->mirror_copies_count ) 
    532534        { 
    533            msg->handle = ctx->original_datahandle; 
     535           PVFS_handle_copy(msg->handle, ctx->original_datahandle); 
    534536           ctx->retry_original = 0; 
    535537           ctx->current_copies_count = 0; 
    536538           sm_p->u.io.retry_count++; 
    537            msg->req.u.small_io.handle = ctx->original_datahandle; 
     539           PVFS_handle_copy(msg->req.u.small_io.handle,  
     540                            ctx->original_datahandle); 
    538541           msg->svr_addr = 0; 
    539542           ret=PINT_cached_config_map_to_server(&(msg->svr_addr) 
     
    552555 
    553556        /* Otherwise, use the discovered mirrored handle */ 
    554         msg->req.u.small_io.handle = msg->handle; 
     557        PVFS_handle_copy(msg->req.u.small_io.handle, msg->handle); 
    555558        msg->svr_addr = 0; 
    556         ret=PINT_cached_config_map_to_server(&(msg->svr_addr) 
    557                                             ,msg->handle 
    558                                             ,msg->fs_id); 
     559        ret = PINT_cached_config_map_to_server(&(msg->svr_addr), 
     560                                               msg->handle, 
     561                                               msg->fs_id); 
    559562        if (ret) 
    560563        { 
     
    602605 
    603606        new_msg->fs_id       = msg->fs_id; 
    604         new_msg->handle      = msg->handle; 
     607        PVFS_handle_copy(new_msg->handle, msg->handle); 
    605608        new_msg->comp_fn     = msg->comp_fn; 
    606609        new_msg->svr_addr    = msg->svr_addr; 
  • branches/orange-next/src/client/sysint/sys-symlink.sm

    r7471 r8935  
    160160    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_isys_symlink entered\n"); 
    161161 
    162     if ((parent_ref.handle == PVFS_HANDLE_NULL) || 
     162    if ((PVFS_handle_is_null(parent_ref.handle)) || 
    163163        (parent_ref.fs_id == PVFS_FS_ID_NULL) || 
    164164        (entry_name == NULL) || (resp == NULL) || (target == NULL)) 
     
    307307    } 
    308308 
    309     sm_p->u.sym.symlink_handle = resp_p->u.batch_create.handle_array[0]; 
     309    PVFS_handle_copy(sm_p->u.sym.symlink_handle, 
     310        resp_p->u.batch_create.handle_array[0]); 
    310311 
    311312    gossip_debug(GOSSIP_CLIENT_DEBUG, "*** Got newly created symlink " 
     
    323324    PVFS_object_ref tmp_ref; 
    324325 
    325     tmp_ref.handle = sm_p->u.sym.symlink_handle; 
     326    PVFS_handle_copy(tmp_ref.handle, sm_p->u.sym.symlink_handle); 
    326327    tmp_ref.fs_id = sm_p->object_ref.fs_id; 
    327328 
     
    394395 
    395396    msg_p->fs_id = sm_p->object_ref.fs_id; 
    396     msg_p->handle = meta_handle_extent_array.extent_array[0].first; 
     397    PVFS_handle_copy(msg_p->handle,  
     398        meta_handle_extent_array.extent_array[0].first); 
    397399    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    398400    msg_p->comp_fn = symlink_create_comp_fn; 
     
    435437 
    436438    msg_p->fs_id = sm_p->object_ref.fs_id; 
    437     msg_p->handle = sm_p->object_ref.handle; 
     439    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    438440    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    439441    msg_p->comp_fn = symlink_crdirent_comp_fn; 
     
    499501 
    500502    msg_p->fs_id = sm_p->object_ref.fs_id; 
    501     msg_p->handle = sm_p->u.sym.symlink_handle; 
     503    PVFS_handle_copy(msg_p->handle, sm_p->u.sym.symlink_handle); 
    502504    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    503505    msg_p->comp_fn = symlink_setattr_comp_fn; 
     
    545547 
    546548    msg_p->fs_id = sm_p->object_ref.fs_id; 
    547     msg_p->handle = sm_p->u.sym.symlink_handle; 
     549    PVFS_handle_copy(msg_p->handle, sm_p->u.sym.symlink_handle); 
    548550    msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
    549551    msg_p->comp_fn = symlink_delete_handle_comp_fn; 
     
    582584    if (sm_p->error_code == 0) 
    583585    { 
    584         symlink_ref.handle = sm_p->u.sym.symlink_handle; 
     586        PVFS_handle_copy(symlink_ref.handle, sm_p->u.sym.symlink_handle); 
    585587        symlink_ref.fs_id = sm_p->object_ref.fs_id; 
    586588 
  • branches/orange-next/src/client/sysint/sys-truncate.sm

    r8317 r8935  
    117117 
    118118    if ((ref.fs_id == PVFS_FS_ID_NULL) || 
    119         (ref.handle == PVFS_HANDLE_NULL)) 
     119        (PVFS_handle_is_null(ref.handle)) ) 
    120120    { 
    121121        gossip_err("invalid (NULL) required argument\n"); 
     
    262262        */ 
    263263        msg_p->fs_id = sm_p->object_ref.fs_id; 
    264         msg_p->handle = attr->u.meta.dfile_array[i]; 
     264        PVFS_handle_copy(msg_p->handle, attr->u.meta.dfile_array[i]); 
    265265        msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    266266        msg_p->comp_fn = NULL; 
     
    418418 
    419419    msg_p->fs_id = sm_p->object_ref.fs_id; 
    420     msg_p->handle = sm_p->object_ref.handle; 
     420    PVFS_handle_copy(msg_p->handle, sm_p->object_ref.handle); 
    421421    msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    422422    msg_p->comp_fn = unstuff_comp_fn; 
  • branches/orange-next/src/common/misc/fsck-utils.c

    r8932 r8935  
    365365 
    366366    /* Build the needed PVFS_Object reference needed for API calls */ 
    367     obj_ref.handle = *handle; 
     367    PVFS_handle_copy(obj_ref.handle, *handle); 
    368368    obj_ref.fs_id = *cur_fs; 
    369369 
     
    487487    { 
    488488        err = PVFS_fsck_validate_dfile(fsck_options, 
    489                                      &df_handles[i], 
     489                                     (const PVFS_handle *)&df_handles[i], 
    490490                                     &obj_ref->fs_id, 
    491491                                     creds, &dfiles_total_size); 
     
    680680    memset(&dirdata_attributes, 0, sizeof(dirdata_attributes)); 
    681681 
    682     obj_ref.handle = *handle; 
     682    PVFS_handle_copy(obj_ref.handle, *handle); 
    683683    obj_ref.fs_id = *cur_fs; 
    684684 
     
    757757    int err = 0; 
    758758    int current_dir_entry = 0; 
    759     PVFS_ds_position token = PVFS_READDIR_START; 
     759    PVFS_kv_position token; 
     760    unsigned int token_flag = PVFS_READDIR_START; 
    760761    PVFS_sysresp_readdir readdir_resp; 
    761762    PVFS_handle dirdata_handle; 
     
    788789    } 
    789790 
    790     err = PVFS_fsck_validate_dirdata 
    791         (fsck_options, &dirdata_handle, &obj_ref->fs_id, creds); 
     791    err = PVFS_fsck_validate_dirdata(fsck_options,  
     792        (const PVFS_handle *)&dirdata_handle, &obj_ref->fs_id, creds); 
    792793    if(err < 0) 
    793794    { 
     
    803804 
    804805        err = PVFS_sys_readdir(*obj_ref, 
    805                              token, 
    806                              MAX_DIR_ENTS, 
    807                              (PVFS_credentials *) creds, &readdir_resp, NULL); 
     806                               token, 
     807                               &token_flag, 
     808                               MAX_DIR_ENTS, 
     809                               (PVFS_credentials *) creds, &readdir_resp, NULL); 
    808810        if(err < 0) 
    809811        { 
     
    817819                    readdir_resp.dirent_array[i].d_name, PVFS_NAME_MAX + 1); 
    818820 
    819             directory_entries[current_dir_entry].handle =  
    820                 readdir_resp.dirent_array[i].handle; 
     821            PVFS_handle_copy(directory_entries[current_dir_entry].handle, 
     822                             readdir_resp.dirent_array[i].handle); 
    821823            current_dir_entry++; 
    822824 
     
    837839 
    838840        free(readdir_resp.dirent_array); 
    839         token = readdir_resp.token; 
     841        memcpy(&token, &readdir_resp.token, sizeof(PVFS_kv_position)); 
    840842 
    841843    } while (readdir_resp.pvfs_dirent_outcount == MAX_DIR_ENTS); 
     
    10661068    int *handle_count_array = NULL; 
    10671069    PVFS_ds_position *position_array = NULL; 
     1070    unsigned int *position_flag_array = NULL; 
    10681071    int more_handles = 0; 
    10691072    int err = 0; 
     
    11451148    } 
    11461149 
     1150    position_flag_array = (unsigned int *) calloc(server_count,  
     1151                                                  sizeof(unsigned int)); 
     1152    if( position_flag_array == NULL ) 
     1153    { 
     1154        ret = -PVFS_ENOMEM; 
     1155        goto load_handles_error; 
     1156    } 
     1157 
    11471158    PINT_handle_wrangler_handlelist.list_array = 
    11481159        (PVFS_handle **) calloc(server_count, sizeof(PVFS_handle *)); 
     
    11991210    memset(handle_matrix, 0, server_count*sizeof(PVFS_handle*)); 
    12001211 
    1201     /* populating a nice "handlelist" struct with all this various handle data */ 
     1212    /* populating a nice "handlelist" struct with all this various handle  
     1213     * data */ 
    12021214    for (i = 0; i < server_count; i++) 
    12031215    { 
     
    12361248 
    12371249        /* FIX: position stuff changed to use small int and flag */ 
    1238         position_array[i] = PVFS_ITERATE_START; 
     1250        position_flag_array[i] = PVFS_ITERATE_START; 
    12391251        handle_count_array[i] = HANDLE_BATCH; 
    12401252    } 
     
    12491261                                             handle_count_array, 
    12501262                                             position_array, 
     1263                                             NULL, 
     1264                                             position_flag_array, 
    12511265                                             PINT_handle_wrangler_handlelist.addr_array, 
    12521266                                             server_count, 
     
    12691283            for (j = 0; j < handle_count_array[i]; j++) 
    12701284            { 
    1271                 PINT_handle_wrangler_handlelist.list_array[i] 
    1272                     [PINT_handle_wrangler_handlelist.used_array[i] + j] = 
    1273                     handle_matrix[i][j]; 
     1285                PVFS_handle_copy(PINT_handle_wrangler_handlelist.list_array[i] 
     1286                    [PINT_handle_wrangler_handlelist.used_array[i] + j], 
     1287                    handle_matrix[i][j]); 
    12741288            } 
    12751289 
     
    12791293            /* are there more handles? */ 
    12801294            /* FIX: position stuff changed to use small int and flag */ 
    1281             if (position_array[i] != PVFS_ITERATE_END) 
     1295            if (position_flag_array[i] != PVFS_ITERATE_END) 
    12821296            { 
    12831297                more_handles = 1; 
     
    13021316    { 
    13031317        /* FIX: position stuff changed to use small int and flag */ 
    1304         position_array[i] = PVFS_ITERATE_START; 
     1318        position_flag_array[i] = PVFS_ITERATE_START; 
    13051319        handle_count_array[i] = HANDLE_BATCH; 
    13061320    } 
     
    13131327                                             handle_count_array, 
    13141328                                             position_array, 
     1329                                             NULL, 
     1330                                             position_flag_array, 
    13151331                                             PINT_handle_wrangler_handlelist.addr_array, 
    13161332                                             server_count, 
     
    13331349            for (j = 0; j < handle_count_array[i]; j++) 
    13341350            { 
    1335                 PINT_handle_wrangler_remove_handle(&handle_matrix[i][j], 
    1336                     cur_fs); 
     1351                PINT_handle_wrangler_remove_handle( 
     1352                    (const PVFS_handle *)&(handle_matrix[i][j]), cur_fs); 
    13371353            } 
    13381354 
    13391355            /* are there more handles? */ 
    13401356            /* FIX: position stuff changed to use small int and flag */ 
    1341             if (position_array[i] != PVFS_ITERATE_END) 
     1357            if (position_flag_array[i] != PVFS_ITERATE_END) 
    13421358            { 
    13431359                more_handles = 1; 
     
    13921408    if(position_array) 
    13931409        free(position_array); 
     1410    if(position_flag_array) 
     1411        free(position_flag_array); 
    13941412    if(handle_count_array) 
    13951413        free(handle_count_array); 
     
    14191437 
    14201438    /* find which server the handle is on */ 
    1421     ret = PINT_cached_config_map_to_server(&server_addr, *handle, *cur_fs); 
     1439    ret = PINT_cached_config_map_to_server(&server_addr,  
     1440        *(PVFS_handle *)handle, *cur_fs); 
    14221441    if(ret < 0) 
    14231442    { 
     
    15431562            if (!PINT_handle_wrangler_handlelist.list_array_seen[i][j]) 
    15441563            { 
    1545                 pref.handle = PINT_handle_wrangler_handlelist.list_array[i][j]; 
     1564                PVFS_handle_copy(pref.handle,  
     1565                    PINT_handle_wrangler_handlelist.list_array[i][j]); 
    15461566                pref.fs_id = *cur_fs; 
    15471567 
  • branches/orange-next/src/common/misc/mkspace.c

    r8934 r8935  
    3636   fprintf(stderr,format, ##f);                     \ 
    3737} while(0) 
    38  
    39 static int handle_is_excluded( 
    40     TROVE_handle handle, TROVE_handle *handles_to_exclude, 
    41     int num_handles_to_exclude) 
    42 { 
    43     int excluded = 0; 
    44  
    45     while((num_handles_to_exclude - 1) > -1) 
    46     { 
    47         if (handle == handles_to_exclude[num_handles_to_exclude-1]) 
    48         { 
    49             excluded = 1; 
    50             break; 
    51         } 
    52         num_handles_to_exclude--; 
    53     } 
    54     return excluded; 
    55 } 
    5638 
    5739int pvfs2_mkspace( 
     
    6648    int verbose) 
    6749{ 
    68     int ret = - 1, count = 0; 
     50    int ret = - 1, count = 0, i = 0; 
    6951    TROVE_op_id op_id; 
    7052    TROVE_ds_state state; 
    7153    TROVE_keyval_s key, val; 
    7254    TROVE_ds_attributes_s attr; 
    73     TROVE_handle_extent cur_extent; 
    74     TROVE_handle_extent_array extent_array; 
    7555    TROVE_context_id trove_context = -1; 
    7656    char *merged_handle_ranges = NULL; 
    77     TROVE_handle new_root_handle = TROVE_HANDLE_NULL; 
    78     TROVE_handle root_dirdata_handle = TROVE_HANDLE_NULL; 
    79     TROVE_handle lost_and_found_handle = TROVE_HANDLE_NULL; 
    80     TROVE_handle lost_and_found_dirdata_handle = TROVE_HANDLE_NULL; 
     57    TROVE_handle new_root_handle; 
     58    TROVE_handle root_dirdata_handle; 
     59    TROVE_handle lost_and_found_handle;  
     60    TROVE_handle lost_and_found_dirdata_handle; 
    8161 
    8262    mkspace_print(verbose,"Data storage space     : %s\n",data_path); 
     
    9272                   data_handle_ranges : "NONE")); 
    9373 
    94     new_root_handle = root_handle; 
     74    PVFS_handle_clear(new_root_handle); 
     75    PVFS_handle_clear(root_dirdata_handle); 
     76    PVFS_handle_clear(lost_and_found_handle); 
     77    PVFS_handle_clear(lost_and_found_dirdata_handle); 
     78 
     79 
     80    PVFS_handle_copy(new_root_handle,root_handle); 
    9581 
    9682    /* clear out the 4 s_used_handles defined globally. should re-visit if 
     
    234220      attributes on the dspace 
    235221    */ 
    236     if (new_root_handle != TROVE_HANDLE_NULL) 
    237     { 
    238         cur_extent.first = cur_extent.last = new_root_handle; 
    239         extent_array.extent_count = 1; 
    240         extent_array.extent_array = &cur_extent; 
    241  
     222    if (! PVFS_handle_is_null(new_root_handle) ) 
     223    { 
    242224        ret = trove_dspace_create( 
    243             coll_id, &extent_array, &new_root_handle, 
     225            coll_id, &new_root_handle, 
    244226            PVFS_TYPE_DIRECTORY, NULL, 
    245227            (TROVE_SYNC | TROVE_FORCE_REQUESTED_HANDLE), 
     
    262244        mkspace_print(verbose,"info: created root directory " 
    263245                      "with handle %llu.\n", llu(new_root_handle)); 
    264         s_used_handles[0] = new_root_handle; 
     246        PVFS_handle_copy(s_used_handles[0], new_root_handle); 
    265247 
    266248        /* set collection attribute for root handle */ 
    267249        key.buffer = ROOT_HANDLE_KEYSTR; 
    268250        key.buffer_sz = ROOT_HANDLE_KEYLEN; 
    269         val.buffer = &new_root_handle; 
     251        PVFS_handle_copy(*(PVFS_handle *)val.buffer, new_root_handle); 
    270252        val.buffer_sz = sizeof(new_root_handle); 
    271253        ret = trove_collection_seteattr(coll_id, &key, &val, 0, 
     
    312294        } 
    313295 
    314         /* 
    315           create a dataspace to hold directory entries; if we have a 
    316           meta handle range, use that one of those ranges (being 
    317           careful to make sure the range has enough space for an 
    318           allocation) to allocate a dataspace to hold directory 
    319           entries.  if we don't have a meta handle range, use 
    320           TROVE_HANDLE_NULL which tells the allocator to use any 
    321           handle available 
    322         */ 
    323         cur_extent.first = cur_extent.last = TROVE_HANDLE_NULL; 
    324         if (meta_handle_ranges) 
    325         { 
    326             get_handle_extent_from_ranges( 
    327                 meta_handle_ranges, &cur_extent, s_used_handles, 1); 
    328  
    329             if ((cur_extent.first == TROVE_HANDLE_NULL) && 
    330                 (cur_extent.last == TROVE_HANDLE_NULL)) 
    331             { 
    332                 gossip_err("No valid meta handle ranges available! " 
    333                            "Using a default\n"); 
    334             } 
    335             else 
    336             { 
    337                 mkspace_print( 
    338                     verbose, "info: using meta handle range %llu-%llu for " 
    339                     "root dirent dspace\n", llu(cur_extent.first), 
    340                     llu(cur_extent.last)); 
    341             } 
    342         } 
    343  
    344         extent_array.extent_count = 1; 
    345         extent_array.extent_array = &cur_extent; 
    346  
    347296        ret = trove_dspace_create( 
    348             coll_id, &extent_array, &root_dirdata_handle, 
    349             PVFS_TYPE_DIRDATA, NULL, TROVE_SYNC, NULL, 
    350             trove_context, &op_id, NULL); 
     297            coll_id, &root_dirdata_handle, PVFS_TYPE_DIRDATA, NULL, TROVE_SYNC, 
     298            NULL, trove_context, &op_id, NULL); 
    351299 
    352300        while (ret == 0) 
     
    365313        mkspace_print(verbose, "info: created dspace for dirents " 
    366314                      "with handle %llu\n", llu(root_dirdata_handle)); 
    367         s_used_handles[1] = root_dirdata_handle; 
     315        PVFS_handle_copy(s_used_handles[1], root_dirdata_handle); 
    368316 
    369317        key.buffer = DIRECTORY_ENTRY_KEYSTR; 
    370318        key.buffer_sz = DIRECTORY_ENTRY_KEYLEN; 
    371         val.buffer = &root_dirdata_handle; 
     319        PVFS_handle_copy(*(PVFS_handle*)val.buffer, root_dirdata_handle); 
    372320        val.buffer_sz = sizeof(TROVE_handle); 
    373321 
     
    398346          lost+found directory as well 
    399347        *****************************************************/ 
    400         cur_extent.first = cur_extent.last = TROVE_HANDLE_NULL; 
    401         if (meta_handle_ranges) 
    402         { 
    403             get_handle_extent_from_ranges( 
    404                 meta_handle_ranges, &cur_extent, s_used_handles, 2); 
    405  
    406             if ((cur_extent.first == TROVE_HANDLE_NULL) && 
    407                 (cur_extent.last == TROVE_HANDLE_NULL)) 
    408             { 
    409                 gossip_err("No valid meta handle ranges available! " 
    410                            "Using a default\n"); 
    411             } 
    412             else 
    413             { 
    414                 mkspace_print( 
    415                     verbose, "info: using meta handle range %llu-%llu for " 
    416                     "lost+found directory dspace\n", llu(cur_extent.first), 
    417                     llu(cur_extent.last)); 
    418             } 
    419         } 
    420         extent_array.extent_count = 1; 
    421         extent_array.extent_array = &cur_extent; 
    422  
    423348        ret = trove_dspace_create( 
    424             coll_id, &extent_array, &lost_and_found_handle, 
    425             PVFS_TYPE_DIRECTORY, NULL, TROVE_SYNC, NULL, 
    426             trove_context, &op_id, NULL); 
     349            coll_id, &lost_and_found_handle, PVFS_TYPE_DIRECTORY, NULL,  
     350            TROVE_SYNC, NULL, trove_context, &op_id, NULL); 
    427351 
    428352        while (ret == 0) 
     
    442366        mkspace_print(verbose,"info: created lost+found directory " 
    443367                      "with handle %llu.\n", llu(lost_and_found_handle)); 
    444         s_used_handles[2] = lost_and_found_handle; 
     368        PVFS_handle_copy(s_used_handles[2], lost_and_found_handle); 
    445369 
    446370        /* set lost+found directory dspace attributes */ 
     
    472396 
    473397        /* create a dataspace to hold directory entries */ 
    474         cur_extent.first = cur_extent.last = TROVE_HANDLE_NULL; 
    475         if (meta_handle_ranges) 
    476         { 
    477             get_handle_extent_from_ranges( 
    478                 meta_handle_ranges, &cur_extent, s_used_handles, 3); 
    479  
    480             if ((cur_extent.first == TROVE_HANDLE_NULL) && 
    481                 (cur_extent.last == TROVE_HANDLE_NULL)) 
    482             { 
    483                 gossip_err("No valid meta handle ranges available! " 
    484                            "Using a default\n"); 
    485             } 
    486             else 
    487             { 
    488                 mkspace_print( 
    489                     verbose, "info: using meta handle range %llu-%llu for " 
    490                     "lost+found dirent dspace\n", llu(cur_extent.first), 
    491                     llu(cur_extent.last)); 
    492             } 
    493         } 
    494         extent_array.extent_count = 1; 
    495         extent_array.extent_array = &cur_extent; 
    496  
    497398        ret = trove_dspace_create( 
    498             coll_id, &extent_array, &lost_and_found_dirdata_handle, 
    499             PVFS_TYPE_DIRDATA, NULL, TROVE_SYNC, NULL, 
    500             trove_context, &op_id, NULL); 
     399            coll_id, &lost_and_found_dirdata_handle, PVFS_TYPE_DIRDATA, NULL,  
     400            TROVE_SYNC, NULL, trove_context, &op_id, NULL); 
    501401 
    502402        while (ret == 0) 
     
    516416            verbose, "info: created dspace for dirents " 
    517417            "with handle %llu\n", llu(lost_and_found_dirdata_handle)); 
    518         s_used_handles[3] = lost_and_found_dirdata_handle; 
     418        PVFS_handle_copy(s_used_handles[3], lost_and_found_dirdata_handle); 
    519419 
    520420        key.buffer = DIRECTORY_ENTRY_KEYSTR; 
    521421        key.buffer_sz = DIRECTORY_ENTRY_KEYLEN; 
    522         val.buffer = &lost_and_found_dirdata_handle; 
     422        PVFS_handle_copy(*(PVFS_handle *)val.buffer, 
     423                         lost_and_found_dirdata_handle); 
    523424        val.buffer_sz = sizeof(TROVE_handle); 
    524425 
     
    552453        key.buffer = lost_and_found_string; 
    553454        key.buffer_sz = strlen(lost_and_found_string) + 1; 
    554         val.buffer = &lost_and_found_handle; 
     455        PVFS_handle_copy(*(PVFS_handle *)val.buffer, lost_and_found_handle); 
    555456        val.buffer_sz = sizeof(TROVE_handle); 
    556457 
  • branches/orange-next/src/common/misc/mmap-ra-cache.c

    r6268 r8935  
    261261{ 
    262262    unsigned long tmp = 0; 
     263    unsigned long h_hash = 0; 
    263264    PVFS_object_ref *refn = (PVFS_object_ref *)key; 
    264265 
    265     tmp += ((refn->handle << 2) | (refn->fs_id)); 
     266    /* FIX: clean this up to be a reasonable hash */ 
     267    PVFS_handle_to_hash(refn->handle, &h_hash); 
     268    tmp += ((h_hash) | (refn->fs_id)); 
    266269    tmp = (tmp % table_size); 
    267270 
  • branches/orange-next/src/common/misc/pint-cached-config.c

    r8934 r8935  
    7171 
    7272static int cache_server_array(PVFS_fs_id fsid); 
    73 static int handle_lookup_entry_compare(const void *p1, const void *p2); 
    74 static const struct handle_lookup_entry* find_handle_lookup_entry( 
    75     PVFS_handle handle, PVFS_fs_id fsid); 
    76 static int load_handle_lookup_table( 
    77     struct config_fs_cache_s *cur_config_fs_cache); 
    7873 
    7974static int meta_randomized = 0; 
     
    243238{ 
    244239    struct config_fs_cache_s *cur_config_fs_cache = NULL; 
    245     int ret; 
    246240 
    247241    if (fs) 
     
    253247 
    254248        cur_config_fs_cache->fs = (struct filesystem_configuration_s *)fs; 
    255  
    256         cur_config_fs_cache->meta_server_cursor = 
    257             cur_config_fs_cache->fs->meta_handle_ranges; 
    258         cur_config_fs_cache->data_server_cursor = 
    259             cur_config_fs_cache->fs->data_handle_ranges; 
    260  
    261         /* populate table used to speed up mapping of handle values  
    262          * to servers 
    263          */  
    264         ret = load_handle_lookup_table(cur_config_fs_cache);  
    265         if(ret < 0) 
    266         { 
    267             free(cur_config_fs_cache); 
    268             gossip_err("Error: failed to load handle lookup table.\n"); 
    269             return(ret); 
    270         } 
    271  
    272         qhash_add(PINT_fsid_config_cache_table, 
    273                   &(cur_config_fs_cache->fs->coll_id), 
    274                   &(cur_config_fs_cache->hash_link)); 
    275     } 
    276  
     249    } 
    277250    return 0; 
    278251} 
     
    10441017    PVFS_fs_id fs_id) 
    10451018{ 
    1046     const struct handle_lookup_entry* tmp_entry; 
    1047  
    1048     tmp_entry = find_handle_lookup_entry(handle, fs_id); 
    1049  
    1050     if(!tmp_entry) 
    1051     { 
    1052         gossip_err("Error: failed to find handle %llu in fs configuration.\n", 
    1053             llu(handle)); 
    1054         return(-PVFS_EINVAL); 
    1055     } 
    1056  
    1057     *server_addr = tmp_entry->server_addr; 
     1019 
     1020    /* FIX: this will need to integrate with the new handle->server mapping 
     1021     * mechanism */ 
    10581022    return(0); 
    10591023} 
     
    11981162    struct qlist_head *hash_link = NULL; 
    11991163    struct config_fs_cache_s *cur_config_cache = NULL; 
    1200     struct host_handle_mapping_s *server_mapping = NULL; 
    12011164 
    12021165    *handle_count = 0; 
     
    12141177        assert(cur_config_cache->fs); 
    12151178 
    1216         server_mapping = PINT_cached_config_find_server( 
    1217             cur_config_cache->fs->meta_handle_ranges, server_addr_str); 
    1218         if(server_mapping) 
    1219         { 
    1220             *handle_count += PINT_extent_array_count_total( 
    1221                 &server_mapping->handle_extent_array); 
    1222         } 
    1223  
    1224         server_mapping = PINT_cached_config_find_server( 
    1225             cur_config_cache->fs->data_handle_ranges, server_addr_str); 
    1226         if(server_mapping) 
    1227         { 
    1228             *handle_count += PINT_extent_array_count_total( 
    1229                 &server_mapping->handle_extent_array); 
    1230         } 
     1179        /* FIX: what do we count when we don't have extents? */ 
    12311180    } 
    12321181    return 0; 
     
    12461195    PVFS_fs_id fsid) 
    12471196{ 
    1248     const struct handle_lookup_entry* tmp_entry; 
    1249  
    1250     tmp_entry = find_handle_lookup_entry(handle, fsid); 
    1251  
    1252     if(!tmp_entry) 
    1253     { 
    1254         gossip_err("Error: failed to find handle %llu in fs configuration.\n", 
    1255             llu(handle)); 
    1256         return(-PVFS_EINVAL); 
    1257     } 
    1258  
    1259     strncpy(server_name, tmp_entry->server_name, max_server_name_len); 
     1197    /* FIX: book keeping that will be written can answer this question */ 
    12601198    return(0); 
    12611199} 
     
    12871225            assert(cur_config_cache->fs); 
    12881226 
    1289             *fh_root = (PVFS_handle)cur_config_cache->fs->root_handle; 
     1227            PVFS_handle_copy(*fh_root, cur_config_cache->fs->root_handle); 
    12901228            ret = 0; 
    12911229        } 
     
    16091547} 
    16101548 
    1611 /* handle_lookup_entry_compare() 
    1612  *  * 
    1613  *   * comparison function used by qsort() 
    1614  *    */ 
    1615 static int handle_lookup_entry_compare(const void *p1, const void *p2) 
    1616 { 
    1617     const struct handle_lookup_entry* e1  = p1; 
    1618     const struct handle_lookup_entry* e2  = p2; 
    1619  
    1620     if(e1->extent.first < e2->extent.first) 
    1621         return(-1); 
    1622     if(e1->extent.first > e2->extent.first) 
    1623         return(1); 
    1624  
    1625     return(0); 
    1626 } 
    1627  
    1628 /* find_handle_lookup_entry() 
    1629  * 
    1630  * searches sorted table for extent that contains the specified handle 
    1631  * 
    1632  * returns pointer to table entry on success, NULL on failure 
    1633  */ 
    1634 static const struct handle_lookup_entry* find_handle_lookup_entry( 
    1635     PVFS_handle handle, PVFS_fs_id fsid) 
    1636 { 
    1637     struct qlist_head *hash_link = NULL; 
    1638     struct config_fs_cache_s *cur_config_cache = NULL; 
    1639     int high, low, mid; 
    1640     int table_index; 
    1641  
    1642     assert(PINT_fsid_config_cache_table); 
    1643  
    1644     hash_link = qhash_search(PINT_fsid_config_cache_table,&(fsid)); 
    1645     if(!hash_link) 
    1646     { 
    1647         return(NULL); 
    1648     } 
    1649  
    1650     cur_config_cache = qlist_entry( 
    1651         hash_link, struct config_fs_cache_s, hash_link); 
    1652  
    1653     assert(cur_config_cache); 
    1654     assert(cur_config_cache->fs); 
    1655  
    1656     /* iterative binary search through handle lookup table to find the  
    1657      * extent that this handle falls into  
    1658      */ 
    1659     low = 0; 
    1660     high = cur_config_cache->handle_lookup_table_size; 
    1661     while (low < high)  
    1662     { 
    1663         mid = (low + high)/2; 
    1664         if (cur_config_cache->handle_lookup_table[mid].extent.first < handle) 
    1665             low = mid + 1;  
    1666         else 
    1667             high = mid; 
    1668     } 
    1669     if ((low < cur_config_cache->handle_lookup_table_size) &&  
    1670         (cur_config_cache->handle_lookup_table[low].extent.first == handle)) 
    1671     { 
    1672         /* we happened to locate the first handle in a range */ 
    1673         table_index = low; 
    1674     } 
    1675     else 
    1676     { 
    1677         /* this handle must fall into the previous range if any */ 
    1678         table_index = low-1; 
    1679     } 
    1680  
    1681     /* confirm match */ 
    1682     if(PINT_handle_in_extent( 
    1683         &cur_config_cache->handle_lookup_table[table_index].extent, 
    1684         handle)) 
    1685     { 
    1686         return(&cur_config_cache->handle_lookup_table[table_index]); 
    1687     } 
    1688  
    1689     /* no match */ 
    1690     return(NULL); 
    1691 } 
    1692  
    1693 /* load_handle_lookup_table() 
    1694  * 
    1695  * iterates through extents for all servers and constructs a table sorted by 
    1696  * the first handle in each extent.  This table can then be searched with a 
    1697  * binary algorithm to map handles to servers.  Table includes extent, 
    1698  * server name, and server's resolved bmi address. 
    1699  * 
    1700  * returns 0 on success, -PVFS_error on failure 
    1701  */ 
    1702 static int load_handle_lookup_table( 
    1703     struct config_fs_cache_s *cur_config_fs_cache) 
    1704 { 
    1705     int ret = -PVFS_EINVAL; 
    1706     host_handle_mapping_s *cur_mapping = NULL; 
    1707     int count = 0; 
    1708     int table_offset = 0; 
    1709     PINT_llist* server_cursor; 
    1710     int i; 
    1711     int j; 
    1712     PINT_llist* range_list[2] =  
    1713     { 
    1714         cur_config_fs_cache->fs->meta_handle_ranges, 
    1715         cur_config_fs_cache->fs->data_handle_ranges 
    1716     }; 
    1717  
    1718     /* count total number of extents */ 
    1719     /* loop through both meta and data ranges */ 
    1720     for(j=0; j<2; j++) 
    1721     { 
    1722         server_cursor = range_list[j]; 
    1723         cur_mapping = PINT_llist_head(server_cursor); 
    1724         while(cur_mapping) 
    1725         { 
    1726             /* each server may have multiple extents */ 
    1727             for(i=0; i<cur_mapping->handle_extent_array.extent_count; i++) 
    1728             { 
    1729                 count += 1; 
    1730             } 
    1731             server_cursor = PINT_llist_next(server_cursor); 
    1732             cur_mapping = PINT_llist_head(server_cursor); 
    1733         } 
    1734     } 
    1735  
    1736     /* allocate a table to hold all extents for faster searching */ 
    1737     if(cur_config_fs_cache->handle_lookup_table) 
    1738     { 
    1739         free(cur_config_fs_cache->handle_lookup_table); 
    1740     } 
    1741     cur_config_fs_cache->handle_lookup_table =  
    1742         malloc(sizeof(*cur_config_fs_cache->handle_lookup_table) * count); 
    1743     if(!cur_config_fs_cache->handle_lookup_table) 
    1744     { 
    1745         return(-PVFS_ENOMEM); 
    1746     } 
    1747     cur_config_fs_cache->handle_lookup_table_size = count; 
    1748  
    1749     /* populate table */ 
    1750     /* loop through both meta and data ranges */ 
    1751     for(j=0; j<2; j++) 
    1752     { 
    1753         server_cursor = range_list[j]; 
    1754         cur_mapping = PINT_llist_head(server_cursor); 
    1755         while(cur_mapping) 
    1756         { 
    1757             for(i=0; i<cur_mapping->handle_extent_array.extent_count; i++) 
    1758             { 
    1759                 cur_config_fs_cache->handle_lookup_table[table_offset].extent  
    1760                     = cur_mapping->handle_extent_array.extent_array[i]; 
    1761                 cur_config_fs_cache->handle_lookup_table[table_offset].server_name 
    1762                     = cur_mapping->alias_mapping->bmi_address; 
    1763                 ret = BMI_addr_lookup( 
    1764                     &cur_config_fs_cache->handle_lookup_table[table_offset].server_addr,                  
    1765                     cur_config_fs_cache->handle_lookup_table[table_offset].server_name); 
    1766                 if(ret < 0) 
    1767                 { 
    1768                     free(cur_config_fs_cache->handle_lookup_table); 
    1769                     gossip_err("Error: failed to resolve address of server: %s\n", 
    1770                         cur_config_fs_cache->handle_lookup_table[table_offset].server_name); 
    1771                     return(ret); 
    1772                 } 
    1773                 table_offset++; 
    1774             } 
    1775             server_cursor = PINT_llist_next(server_cursor); 
    1776             cur_mapping = PINT_llist_head(server_cursor); 
    1777         } 
    1778     } 
    1779  
    1780     /* sort table */ 
    1781     qsort(cur_config_fs_cache->handle_lookup_table, table_offset,  
    1782         sizeof(*cur_config_fs_cache->handle_lookup_table), 
    1783         handle_lookup_entry_compare); 
    1784  
    1785     return(0); 
    1786 } 
    1787  
    17881549/* PINT_cached_config_server_names() 
    17891550 * 
  • branches/orange-next/src/common/misc/server-config.c

    r8934 r8935  
    127127/* internal helper functions */ 
    128128static int is_valid_alias(PINT_llist * host_aliases, char *str); 
    129 static int is_valid_handle_range_description(char *h_range); 
    130129static void free_host_handle_mapping(void *ptr); 
    131130static void free_host_alias(void *ptr); 
     
    153152    char *alias, 
    154153    int *index); 
    155 static struct host_handle_mapping_s *get_or_add_handle_mapping( 
    156     PINT_llist *list, 
    157     char *alias); 
    158 static int build_extent_array( 
    159     char *handle_range_str, 
    160     PVFS_handle_extent_array *handle_extent_array); 
    161154 
    162155#ifdef __PVFS2_TROVE_SUPPORT__ 
     
    27012694DOTCONF_CB(get_range_list) 
    27022695{ 
    2703     int i = 0, is_new_handle_mapping = 0; 
     2696    int i = 0; 
    27042697    struct filesystem_configuration_s *fs_conf = NULL; 
    2705     struct host_handle_mapping_s *handle_mapping = NULL; 
    2706     PINT_llist **handle_range_list = NULL; 
    27072698    struct server_configuration_s *config_s =  
    27082699        (struct server_configuration_s *)cmd->context; 
    27092700 
    27102701    fs_conf = (struct filesystem_configuration_s *) 
    2711         PINT_llist_head(config_s->file_systems); 
     2702    PINT_llist_head(config_s->file_systems); 
    27122703    assert(fs_conf); 
    2713  
    2714     handle_range_list = ((config_s->configuration_context == 
    2715                           CTX_METAHANDLERANGES) ? 
    2716                          &fs_conf->meta_handle_ranges : 
    2717                          &fs_conf->data_handle_ranges); 
    2718  
    2719     if (*handle_range_list == NULL) 
    2720     { 
    2721         *handle_range_list = PINT_llist_new(); 
    2722     } 
    27232704 
    27242705    for(i = 0; i < cmd->arg_count; i += 2) 
     
    27292710            assert(cmd->data.list[i]); 
    27302711 
    2731             if (is_valid_handle_range_description(cmd->data.list[i])) 
    2732             { 
    2733                 handle_mapping = get_or_add_handle_mapping( 
    2734                     *handle_range_list, cmd->data.list[i-1]); 
    2735                 if (!handle_mapping) 
    2736                 { 
    2737                     return("Error: Alias allocation failed; " 
    2738                                "aborting alias handle range addition!\n"); 
    2739                 } 
    2740  
    2741                 if (!handle_mapping->alias_mapping) 
    2742                 { 
    2743                     is_new_handle_mapping = 1; 
    2744                     handle_mapping->alias_mapping = 
    2745                         find_host_alias_ptr_by_alias( 
    2746                             config_s, cmd->data.list[i-1], NULL); 
    2747                 } 
    2748  
    2749                 assert(handle_mapping->alias_mapping == 
    2750                        find_host_alias_ptr_by_alias( 
    2751                            config_s, cmd->data.list[i-1], NULL)); 
    2752  
    2753                 if (!handle_mapping->handle_range && 
    2754                     !handle_mapping->handle_extent_array.extent_array) 
    2755                 { 
    2756                     handle_mapping->handle_range = 
    2757                         strdup(cmd->data.list[i]); 
    2758  
    2759                     /* build the extent array, based on range */ 
    2760                     build_extent_array( 
    2761                         handle_mapping->handle_range, 
    2762                         &handle_mapping->handle_extent_array); 
    2763                 } 
    2764                 else 
    2765                 { 
    2766                     char *new_handle_range = PINT_merge_handle_range_strs( 
    2767                         handle_mapping->handle_range, cmd->data.list[i]); 
    2768                     free(handle_mapping->handle_range); 
    2769                     handle_mapping->handle_range = new_handle_range; 
    2770  
    2771                     /* re-build the extent array, based on range */ 
    2772                     free(handle_mapping->handle_extent_array.extent_array); 
    2773                     build_extent_array(handle_mapping->handle_range, 
    2774                                        &handle_mapping->handle_extent_array); 
    2775                 } 
    2776  
    2777                 if (is_new_handle_mapping) 
    2778                 { 
    2779                     PINT_llist_add_to_tail(*handle_range_list, 
    2780                                       (void *)handle_mapping); 
    2781                 } 
    2782             } 
    2783             else 
    2784             { 
    2785                 return("Error in handle range description.\n"); 
    2786             } 
    27872712        } 
    27882713        else 
     
    31653090} 
    31663091 
    3167 static int is_valid_handle_range_description(char *h_range) 
    3168 { 
    3169     int ret = 0; 
    3170     int len = 0; 
    3171     char *ptr = (char *)0; 
    3172     char *end = (char *)0; 
    3173  
    3174     if (h_range) 
    3175     { 
    3176         len = strlen(h_range); 
    3177         end = (h_range + len); 
    3178  
    3179         for(ptr = h_range; ptr < end; ptr++) 
    3180         { 
    3181             if (!isdigit((int)*ptr) && (*ptr != ',') && 
    3182                 (*ptr != ' ') && (*ptr != '-')) 
    3183             { 
    3184                 break; 
    3185             } 
    3186         } 
    3187         if (ptr == end) 
    3188         { 
    3189             ret = 1; 
    3190         } 
    3191     } 
    3192     return ret; 
    3193 } 
    3194  
    31953092static int is_populated_filesystem_configuration( 
    31963093    struct filesystem_configuration_s *fs) 
     
    34013298    struct filesystem_configuration_s *src_fs) 
    34023299{ 
    3403     PINT_llist *cur = NULL; 
    3404     struct host_handle_mapping_s *cur_h_mapping = NULL; 
    3405     struct host_handle_mapping_s *new_h_mapping = NULL; 
    3406  
    34073300    if (dest_fs && src_fs) 
    34083301    { 
     
    34173310        dest_fs->encoding = src_fs->encoding; 
    34183311 
    3419         dest_fs->meta_handle_ranges = PINT_llist_new(); 
    3420         dest_fs->data_handle_ranges = PINT_llist_new(); 
    3421  
    34223312        if(src_fs->secret_key) 
    34233313        { 
    34243314            dest_fs->secret_key = strdup(src_fs->secret_key); 
    3425         } 
    3426  
    3427         assert(dest_fs->meta_handle_ranges); 
    3428         assert(dest_fs->data_handle_ranges); 
    3429  
    3430         /* copy all meta handle ranges */ 
    3431         cur = src_fs->meta_handle_ranges; 
    3432         while(cur) 
    3433         { 
    3434             cur_h_mapping = PINT_llist_head(cur); 
    3435             if (!cur_h_mapping) 
    3436             { 
    3437                 break; 
    3438             } 
    3439  
    3440             new_h_mapping = (struct host_handle_mapping_s *) 
    3441                 malloc(sizeof(struct host_handle_mapping_s)); 
    3442             assert(new_h_mapping); 
    3443  
    3444             /* these are pointers into another struct with a different 
    3445              * lifetime, do not copy */ 
    3446             new_h_mapping->alias_mapping = cur_h_mapping->alias_mapping; 
    3447  
    3448             new_h_mapping->handle_range = 
    3449                 strdup(cur_h_mapping->handle_range); 
    3450             assert(new_h_mapping->handle_range); 
    3451  
    3452             build_extent_array(new_h_mapping->handle_range, 
    3453                                &new_h_mapping->handle_extent_array); 
    3454  
    3455             PINT_llist_add_to_tail( 
    3456                 dest_fs->meta_handle_ranges, new_h_mapping); 
    3457  
    3458             cur = PINT_llist_next(cur); 
    3459         } 
    3460  
    3461         /* copy all data handle ranges */ 
    3462         cur = src_fs->data_handle_ranges; 
    3463         while(cur) 
    3464         { 
    3465             cur_h_mapping = PINT_llist_head(cur); 
    3466             if (!cur_h_mapping) 
    3467             { 
    3468                 break; 
    3469             } 
    3470  
    3471             new_h_mapping = (struct host_handle_mapping_s *) 
    3472                 malloc(sizeof(struct host_handle_mapping_s)); 
    3473             assert(new_h_mapping); 
    3474  
    3475             new_h_mapping->alias_mapping = cur_h_mapping->alias_mapping; 
    3476  
    3477             new_h_mapping->handle_range = 
    3478                 strdup(cur_h_mapping->handle_range); 
    3479             assert(new_h_mapping->handle_range); 
    3480  
    3481             build_extent_array(new_h_mapping->handle_range, 
    3482                                &new_h_mapping->handle_extent_array); 
    3483  
    3484             PINT_llist_add_to_tail( 
    3485                 dest_fs->data_handle_ranges, new_h_mapping); 
    3486  
    3487             cur = PINT_llist_next(cur); 
    34883315        } 
    34893316 
     
    36033430    if(index) *index = ind - 1; 
    36043431    return ret; 
    3605 } 
    3606  
    3607 static struct host_handle_mapping_s *get_or_add_handle_mapping( 
    3608     PINT_llist *list, 
    3609     char *alias) 
    3610 { 
    3611     PINT_llist *cur = list; 
    3612     struct host_handle_mapping_s *ret = NULL; 
    3613     struct host_handle_mapping_s *handle_mapping = NULL; 
    3614  
    3615     while(cur) 
    3616     { 
    3617         handle_mapping = PINT_llist_head(cur); 
    3618         if (!handle_mapping) 
    3619         { 
    3620             break; 
    3621         } 
    3622         assert(handle_mapping->alias_mapping); 
    3623         assert(handle_mapping->alias_mapping->host_alias); 
    3624         assert(handle_mapping->handle_range); 
    3625  
    3626         if (strcmp(handle_mapping->alias_mapping->host_alias, 
    3627                    alias) == 0) 
    3628         { 
    3629             ret = handle_mapping; 
    3630             break; 
    3631         } 
    3632         cur = PINT_llist_next(cur); 
    3633     } 
    3634  
    3635     if (!ret) 
    3636     { 
    3637         ret = (host_handle_mapping_s *) 
    3638             malloc(sizeof(struct host_handle_mapping_s)); 
    3639         if (ret) 
    3640         { 
    3641             memset(ret,0,sizeof(struct host_handle_mapping_s)); 
    3642         } 
    3643     } 
    3644     return ret; 
    3645 } 
    3646  
    3647 static int build_extent_array( 
    3648     char *handle_range_str, 
    3649     PVFS_handle_extent_array *handle_extent_array) 
    3650 { 
    3651     int i = 0, status = 0, num_extents = 0; 
    3652     PVFS_handle_extent cur_extent; 
    3653  
    3654     if (handle_range_str && handle_extent_array) 
    3655     { 
    3656         /* first pass, find out how many extents there are total */ 
    3657         while(PINT_parse_handle_ranges(handle_range_str, 
    3658                                        &cur_extent, &status)) 
    3659         { 
    3660             num_extents++; 
    3661         } 
    3662  
    3663         if (num_extents) 
    3664         { 
    3665             handle_extent_array->extent_count = num_extents; 
    3666             handle_extent_array->extent_array = (PVFS_handle_extent *) 
    3667                 malloc(num_extents * sizeof(PVFS_handle_extent)); 
    3668             if (!handle_extent_array->extent_array) 
    3669             { 
    3670                 gossip_err("Error: failed to alloc %d extents\n", 
    3671                            handle_extent_array->extent_count); 
    3672                 return -1; 
    3673             } 
    3674             memset(handle_extent_array->extent_array,0, 
    3675                    (num_extents * sizeof(PVFS_handle_extent))); 
    3676  
    3677             /* reset opaque handle parsing state for next iteration */ 
    3678             status = 0; 
    3679  
    3680             /* second pass, fill in the extent array */ 
    3681             while(PINT_parse_handle_ranges(handle_range_str, 
    3682                                            &cur_extent, &status)) 
    3683             { 
    3684                 handle_extent_array->extent_array[i] = cur_extent; 
    3685                 i++; 
    3686             } 
    3687         } 
    3688     } 
    3689     return 0; 
    36903432} 
    36913433 
  • branches/orange-next/src/io/job/job.c

    r8934 r8935  
    30153015 */ 
    30163016int job_trove_dspace_create(PVFS_fs_id coll_id, 
    3017                             PVFS_handle_extent_array *handle_extent_array, 
    30183017                            PVFS_ds_type type, 
    30193018                            void *hint, 
     
    30563055#ifdef __PVFS2_TROVE_SUPPORT__ 
    30573056    ret = trove_dspace_create(coll_id, 
    3058                               handle_extent_array, 
    30593057                              &(jd->u.trove.handle), 
    30603058                              type, 
     
    31053103 */ 
    31063104int job_trove_dspace_create_list(PVFS_fs_id coll_id, 
    3107                             PVFS_handle_extent_array *handle_extent_array, 
    31083105                            PVFS_handle* out_handle_array, 
    31093106                            int count, 
     
    31453142#ifdef __PVFS2_TROVE_SUPPORT__ 
    31463143    ret = trove_dspace_create_list(coll_id, 
    3147                               handle_extent_array, 
    31483144                              out_handle_array, 
    31493145                              count, 
  • branches/orange-next/src/io/job/job.h

    r8933 r8935  
    512512/* create a new data space object */ 
    513513int job_trove_dspace_create(PVFS_fs_id coll_id, 
    514                             PVFS_handle_extent_array *handle_extent_array, 
    515514                            PVFS_ds_type type, 
    516515                            void *hint, 
     
    525524/* create a set of new data space objects */ 
    526525int job_trove_dspace_create_list(PVFS_fs_id coll_id, 
    527                             PVFS_handle_extent_array *handle_extent_array, 
    528526                            PVFS_handle* out_handle_arry, 
    529527                            int count, 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf-dspace.c

    r8933 r8935  
    109109 
    110110static int dbpf_dspace_create(TROVE_coll_id coll_id, 
    111                               TROVE_handle_extent_array *extent_array, 
    112111                              TROVE_handle *handle_p, 
    113112                              TROVE_ds_type type, 
     
    137136    if( handle_p == NULL ) 
    138137    { 
    139         TROVE_handle_clear(handle); 
     138        return -TROVE_EINVAL; 
    140139    } 
    141140    else 
     
    161160    } 
    162161 
    163     if (!extent_array || (extent_array->extent_count < 1)) 
    164     { 
    165         return -TROVE_EINVAL; 
    166     } 
    167  
    168162    event_type = trove_dbpf_dspace_create_event_id; 
    169163    DBPF_EVENT_START(coll_p, q_op_p, event_type, &event_id, 
     
    173167                     PINT_HINT_GET_OP_ID(hints)); 
    174168 
    175     /* this array is freed in dbpf-op.c:dbpf_queued_op_free, or 
    176      * in dbpf_queue_or_service in the case of immediate completion */ 
    177     op_p->u.d_create.extent_array.extent_count = 
    178         extent_array->extent_count; 
    179     op_p->u.d_create.extent_array.extent_array = 
    180         malloc(extent_array->extent_count * sizeof(TROVE_extent)); 
    181169    op_p->hints = hints; 
    182  
    183     if (op_p->u.d_create.extent_array.extent_array == NULL) 
    184     { 
    185         return -TROVE_ENOMEM; 
    186     } 
    187  
    188     memcpy(op_p->u.d_create.extent_array.extent_array, 
    189            extent_array->extent_array, 
    190            extent_array->extent_count * sizeof(TROVE_extent)); 
    191  
    192170    op_p->u.d_create.out_handle_p = handle_p; 
    193171    op_p->u.d_create.type = type; 
     
    216194    if ( TROVE_handle_is_null(new_handle) ) 
    217195    { 
    218         gossip_err("%s: handle allocator returned a zero handle.\n", __func__); 
     196        gossip_err("%s: handle allocator returned a null handle.\n", __func__); 
    219197        return(-TROVE_ENOSPC); 
    220198    } 
     
    237215/* FIX: remove extent array */ 
    238216static int dbpf_dspace_create_list(TROVE_coll_id coll_id, 
    239                               TROVE_handle_extent_array *extent_array, 
    240217                              TROVE_handle *handle_array_p, 
    241218                              int count, 
     
    288265    } 
    289266 
    290     if (!extent_array || (extent_array->extent_count < 1)) 
    291     { 
    292         return -TROVE_EINVAL; 
    293     } 
    294  
    295267    event_type = trove_dbpf_dspace_create_event_id; 
    296268    DBPF_EVENT_START(coll_p, q_op_p, event_type, &event_id, 
     
    299271                     PINT_HINT_GET_RANK(hints), 
    300272                     PINT_HINT_GET_OP_ID(hints)); 
    301  
    302     /* this array is freed in dbpf-op.c:dbpf_queued_op_free, or 
    303      * in dbpf_queue_or_service in the case of immediate completion */ 
    304     op_p->u.d_create_list.extent_array.extent_count = 
    305         extent_array->extent_count; 
    306     op_p->u.d_create_list.extent_array.extent_array = 
    307         malloc(extent_array->extent_count * sizeof(TROVE_extent)); 
    308  
    309     if (op_p->u.d_create_list.extent_array.extent_array == NULL) 
    310     { 
    311         return -TROVE_ENOMEM; 
    312     } 
    313  
    314     memcpy(op_p->u.d_create_list.extent_array.extent_array, 
    315            extent_array->extent_array, 
    316            extent_array->extent_count * sizeof(TROVE_extent)); 
    317273 
    318274    op_p->u.d_create_list.out_handle_array_p = handle_array_p; 
  • branches/orange-next/src/io/trove/trove-handle-mgmt/module.mk.in

    r8929 r8935  
    11DIR := src/io/trove/trove-handle-mgmt 
    22SERVERSRC +=  
    3 #SERVERSRC += \ 
     3SERVERSRC += \ 
     4        $(DIR)/trove-handle-mgmt.c 
    45#       $(DIR)/avltree.c \ 
    56#       $(DIR)/trove-extentlist.c \ 
    67#       $(DIR)/trove-ledger.c \ 
    7 #       $(DIR)/trove-handle-mgmt.c 
  • branches/orange-next/src/io/trove/trove-handle-mgmt/trove-handle-mgmt.c

    r8934 r8935  
    1313#include "trove.h" 
    1414#include "quickhash.h" 
    15 #include "trove-ledger.h" 
    1615#include "trove-handle-mgmt.h" 
    1716#include "gossip.h" 
     
    3938//static int hash_fsid_compare(void *key, struct qlist_head *link); 
    4039// 
    41 //static gen_mutex_t trove_handle_mutex = GEN_MUTEX_INITIALIZER; 
     40static gen_mutex_t trove_handle_mutex = GEN_MUTEX_INITIALIZER; 
    4241// 
    4342///* trove_check_handle_ranges: 
     
    471470int trove_handle_mgmt_finalize() 
    472471{ 
    473     int i; 
    474  
    475472    gen_mutex_lock(&trove_handle_mutex); 
    476473 
     
    480477    return 0; 
    481478} 
    482 // 
    483 ///* 
    484 // * Local variables: 
    485 // *  c-indent-level: 4 
    486 // *  c-basic-offset: 4 
    487 // * End: 
    488 // * 
    489 // * vim: ts=8 sts=4 sw=4 expandtab 
    490 // */ 
     479 
     480/* 
     481 * Local variables: 
     482 *  c-indent-level: 4 
     483 *  c-basic-offset: 4 
     484 * End: 
     485 * 
     486 * vim: ts=8 sts=4 sw=4 expandtab 
     487 */ 
  • branches/orange-next/src/io/trove/trove-handle-mgmt/trove-handle-mgmt.h

    r8934 r8935  
    1 ///* 
    2 // * (C) 2001 Clemson University and The University of Chicago 
    3 // * 
    4 // * See COPYING in top-level directory. 
    5 // */ 
    6 // 
    7 //#ifndef __TROVE_HANDLE_MGMT_H 
    8 //#define __TROVE_HANDLE_MGMT_H 
    9 // 
    10 //#define MAX_NUM_VERIFY_HANDLE_COUNT        4096 
    11 // 
    12 //#define TROVE_DEFAULT_HANDLE_PURGATORY_SEC 360 
    13 // 
     1/* 
     2 * (C) 2001 Clemson University and The University of Chicago 
     3 * 
     4 * See COPYING in top-level directory. 
     5 */ 
     6 
     7#ifndef __TROVE_HANDLE_MGMT_H 
     8#define __TROVE_HANDLE_MGMT_H 
     9 
     10#define MAX_NUM_VERIFY_HANDLE_COUNT        4096 
     11 
     12#define TROVE_DEFAULT_HANDLE_PURGATORY_SEC 360 
     13 
    1414/* 
    1515 # public methods.  all methods return -1 on error; 0 on success unless 
     
    7777//    uint64_t *free_count); 
    7878// 
    79 //#endif /* __TROVE_HANDLE_MGMT_H */ 
    80 // 
    81 ///* 
    82 // * Local variables: 
    83 // *  c-indent-level: 4 
    84 // *  c-basic-offset: 4 
    85 // * End: 
    86 // * 
    87 // * vim: ts=8 sts=4 sw=4 expandtab 
    88 // */ 
     79#endif /* __TROVE_HANDLE_MGMT_H */ 
     80 
     81/* 
     82 * Local variables: 
     83 *  c-indent-level: 4 
     84 *  c-basic-offset: 4 
     85 * End: 
     86 * 
     87 * vim: ts=8 sts=4 sw=4 expandtab 
     88 */ 
  • branches/orange-next/src/io/trove/trove-internal.h

    r8934 r8935  
    257257    int (*dspace_create)( 
    258258                         TROVE_coll_id coll_id, 
    259                          TROVE_handle_extent_array *extent_array, 
    260259                         TROVE_handle *handle, 
    261260                         TROVE_ds_type type, 
     
    269268     int (*dspace_create_list)( 
    270269                         TROVE_coll_id coll_id, 
    271                          TROVE_handle_extent_array *extent_array, 
    272270                         TROVE_handle *handle_array, 
    273271                         int count, 
  • branches/orange-next/src/io/trove/trove.c

    r8934 r8935  
    752752int trove_dspace_create_list( 
    753753    TROVE_coll_id coll_id, 
    754     TROVE_handle_extent_array* handle_extent_array, 
    755754    TROVE_handle* out_handle_array, 
    756755    int count, 
     
    773772    return dspace_method_table[method_id]->dspace_create_list( 
    774773           coll_id, 
    775            handle_extent_array, 
    776774           out_handle_array, 
    777775           count, 
     
    789787int trove_dspace_create( 
    790788    TROVE_coll_id coll_id, 
    791     TROVE_handle_extent_array* handle_extent_array, 
    792789    TROVE_handle* out_handle, 
    793790    TROVE_ds_type type, 
     
    809806    return dspace_method_table[method_id]->dspace_create( 
    810807           coll_id, 
    811            handle_extent_array, 
    812808           out_handle, 
    813809           type, 
  • branches/orange-next/src/io/trove/trove.h

    r8934 r8935  
    388388 
    389389int trove_dspace_create(TROVE_coll_id coll_id, 
    390                         TROVE_handle_extent_array *handle_extent_array, 
    391390                        TROVE_handle *out_handle, 
    392391                        TROVE_ds_type type, 
     
    396395                        TROVE_context_id context_id, 
    397396                        TROVE_op_id *out_op_id_p, 
    398             PVFS_hint hints); 
     397                        PVFS_hint hints); 
    399398 
    400399int trove_dspace_create_list(TROVE_coll_id coll_id, 
    401                         TROVE_handle_extent_array *handle_extent_array, 
    402400                        TROVE_handle *out_handle_array, 
    403401                        int count, 
  • branches/orange-next/src/proto/pvfs2-req-proto.h

    r8933 r8935  
    331331  (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle)) 
    332332 
     333/* FIX: what to do about copying handle array ?*/ 
    333334#define PINT_SERVREQ_BATCH_REMOVE_FILL(__req,        \ 
    334335                                       __creds,      \ 
     
    358359    PVFS_fs_id, fs_id); 
    359360 
    360 #define PINT_SERVREQ_MGMT_REMOVE_OBJECT_FILL(__req,   \ 
    361                                              __creds, \ 
    362                                              __fsid,  \ 
    363                                              __handle,\ 
    364                                              __hints) \ 
    365 do {                                                  \ 
    366     memset(&(__req), 0, sizeof(__req));               \ 
    367     (__req).op = PVFS_SERV_MGMT_REMOVE_OBJECT;        \ 
    368     (__req).hints = (__hints);                        \ 
    369     (__req).credentials = (__creds);                  \ 
    370     (__req).u.mgmt_remove_object.fs_id = (__fsid);    \ 
    371     (__req).u.mgmt_remove_object.handle = (__handle); \ 
     361#define PINT_SERVREQ_MGMT_REMOVE_OBJECT_FILL(__req,                     \ 
     362                                             __creds,                   \ 
     363                                             __fsid,                    \ 
     364                                             __handle,                  \ 
     365                                             __hints)                   \ 
     366do {                                                                    \ 
     367    memset(&(__req), 0, sizeof(__req));                                 \ 
     368    (__req).op = PVFS_SERV_MGMT_REMOVE_OBJECT;                          \ 
     369    (__req).hints = (__hints);                                          \ 
     370    (__req).credentials = (__creds);                                    \ 
     371    (__req).u.mgmt_remove_object.fs_id = (__fsid);                      \ 
     372    PVFS_handle_copy((__req).u.mgmt_remove_object.handle, (__handle)); \ 
    372373} while (0) 
    373374 
     
    390391  roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1) 
    391392 
    392 #define PINT_SERVREQ_MGMT_REMOVE_DIRENT_FILL(__req,   \ 
    393                                              __creds, \ 
    394                                              __fsid,  \ 
    395                                              __handle,\ 
    396                                              __entry, \ 
    397                                              __hints) \ 
    398 do {                                                  \ 
    399     memset(&(__req), 0, sizeof(__req));               \ 
    400     (__req).op = PVFS_SERV_MGMT_REMOVE_DIRENT;        \ 
    401     (__req).hints = (__hints);                        \ 
    402     (__req).credentials = (__creds);                  \ 
    403     (__req).u.mgmt_remove_dirent.fs_id = (__fsid);    \ 
    404     (__req).u.mgmt_remove_dirent.handle = (__handle); \ 
    405     (__req).u.mgmt_remove_dirent.entry = (__entry);   \ 
     393#define PINT_SERVREQ_MGMT_REMOVE_DIRENT_FILL(__req,                     \ 
     394                                             __creds,                   \ 
     395                                             __fsid,                    \ 
     396                                             __handle,                  \ 
     397                                             __entry,                   \ 
     398                                             __hints)                   \ 
     399do {                                                                    \ 
     400    memset(&(__req), 0, sizeof(__req));                                 \ 
     401    (__req).op = PVFS_SERV_MGMT_REMOVE_DIRENT;                          \ 
     402    (__req).hints = (__hints);                                          \ 
     403    (__req).credentials = (__creds);                                    \ 
     404    (__req).u.mgmt_remove_dirent.fs_id = (__fsid);                      \ 
     405    PVFS_handle_copy((__req).u.mgmt_remove_dirent.handle, (__handle)); \ 
     406    (__req).u.mgmt_remove_dirent.entry = (__entry);                     \ 
    406407} while (0) 
    407408 
     
    420421  (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle)) 
    421422 
    422 #define PINT_SERVREQ_TREE_REMOVE_FILL(__req,                                  \ 
     423/* FIX: what to do about copying handle array ?*/ 
     424#define PINT_SERVREQ_TREE_REMOVE_FILL(__req,                             \ 
    423425                                 __creds,                                \ 
    424426                                 __fsid,                                 \ 
     
    453455#define extra_size_PVFS_servreq_tree_get_file_size \ 
    454456  (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle)) 
    455  
    456 #define PINT_SERVREQ_TREE_GET_FILE_SIZE_FILL(__req,                                \ 
    457                                  __creds,                                          \ 
    458                                  __fsid,                                           \ 
    459                                  __caller_handle_index,                            \ 
    460                                  __num_data_files,                                 \ 
    461                                  __handle_array,                                   \ 
    462                                  __retry_msgpair_at_leaf,                          \ 
    463                                  __hints)                                          \ 
    464 do {                                                                               \ 
    465     memset(&(__req), 0, sizeof(__req));                                            \ 
    466     (__req).op = PVFS_SERV_TREE_GET_FILE_SIZE;                                     \ 
    467     (__req).hints = (__hints);                                                     \ 
    468     (__req).credentials = (__creds);                                               \ 
    469     (__req).u.tree_get_file_size.fs_id = (__fsid);                                 \ 
    470     (__req).u.tree_get_file_size.caller_handle_index = (__caller_handle_index);    \ 
    471     (__req).u.tree_get_file_size.num_data_files = (__num_data_files);              \ 
    472     (__req).u.tree_get_file_size.handle_array = (__handle_array);                  \ 
    473     (__req).u.tree_get_file_size.retry_msgpair_at_leaf = (__retry_msgpair_at_leaf);\ 
     457/* FIX: what to do about copying handle array ?*/ 
     458#define PINT_SERVREQ_TREE_GET_FILE_SIZE_FILL(__req,       \ 
     459                                 __creds,                 \ 
     460                                 __fsid,                  \ 
     461                                 __caller_handle_index,   \ 
     462                                 __num_data_files,        \ 
     463                                 __handle_array,          \ 
     464                                 __retry_msgpair_at_leaf, \ 
     465                                 __hints)                 \ 
     466do {                                                      \ 
     467    memset(&(__req), 0, sizeof(__req));                                        \ 
     468    (__req).op = PVFS_SERV_TREE_GET_FILE_SIZE;                                 \ 
     469    (__req).hints = (__hints);                                                 \ 
     470    (__req).credentials = (__creds);                                           \ 
     471    (__req).u.tree_get_file_size.fs_id = (__fsid);                             \ 
     472    (__req).u.tree_get_file_size.caller_handle_index = (__caller_handle_index);\ 
     473    (__req).u.tree_get_file_size.num_data_files = (__num_data_files);          \ 
     474    (__req).u.tree_get_file_size.handle_array = (__handle_array);              \ 
     475    (__req).u.tree_get_file_size.retry_msgpair_at_leaf =                       \ 
     476        (__retry_msgpair_at_leaf);                                             \ 
    474477} while (0) 
    475478 
     
    503506    PVFS_fs_id, fs_id); 
    504507 
    505 #define PINT_SERVREQ_MGMT_GET_DIRDATA_HANDLE_FILL(__req,   \ 
    506                                                   __creds, \ 
    507                                                   __fsid,  \ 
    508                                                   __handle,\ 
    509                                                   __hints) \ 
    510 do {                                                       \ 
    511     memset(&(__req), 0, sizeof(__req));                    \ 
    512     (__req).op = PVFS_SERV_MGMT_GET_DIRDATA_HANDLE;        \ 
    513     (__req).credentials = (__creds);                       \ 
    514     (__req).hints = (__hints);                             \ 
    515     (__req).u.mgmt_get_dirdata_handle.fs_id = (__fsid);    \ 
    516     (__req).u.mgmt_get_dirdata_handle.handle = (__handle); \ 
     508#define PINT_SERVREQ_MGMT_GET_DIRDATA_HANDLE_FILL(__req,                    \ 
     509                                                  __creds,                  \ 
     510                                                  __fsid,                   \ 
     511                                                  __handle,                 \ 
     512                                                  __hints)                  \ 
     513do {                                                                        \ 
     514    memset(&(__req), 0, sizeof(__req));                                     \ 
     515    (__req).op = PVFS_SERV_MGMT_GET_DIRDATA_HANDLE;                         \ 
     516    (__req).credentials = (__creds);                                        \ 
     517    (__req).hints = (__hints);                                              \ 
     518    (__req).u.mgmt_get_dirdata_handle.fs_id = (__fsid);                     \ 
     519    PVFS_handle_copy((__req).u.mgmt_get_dirdata_handle.handle, (__handle)); \ 
    517520} while (0) 
    518521 
     
    539542    int32_t, flags); 
    540543 
    541 #define PINT_SERVREQ_FLUSH_FILL(__req,   \ 
    542                                 __creds, \ 
    543                                 __fsid,  \ 
    544                                 __handle,\ 
    545                                 __hints )\ 
    546 do {                                     \ 
    547     memset(&(__req), 0, sizeof(__req));  \ 
    548     (__req).op = PVFS_SERV_FLUSH;        \ 
    549     (__req).credentials = (__creds);     \ 
    550     (__req).hints = (__hints);           \ 
    551     (__req).u.flush.fs_id = (__fsid);    \ 
    552     (__req).u.flush.handle = (__handle); \ 
     544#define PINT_SERVREQ_FLUSH_FILL(__req,                      \ 
     545                                __creds,                    \ 
     546                                __fsid,                     \ 
     547                                __handle,                   \ 
     548                                __hints )                   \ 
     549do {                                                        \ 
     550    memset(&(__req), 0, sizeof(__req));                     \ 
     551    (__req).op = PVFS_SERV_FLUSH;                           \ 
     552    (__req).credentials = (__creds);                        \ 
     553    (__req).hints = (__hints);                              \ 
     554    (__req).u.flush.fs_id = (__fsid);                       \ 
     555    PVFS_handle_copy((__req).u.flush.handle, (__handle));  \ 
    553556} while (0) 
    554557 
     
    610613    uint32_t, attrmask); 
    611614 
    612 #define PINT_SERVREQ_UNSTUFF_FILL(__req,           \ 
    613                                   __creds,         \ 
    614                                   __fsid,          \ 
    615                                   __handle,        \ 
    616                                   __amask)         \ 
    617 do {                                               \ 
    618     memset(&(__req), 0, sizeof(__req));            \ 
    619     (__req).op = PVFS_SERV_UNSTUFF;                \ 
    620     (__req).credentials = (__creds);               \ 
    621     (__req).u.unstuff.fs_id = (__fsid);            \ 
    622     (__req).u.unstuff.handle = (__handle);        \ 
    623     (__req).u.unstuff.attrmask = (__amask);        \ 
     615#define PINT_SERVREQ_UNSTUFF_FILL(__req,                    \ 
     616                                  __creds,                  \ 
     617                                  __fsid,                   \ 
     618                                  __handle,                 \ 
     619                                  __amask)                  \ 
     620do {                                                        \ 
     621    memset(&(__req), 0, sizeof(__req));                     \ 
     622    (__req).op = PVFS_SERV_UNSTUFF;                         \ 
     623    (__req).credentials = (__creds);                        \ 
     624    (__req).u.unstuff.fs_id = (__fsid);                     \ 
     625    PVFS_handle_copy((__req).u.unstuff.handle, (__handle)); \ 
     626    (__req).u.unstuff.attrmask = (__amask);                 \ 
    624627} while (0) 
    625628 
     
    655658    extra_size_PVFS_object_attr 
    656659 
    657 #define PINT_SERVREQ_SETATTR_FILL(__req,         \ 
    658                                   __creds,       \ 
    659                                   __fsid,        \ 
    660                                   __handle,      \ 
    661                                   __objtype,     \ 
    662                                   __attr,        \ 
    663                                   __extra_amask, \ 
    664                                   __hints)       \ 
    665 do {                                             \ 
    666     memset(&(__req), 0, sizeof(__req));          \ 
    667     (__req).op = PVFS_SERV_SETATTR;              \ 
    668     (__req).credentials = (__creds);             \ 
    669     (__req).hints = (__hints);                   \ 
    670     (__req).u.setattr.fs_id = (__fsid);          \ 
    671     (__req).u.setattr.handle = (__handle);       \ 
    672     (__attr).objtype = (__objtype);              \ 
    673     (__attr).mask |= PVFS_ATTR_SYS_TYPE;         \ 
    674     PINT_CONVERT_ATTR(&(__req).u.setattr.attr, &(__attr), __extra_amask);\ 
     660#define PINT_SERVREQ_SETATTR_FILL(__req,                                    \ 
     661                                  __creds,                                  \ 
     662                                  __fsid,                                   \ 
     663                                  __handle,                                 \ 
     664                                  __objtype,                                \ 
     665                                  __attr,                                   \ 
     666                                  __extra_amask,                            \ 
     667                                  __hints)                                  \ 
     668do {                                                                        \ 
     669    memset(&(__req), 0, sizeof(__req));                                     \ 
     670    (__req).op = PVFS_SERV_SETATTR;                                         \ 
     671    (__req).credentials = (__creds);                                        \ 
     672    (__req).hints = (__hints);                                              \ 
     673    (__req).u.setattr.fs_id = (__fsid);                                     \ 
     674    PVFS_handle_copy((__req).u.setattr.handle, (__handle));                 \ 
     675    (__attr).objtype = (__objtype);                                         \ 
     676    (__attr).mask |= PVFS_ATTR_SYS_TYPE;                                    \ 
     677    PINT_CONVERT_ATTR(&(__req).u.setattr.attr, &(__attr), __extra_amask);   \ 
    675678} while (0) 
    676679 
     
    696699  roundup8(PVFS_REQ_LIMIT_PATH_NAME_BYTES + 1) 
    697700 
    698 #define PINT_SERVREQ_LOOKUP_PATH_FILL(__req,           \ 
    699                                       __creds,         \ 
    700                                       __path,          \ 
    701                                       __fsid,          \ 
    702                                       __handle,        \ 
    703                                       __amask,         \ 
    704                                       __hints)         \ 
    705 do {                                                   \ 
    706     memset(&(__req), 0, sizeof(__req));                \ 
    707     (__req).op = PVFS_SERV_LOOKUP_PATH;                \ 
    708     (__req).credentials = (__creds);                   \ 
    709     (__req).hints = (__hints);                         \ 
    710     (__req).u.lookup_path.path = (__path);             \ 
    711     (__req).u.lookup_path.fs_id = (__fsid);            \ 
    712     (__req).u.lookup_path.handle = (__handle);\ 
    713     (__req).u.lookup_path.attrmask = (__amask);        \ 
     701#define PINT_SERVREQ_LOOKUP_PATH_FILL(__req,                    \ 
     702                                      __creds,                  \ 
     703                                      __path,                   \ 
     704                                      __fsid,                   \ 
     705                                      __handle,                 \ 
     706                                      __amask,                  \ 
     707                                      __hints)                  \ 
     708do {                                                            \ 
     709    memset(&(__req), 0, sizeof(__req));                         \ 
     710    (__req).op = PVFS_SERV_LOOKUP_PATH;                         \ 
     711    (__req).credentials = (__creds);                            \ 
     712    (__req).hints = (__hints);                                  \ 
     713    (__req).u.lookup_path.path = (__path);                      \ 
     714    (__req).u.lookup_path.fs_id = (__fsid);                     \ 
     715    PVFS_handle_copy((__req).u.lookup_path.handle, (__handle)); \ 
     716    (__req).u.lookup_path.attrmask = (__amask);                 \ 
    714717} while (0) 
    715718 
     
    809812  roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1) 
    810813 
    811 #define PINT_SERVREQ_CRDIRENT_FILL(__req,           \ 
    812                                    __creds,         \ 
    813                                    __name,          \ 
    814                                    __new_handle,    \ 
    815                                    __handle,        \ 
    816                                    __fs_id,         \ 
    817                                    __hints)         \ 
    818 do {                                                \ 
    819     memset(&(__req), 0, sizeof(__req));             \ 
    820     (__req).op = PVFS_SERV_CRDIRENT;                \ 
    821     (__req).credentials = (__creds);                \ 
    822     (__req).hints = (__hints);                      \ 
    823     (__req).u.crdirent.name = (__name);             \ 
    824     (__req).u.crdirent.new_handle = (__new_handle); \ 
    825     (__req).u.crdirent.handle =                     \ 
    826        (__handle);                                  \ 
    827     (__req).u.crdirent.fs_id = (__fs_id);           \ 
     814#define PINT_SERVREQ_CRDIRENT_FILL(__req,                               \ 
     815                                   __creds,                             \ 
     816                                   __name,                              \ 
     817                                   __new_handle,                        \ 
     818                                   __handle,                            \ 
     819                                   __fs_id,                             \ 
     820                                   __hints)                             \ 
     821do {                                                                    \ 
     822    memset(&(__req), 0, sizeof(__req));                                 \ 
     823    (__req).op = PVFS_SERV_CRDIRENT;                                    \ 
     824    (__req).credentials = (__creds);                                    \ 
     825    (__req).hints = (__hints);                                          \ 
     826    (__req).u.crdirent.name = (__name);                                 \ 
     827    PVFS_handle_copy((__req).u.crdirent.new_handle, (__new_handle));    \ 
     828    PVFS_handle_copy((__req).u.crdirent.handle,(__handle));             \ 
     829    (__req).u.crdirent.fs_id = (__fs_id);                               \ 
    828830} while (0) 
    829831 
     
    845847  roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1) 
    846848 
    847 #define PINT_SERVREQ_RMDIRENT_FILL(__req,         \ 
    848                                    __creds,       \ 
    849                                    __fsid,        \ 
    850                                    __handle,      \ 
    851                                    __entry,       \ 
    852                                    __hints)       \ 
    853 do {                                              \ 
    854     memset(&(__req), 0, sizeof(__req));           \ 
    855     (__req).op = PVFS_SERV_RMDIRENT;              \ 
    856     (__req).credentials = (__creds);              \ 
    857     (__req).hints = (__hints);                    \ 
    858     (__req).u.rmdirent.fs_id = (__fsid);          \ 
    859     (__req).u.rmdirent.handle = (__handle);       \ 
    860     (__req).u.rmdirent.entry = (__entry);         \ 
     849#define PINT_SERVREQ_RMDIRENT_FILL(__req,                       \ 
     850                                   __creds,                     \ 
     851                                   __fsid,                      \ 
     852                                   __handle,                    \ 
     853                                   __entry,                     \ 
     854                                   __hints)                     \ 
     855do {                                                            \ 
     856    memset(&(__req), 0, sizeof(__req));                         \ 
     857    (__req).op = PVFS_SERV_RMDIRENT;                            \ 
     858    (__req).credentials = (__creds);                            \ 
     859    (__req).hints = (__hints);                                  \ 
     860    (__req).u.rmdirent.fs_id = (__fsid);                        \ 
     861    PVFS_handle_copy((__req).u.rmdirent.handle, (__handle));    \ 
     862    (__req).u.rmdirent.entry = (__entry);                       \ 
    861863} while (0); 
    862864 
     
    888890  roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1) 
    889891 
    890 #define PINT_SERVREQ_CHDIRENT_FILL(__req,          \ 
    891                                    __creds,        \ 
    892                                    __fsid,         \ 
    893                                    __handle,       \ 
    894                                    __new_dirent,   \ 
    895                                    __entry,        \ 
    896                                    __hints)        \ 
    897 do {                                               \ 
    898     memset(&(__req), 0, sizeof(__req));            \ 
    899     (__req).op = PVFS_SERV_CHDIRENT;               \ 
    900     (__req).credentials = (__creds);               \ 
    901     (__req).hints = (__hints);                     \ 
    902     (__req).u.chdirent.fs_id = (__fsid);           \ 
    903     (__req).u.chdirent.handle =                    \ 
    904         (__handle);                                \ 
    905     (__req).u.chdirent.new_dirent_handle =         \ 
    906         (__new_dirent);                            \ 
    907     (__req).u.chdirent.entry = (__entry);          \ 
     892#define PINT_SERVREQ_CHDIRENT_FILL(__req,                                   \ 
     893                                   __creds,                                 \ 
     894                                   __fsid,                                  \ 
     895                                   __handle,                                \ 
     896                                   __new_dirent,                            \ 
     897                                   __entry,                                 \ 
     898                                   __hints)                                 \ 
     899do {                                                                        \ 
     900    memset(&(__req), 0, sizeof(__req));                                     \ 
     901    (__req).op = PVFS_SERV_CHDIRENT;                                        \ 
     902    (__req).credentials = (__creds);                                        \ 
     903    (__req).hints = (__hints);                                              \ 
     904    (__req).u.chdirent.fs_id = (__fsid);                                    \ 
     905    PVFS_handle_copy((__req).u.chdirent.handle, (__handle));                \ 
     906    PVFS_handle_copy((__req).u.chdirent.new_dirent_handle, (__new_dirent)); \ 
     907    (__req).u.chdirent.entry = (__entry);                                   \ 
    908908} while (0); 
    909909 
     
    935935    uint32_t, token_flag); 
    936936 
    937 #define PINT_SERVREQ_READDIR_FILL(__req,              \ 
    938                                   __creds,            \ 
    939                                   __fsid,             \ 
    940                                   __handle,           \ 
    941                                   __token,            \ 
    942                                   __token_flag,       \ 
    943                                   __dirent_count,     \ 
    944                                   __hints)            \ 
    945 do {                                                  \ 
    946     memset(&(__req), 0, sizeof(__req));               \ 
    947     (__req).op = PVFS_SERV_READDIR;                   \ 
    948     (__req).credentials = (__creds);                  \ 
    949     (__req).hints = (__hints);                        \ 
    950     (__req).u.readdir.fs_id = (__fsid);               \ 
    951     (__req).u.readdir.handle = (__handle);            \ 
    952     memcpy( &(__req).u.readdir.token). &(__token),    \ 
    953             sizeof(PVFS_kv_position);                 \ 
    954     (__req).u.readdir.token_flag = (__token_flag);    \ 
    955     (__req).u.readdir.dirent_count = (__dirent_count);\ 
     937#define PINT_SERVREQ_READDIR_FILL(__req,                    \ 
     938                                  __creds,                  \ 
     939                                  __fsid,                   \ 
     940                                  __handle,                 \ 
     941                                  __token,                  \ 
     942                                  __token_flag,             \ 
     943                                  __dirent_count,           \ 
     944                                  __hints)                  \ 
     945do {                                                        \ 
     946    memset(&(__req), 0, sizeof(__req));                     \ 
     947    (__req).op = PVFS_SERV_READDIR;                         \ 
     948    (__req).credentials = (__creds);                        \ 
     949    (__req).hints = (__hints);                              \ 
     950    (__req).u.readdir.fs_id = (__fsid);                     \ 
     951    PVFS_handle_copy((__req).u.readdir.handle, (__handle)); \ 
     952    memcpy( &((__req).u.readdir.token), &__token,           \ 
     953            sizeof(PVFS_kv_position));                      \ 
     954    (__req).u.readdir.token_flag = (__token_flag);          \ 
     955    (__req).u.readdir.dirent_count = (__dirent_count);      \ 
    956956} while (0); 
    957957 
     
    11281128    PVFS_size, size, 
    11291129    int32_t, flags); 
    1130 #define PINT_SERVREQ_TRUNCATE_FILL(__req,  \ 
    1131                                 __creds,   \ 
    1132                                 __fsid,    \ 
    1133                                 __size,    \ 
    1134                                 __handle,  \ 
    1135                                 __hints)   \ 
    1136 do {                                       \ 
    1137     memset(&(__req), 0, sizeof(__req));    \ 
    1138     (__req).op = PVFS_SERV_TRUNCATE;       \ 
    1139     (__req).credentials = (__creds);       \ 
    1140     (__req).hints = (__hints);             \ 
    1141     (__req).u.truncate.fs_id = (__fsid);   \ 
    1142     (__req).u.truncate.size = (__size);    \ 
    1143     (__req).u.truncate.handle = (__handle);\ 
     1130#define PINT_SERVREQ_TRUNCATE_FILL(__req,                       \ 
     1131                                __creds,                        \ 
     1132                                __fsid,                         \ 
     1133                                __size,                         \ 
     1134                                __handle,                       \ 
     1135                                __hints)                        \ 
     1136do {                                                            \ 
     1137    memset(&(__req), 0, sizeof(__req));                         \ 
     1138    (__req).op = PVFS_SERV_TRUNCATE;                            \ 
     1139    (__req).credentials = (__creds);                            \ 
     1140    (__req).hints = (__hints);                                  \ 
     1141    (__req).u.truncate.fs_id = (__fsid);                        \ 
     1142    (__req).u.truncate.size = (__size);                         \ 
     1143    PVFS_handle_copy((__req).u.truncate.handle, (__handle));    \ 
    11441144} while (0) 
    11451145 
     
    13791379    (__req).hints                             = (__hints);               \ 
    13801380    (__req).u.small_io.fs_id                  = (__fsid);                \ 
    1381     (__req).u.small_io.handle                 = (__handle);              \ 
     1381    PVFS_handle_copy((__req).u.small_io.handle, (__handle));             \ 
    13821382    (__req).u.small_io.io_type                = (__io_type);             \ 
    13831383    (__req).u.small_io.server_nr              = (__dfile_nr);            \ 
     
    14601460#define extra_size_PVFS_servreq_listattr \ 
    14611461    (PVFS_REQ_LIMIT_LISTATTR * sizeof(PVFS_handle)) 
    1462  
     1462/* FIX: how to handle array copying? */ 
    14631463#define PINT_SERVREQ_LISTATTR_FILL(__req,   \ 
    14641464                                  __creds, \ 
     
    17641764     * PVFS_REQ_LIMIT_EATTR_LIST)) 
    17651765 
    1766 #define PINT_SERVREQ_GETEATTR_FILL(__req,   \ 
    1767                                   __creds, \ 
    1768                                   __fsid,  \ 
    1769                                   __handle,\ 
    1770                                   __nkey,\ 
    1771                                   __key_array, \ 
    1772                                   __size_array,\ 
    1773                                   __hints) \ 
    1774 do {                                       \ 
    1775     memset(&(__req), 0, sizeof(__req));    \ 
    1776     (__req).op = PVFS_SERV_GETEATTR;       \ 
    1777     (__req).credentials = (__creds);       \ 
    1778     (__req).hints = (__hints);             \ 
    1779     (__req).u.geteattr.fs_id = (__fsid);   \ 
    1780     (__req).u.geteattr.handle = (__handle);\ 
    1781     (__req).u.geteattr.nkey = (__nkey);    \ 
    1782     (__req).u.geteattr.key = (__key_array);\ 
    1783     (__req).u.geteattr.valsz = (__size_array);\ 
     1766#define PINT_SERVREQ_GETEATTR_FILL(__req,                       \ 
     1767                                  __creds,                      \ 
     1768                                  __fsid,                       \ 
     1769                                  __handle,                     \ 
     1770                                  __nkey,                       \ 
     1771                                  __key_array,                  \ 
     1772                                  __size_array,                 \ 
     1773                                  __hints)                      \ 
     1774do {                                                            \ 
     1775    memset(&(__req), 0, sizeof(__req));                         \ 
     1776    (__req).op = PVFS_SERV_GETEATTR;                            \ 
     1777    (__req).credentials = (__creds);                            \ 
     1778    (__req).hints = (__hints);                                  \ 
     1779    (__req).u.geteattr.fs_id = (__fsid);                        \ 
     1780    PVFS_handle_copy((__req).u.geteattr.handle, (__handle));    \ 
     1781    (__req).u.geteattr.nkey = (__nkey);                         \ 
     1782    (__req).u.geteattr.key = (__key_array);                     \ 
     1783    (__req).u.geteattr.valsz = (__size_array);                  \ 
    17841784} while (0) 
    17851785 
     
    18251825        * PVFS_REQ_LIMIT_EATTR_LIST) 
    18261826 
    1827 #define PINT_SERVREQ_SETEATTR_FILL(__req,   \ 
    1828                                   __creds,       \ 
    1829                                   __fsid,        \ 
    1830                                   __handle,      \ 
    1831                                   __flags,       \ 
    1832                                   __nkey,        \ 
    1833                                   __key_array,   \ 
    1834                                   __val_array,   \ 
    1835                                   __hints)       \ 
    1836 do {                                             \ 
    1837     memset(&(__req), 0, sizeof(__req));          \ 
    1838     (__req).op = PVFS_SERV_SETEATTR;        \ 
    1839     (__req).credentials = (__creds);        \ 
    1840     (__req).hints = (__hints);              \ 
    1841     (__req).u.seteattr.fs_id = (__fsid);    \ 
    1842     (__req).u.seteattr.handle = (__handle); \ 
    1843     (__req).u.seteattr.flags = (__flags);   \ 
    1844     (__req).u.seteattr.nkey = (__nkey);     \ 
    1845     (__req).u.seteattr.key = (__key_array); \ 
    1846     (__req).u.seteattr.val = (__val_array); \ 
     1827#define PINT_SERVREQ_SETEATTR_FILL(__req,                       \ 
     1828                                  __creds,                      \ 
     1829                                  __fsid,                       \ 
     1830                                  __handle,                     \ 
     1831                                  __flags,                      \ 
     1832                                  __nkey,                       \ 
     1833                                  __key_array,                  \ 
     1834                                  __val_array,                  \ 
     1835                                  __hints)                      \ 
     1836do {                                                            \ 
     1837    memset(&(__req), 0, sizeof(__req));                         \ 
     1838    (__req).op = PVFS_SERV_SETEATTR;                            \ 
     1839    (__req).credentials = (__creds);                            \ 
     1840    (__req).hints = (__hints);                                  \ 
     1841    (__req).u.seteattr.fs_id = (__fsid);                        \ 
     1842    PVFS_handle_copy((__req).u.seteattr.handle, (__handle));    \ 
     1843    (__req).u.seteattr.flags = (__flags);                       \ 
     1844    (__req).u.seteattr.nkey = (__nkey);                         \ 
     1845    (__req).u.seteattr.key = (__key_array);                     \ 
     1846    (__req).u.seteattr.val = (__val_array);                     \ 
    18471847} while (0) 
    18481848 
     
    18641864    PVFS_REQ_LIMIT_EATTR_KEY_LEN  
    18651865 
    1866 #define PINT_SERVREQ_DELEATTR_FILL(__req,   \ 
    1867                                   __creds, \ 
    1868                                   __fsid,  \ 
    1869                                   __handle,\ 
    1870                                   __key,   \ 
    1871                                   __hints) \ 
    1872 do {                                       \ 
    1873     memset(&(__req), 0, sizeof(__req));    \ 
    1874     (__req).op = PVFS_SERV_DELEATTR;        \ 
    1875     (__req).credentials = (__creds);       \ 
    1876     (__req).hints = (__hints);             \ 
    1877     (__req).u.deleattr.fs_id = (__fsid);    \ 
    1878     (__req).u.deleattr.handle = (__handle); \ 
    1879     (__req).u.deleattr.key.buffer_sz = (__key).buffer_sz;\ 
    1880     (__req).u.deleattr.key.buffer = (__key).buffer;\ 
     1866#define PINT_SERVREQ_DELEATTR_FILL(__req,                       \ 
     1867                                  __creds,                      \ 
     1868                                  __fsid,                       \ 
     1869                                  __handle,                     \ 
     1870                                  __key,                        \ 
     1871                                  __hints)                      \ 
     1872do {                                                            \ 
     1873    memset(&(__req), 0, sizeof(__req));                         \ 
     1874    (__req).op = PVFS_SERV_DELEATTR;                            \ 
     1875    (__req).credentials = (__creds);                            \ 
     1876    (__req).hints = (__hints);                                  \ 
     1877    (__req).u.deleattr.fs_id = (__fsid);                        \ 
     1878    PVFS_handle_copy((__req).u.deleattr.handle, (__handle));    \ 
     1879    (__req).u.deleattr.key.buffer_sz = (__key).buffer_sz;       \ 
     1880    (__req).u.deleattr.key.buffer = (__key).buffer;             \ 
    18811881} while (0) 
    18821882 
     
    19051905    (PVFS_REQ_LIMIT_EATTR_LIST * sizeof(PVFS_size)) 
    19061906 
    1907 #define PINT_SERVREQ_LISTEATTR_FILL(__req,            \ 
    1908                                   __creds,            \ 
    1909                                   __fsid,             \ 
    1910                                   __handle,           \ 
    1911                                   __token,            \ 
    1912                                   __token_flag,       \ 
    1913                                   __nkey,             \ 
    1914                                   __size_array,       \ 
    1915                                   __hints)            \ 
    1916 do {                                                  \ 
    1917     memset(&(__req), 0, sizeof(__req));               \ 
    1918     (__req).op = PVFS_SERV_LISTEATTR;                 \ 
    1919     (__req).credentials = (__creds);                  \ 
    1920     (__req).hints = (__hints);                        \ 
    1921     (__req).u.listeattr.fs_id = (__fsid);             \ 
    1922     (__req).u.listeattr.handle = (__handle);          \ 
    1923     memcpy( &(__req).u.listeattr.token, &(__token),   \ 
    1924            sizeof(PVFS_kv_position));                 \ 
    1925     (__req).u.listeattr.token_flag = (__token_flag);  \ 
    1926     (__req).u.listeattr.nkey = (__nkey);              \ 
    1927     (__req).u.listeattr.keysz = (__size_array);       \ 
     1907#define PINT_SERVREQ_LISTEATTR_FILL(__req,                      \ 
     1908                                  __creds,                      \ 
     1909                                  __fsid,                       \ 
     1910                                  __handle,                     \ 
     1911                                  __token,                      \ 
     1912                                  __token_flag,                 \ 
     1913                                  __nkey,                       \ 
     1914                                  __size_array,                 \ 
     1915                                  __hints)                      \ 
     1916do {                                                            \ 
     1917    memset(&(__req), 0, sizeof(__req));                         \ 
     1918    (__req).op = PVFS_SERV_LISTEATTR;                           \ 
     1919    (__req).credentials = (__creds);                            \ 
     1920    (__req).hints = (__hints);                                  \ 
     1921    (__req).u.listeattr.fs_id = (__fsid);                       \ 
     1922    PVFS_handle_copy((__req).u.listeattr.handle, (__handle));   \ 
     1923    memcpy( &(__req).u.listeattr.token, &(__token),             \ 
     1924           sizeof(PVFS_kv_position));                           \ 
     1925    (__req).u.listeattr.token_flag = (__token_flag);            \ 
     1926    (__req).u.listeattr.nkey = (__nkey);                        \ 
     1927    (__req).u.listeattr.keysz = (__size_array);                 \ 
    19281928} while (0); 
    19291929 
  • branches/orange-next/src/server/batch-create.sm

    r7471 r8935  
    8888    ret = job_trove_dspace_create_list( 
    8989        s_op->req->u.batch_create.fs_id, 
    90         &s_op->req->u.batch_create.handle_extent_array, 
    9190        s_op->resp.u.batch_create.handle_array, 
    9291        s_op->req->u.batch_create.object_count, 
  • branches/orange-next/src/server/create-immutable-copies.sm

    r8929 r8935  
    915915   /*create local datahandles - will be used as destination handles for copies*/ 
    916916   ret = job_trove_dspace_create_list( imm_p->fs_id 
    917                                       ,&data_handle_ext_array 
    918917                                      ,imm_p->handle_array_copies_local 
    919918                                      ,imm_p->handle_array_copies_local_count * 
  • branches/orange-next/src/server/create.sm

    r8929 r8935  
    176176    ret = job_trove_dspace_create( 
    177177        s_op->req->u.create.fs_id, 
    178         &meta_handle_ext_array, 
    179178        PVFS_TYPE_METAFILE, 
    180179        NULL, 
     
    384383    ret = job_trove_dspace_create_list( 
    385384        s_op->req->u.create.fs_id, 
    386         &data_handle_ext_array, 
    387385        s_op->u.create.handle_array_local, 
    388386        s_op->u.create.handle_array_local_count, 
  • branches/orange-next/src/server/mkdir.sm

    r8929 r8935  
    121121 
    122122    ret = job_trove_dspace_create( 
    123         s_op->u.mkdir.fs_id, &s_op->u.mkdir.handle_extent_array, 
     123        s_op->u.mkdir.fs_id,  
    124124        PVFS_TYPE_DIRECTORY, NULL, 
    125125        TROVE_SYNC,  
     
    177177    int ret = -PVFS_ENOMEM; 
    178178    job_id_t i; 
    179     PVFS_handle_extent_array extent_array; 
    180     struct server_configuration_s *user_opts = get_server_config_struct(); 
    181179 
    182180    gossip_debug(GOSSIP_MKDIR_DEBUG, " creating dspace on coll_id %d\n", 
    183181                 s_op->u.mkdir.fs_id); 
    184182 
    185     /* find our meta handle range for this create */ 
    186     ret = PINT_config_get_meta_handle_extent_array( 
    187         user_opts, s_op->u.mkdir.fs_id, &extent_array); 
    188     assert(ret == 0); 
    189     assert(extent_array.extent_count > 0); 
    190  
    191     gossip_debug(GOSSIP_MKDIR_DEBUG, " dirdata handle will " 
    192                  "be in starting hrange[0] %llu-%llu\n", 
    193                  llu(extent_array.extent_array[0].first), 
    194                  llu(extent_array.extent_array[0].last)); 
    195  
    196183    ret = job_trove_dspace_create( 
    197         s_op->u.mkdir.fs_id, &extent_array, PVFS_TYPE_DIRDATA, NULL, 
     184        s_op->u.mkdir.fs_id, PVFS_TYPE_DIRDATA, NULL, 
    198185        TROVE_SYNC, 
    199186        smcb, 0, js_p, &i, 
    200187        server_job_context, s_op->req->hints); 
    201  
    202     free(extent_array.extent_array); 
    203     extent_array.extent_array = NULL; 
    204188 
    205189    return ret; 
  • branches/orange-next/src/server/pvfs2-server.c

    r8920 r8935  
    26232623 
    26242624        /* create a trove object for the pool */ 
    2625         ret = job_trove_dspace_create(fsid, &ext_array, PVFS_TYPE_INTERNAL, 
     2625        ret = job_trove_dspace_create(fsid, PVFS_TYPE_INTERNAL, 
    26262626            NULL, TROVE_SYNC, NULL, 0, &js, &job_id, server_job_context, NULL); 
    26272627        while(ret == 0)