Changeset 8933

Show
Ignore:
Timestamp:
07/11/11 14:02:11 (23 months ago)
Author:
mtmoore
Message:

move PVFS_ds_position to different types when appropriate, pass a flag around instead of using special canary values in the handle. Things will be broken for a while.

Location:
branches/orange-next
Files:
28 modified

Legend:

Unmodified
Added
Removed
  • branches/orange-next/include/pvfs2-sysint.h

    r8891 r8933  
    154154struct PVFS_sysresp_readdir_s 
    155155{ 
    156     PVFS_ds_position token; 
     156    PVFS_kv_position token; 
     157    uint32_t token_flag; 
    157158    PVFS_dirent *dirent_array; 
    158     uint32_t pvfs_dirent_outcount; /* uint32_t for portable, fixed size structure */ 
     159    uint32_t pvfs_dirent_outcount; /* uint32_t for portable, fixed size  
     160                                      structure */ 
    159161    uint64_t directory_version; 
    160162}; 
     
    162164 
    163165/** Holds results of a readdirplus operation (position token, directory version 
    164  *  information, array of directory entries, array of stat error codes and array of 
    165  *  attribute information). 
     166 *  information, array of directory entries, array of stat error codes and  
     167 *  array of attribute information). 
    166168 */ 
    167169struct PVFS_sysresp_readdirplus_s 
    168170{ 
    169     PVFS_ds_position token; 
     171    PVFS_kv_position token; 
    170172    PVFS_dirent   *dirent_array; 
    171173    uint32_t        pvfs_dirent_outcount; /**< uint32_t for portable, fixed size structure */ 
     
    330332PVFS_error PVFS_isys_readdir( 
    331333    PVFS_object_ref ref, 
     334    PVFS_kv_position token, 
     335    uint32_t token_flag, 
     336    int32_t pvfs_dirent_incount, 
     337    const PVFS_credentials *credentials, 
     338    PVFS_sysresp_readdir *resp, 
     339    PVFS_sys_op_id *op_id, 
     340    PVFS_hint hints, 
     341    void *user_ptr); 
     342 
     343PVFS_error PVFS_sys_readdir( 
     344    PVFS_object_ref ref, 
    332345    PVFS_ds_position token, 
    333346    int32_t pvfs_dirent_incount, 
    334347    const PVFS_credentials *credentials, 
    335348    PVFS_sysresp_readdir *resp, 
    336     PVFS_sys_op_id *op_id, 
    337     PVFS_hint hints, 
    338     void *user_ptr); 
    339  
    340 PVFS_error PVFS_sys_readdir( 
     349    PVFS_hint hints); 
     350 
     351PVFS_error PVFS_isys_readdirplus( 
    341352    PVFS_object_ref ref, 
    342353    PVFS_ds_position token, 
    343354    int32_t pvfs_dirent_incount, 
    344355    const PVFS_credentials *credentials, 
    345     PVFS_sysresp_readdir *resp, 
    346     PVFS_hint hints); 
    347  
    348 PVFS_error PVFS_isys_readdirplus( 
    349     PVFS_object_ref ref, 
    350     PVFS_ds_position token, 
    351     int32_t pvfs_dirent_incount, 
    352     const PVFS_credentials *credentials, 
    353356    uint32_t attrmask, 
    354357    PVFS_sysresp_readdirplus *resp, 
     
    359362PVFS_error PVFS_sys_readdirplus( 
    360363    PVFS_object_ref ref, 
    361     PVFS_ds_position token, 
     364    PVFS_kv_position token, 
    362365    int32_t pvfs_dirent_incount, 
    363366    const PVFS_credentials *credentials, 
  • branches/orange-next/include/pvfs2-types.h

    r8930 r8933  
    146146 */ 
    147147typedef int32_t PVFS_fs_id; 
    148 typedef uint64_t PVFS_ds_position; 
     148typedef PVFS_handle PVFS_ds_position; 
     149typedef struct { 
     150    uint64_t count; 
     151    uint64_t session; 
     152} PVFS_kv_position; 
     153endecode_fields_2( 
     154    PVFS_kv_position, 
     155    uint64_t, count, 
     156    uint64_t, session); 
     157 
     158typedef uint32_t PVFS_rec_position; 
     159 
    149160typedef int32_t PVFS_ds_flags; 
    150161 
     
    161172#define encode_PVFS_fs_id encode_int32_t 
    162173#define decode_PVFS_fs_id decode_int32_t 
    163 #define decode_PVFS_ds_position decode_uint64_t 
    164 #define encode_PVFS_ds_position encode_uint64_t 
     174#define decode_PVFS_ds_position decode_PVFS_handle 
     175#define encode_PVFS_ds_position encode_PVFS_handle 
     176#define decode_PVFS_rec_position decode_uint32_t 
     177#define encode_PVFS_rec_position encode_uint32_t 
    165178 
    166179/* Basic types used within metadata. */ 
     
    258271#define PVFS_OP_NULL         ((PVFS_id_gen_t)0) 
    259272#define PVFS_BMI_ADDR_NULL ((PVFS_BMI_addr_t)0) 
    260 #define PVFS_ITERATE_START    (INT32_MAX - 1) 
    261 #define PVFS_ITERATE_END      (INT32_MAX - 2) 
     273#define PVFS_ITERATE_START      1 
     274#define PVFS_ITERATE_END        2 
     275#define PVFS_ITERATE_AT_POINT   3 
    262276#define PVFS_READDIR_START PVFS_ITERATE_START 
    263277#define PVFS_READDIR_END   PVFS_ITERATE_END 
  • branches/orange-next/src/apps/admin/pvfs2-showcoll.c

    r8626 r8933  
    257257    TROVE_op_id op_id; 
    258258    TROVE_ds_state state; 
    259  
    260     pos = TROVE_ITERATE_START; 
     259    unsigned int pos_flag; 
     260    
     261    PVFS_handle_clear(pos); 
     262    pos_flag = TROVE_ITERATE_START; 
    261263    count = 64; 
    262264 
     
    266268        ret = trove_dspace_iterate_handles(coll_id, 
    267269                                           &pos, 
     270                                           &pos_flag, 
    268271                                           harray, 
    269272                                           &count, 
  • branches/orange-next/src/client/sysint/client-state-machine.h

    r8891 r8933  
    269269struct PINT_client_readdir_sm 
    270270{ 
    271     PVFS_ds_position pos_token;         /* input parameter */ 
     271    PVFS_kv_position pos_token;         /* input parameter */ 
     272    unsigned int pos_token_flag;        /* input parameter */ 
    272273    int dirent_limit;                   /* input parameter */ 
    273274    PVFS_sysresp_readdir *readdir_resp; /* in/out parameter*/ 
     
    282283struct PINT_client_readdirplus_sm 
    283284{ 
    284     PVFS_ds_position pos_token;         /* input parameter */ 
     285    PVFS_kv_position pos_token;         /* input parameter */ 
     286    unsigned int pos_token_flag;        /* input parameter */ 
    285287    int dirent_limit;                   /* input parameter */ 
    286288    int attrmask;                       /* input parameter */ 
  • branches/orange-next/src/client/sysint/sys-readdir.sm

    r7471 r8933  
    9898PVFS_error PVFS_isys_readdir( 
    9999    PVFS_object_ref ref, 
    100     PVFS_ds_position token,  
     100    PVFS_kv_position token,  
     101    uint32_t token_flag, 
    101102    int32_t pvfs_dirent_incount, 
    102103    const PVFS_credentials *credentials, 
     
    143144    sm_p->object_ref = ref; 
    144145    PVFS_hint_copy(hints, &sm_p->hints); 
    145     PVFS_hint_add(&sm_p->hints, PVFS_HINT_HANDLE_NAME, sizeof(PVFS_handle), &ref.handle); 
     146    PVFS_hint_add(&sm_p->hints, PVFS_HINT_HANDLE_NAME, sizeof(PVFS_handle),  
     147                  &ref.handle); 
    146148 
    147149    /* point the sm dirent array and outcount to the readdir response field */ 
     
    149151    sm_p->readdir.dirent_outcount = &resp->pvfs_dirent_outcount; 
    150152    sm_p->readdir.token = &resp->token; 
     153    sm_p->readdir.token_flag = &resp->token; 
    151154    sm_p->readdir.directory_version = &resp->directory_version; 
    152155 
     
    170173PVFS_error PVFS_sys_readdir( 
    171174    PVFS_object_ref ref, 
    172     PVFS_ds_position token,  
     175    PVFS_kv_position token,  
     176    uint32_t token_flag, 
    173177    int32_t pvfs_dirent_incount, 
    174178    const PVFS_credentials *credentials, 
     
    181185    gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_sys_readdir entered\n"); 
    182186 
    183     ret = PVFS_isys_readdir(ref, token, pvfs_dirent_incount, 
     187    ret = PVFS_isys_readdir(ref, token, token_flag, pvfs_dirent_incount, 
    184188                            credentials, resp, &op_id, hints, NULL); 
    185189    if (ret) 
     
    256260        sm_p->object_ref.handle, 
    257261        sm_p->u.readdir.pos_token, 
     262        sm_p->u.readdir.pos_token_flag, 
    258263        sm_p->u.readdir.dirent_limit, 
    259264        sm_p->hints); 
     
    296301    /* convert servresp_readdir response to a sysresp_readdir obj */ 
    297302 
    298     *(sm_p->readdir.token) = resp_p->u.readdir.token; 
     303    memcpy(&(sm_p->readdir.token), &(resp_p->u.readdir.token), 
     304           sizeof(PVFS_kv_position)); 
    299305    *(sm_p->readdir.directory_version) = 
    300306        resp_p->u.readdir.directory_version; 
    301307    *(sm_p->readdir.dirent_outcount) = 
    302308        resp_p->u.readdir.dirent_count; 
     309    *(sm_p->readdir.token_flag( = resp_p->u.readdir.token_flag; 
     310 
    303311    if (*(sm_p->readdir.dirent_outcount) > 0) 
    304312    { 
  • branches/orange-next/src/io/job/job-desc-queue.h

    r8476 r8933  
    3636    PVFS_error state; 
    3737    PVFS_handle handle; 
    38     PVFS_ds_position position; 
     38    PVFS_ds_position ds_position; 
     39    PVFS_kv_position kv_position; 
     40    unsigned int position_flag; 
    3941    PVFS_ds_attributes attr; 
    4042    PVFS_ds_type type; 
  • branches/orange-next/src/io/job/job.c

    r8932 r8933  
    28192819int job_trove_keyval_iterate_keys(PVFS_fs_id coll_id, 
    28202820                             PVFS_handle handle, 
    2821                              PVFS_ds_position position, 
     2821                             PVFS_kv_position position, 
     2822                             unsigned int position_flag, 
    28222823                             PVFS_ds_keyval * key_array, 
    28232824                             int count, 
     
    28522853    jd->u.trove.vtag = vtag; 
    28532854    jd->u.trove.position = position; 
     2855    jd->u.trove.position_flag = position_flag; 
    28542856    jd->u.trove.count = count; 
    28552857    jd->context_id = context_id; 
     
    29102912int job_trove_dspace_iterate_handles(PVFS_fs_id coll_id, 
    29112913    PVFS_ds_position position, 
     2914    unsigned int position_flag, 
    29122915    PVFS_handle* handle_array, 
    29132916    int count, 
     
    29402943    jd->u.trove.vtag = vtag; 
    29412944    jd->u.trove.position = position; 
     2945    jd->u.trove.position_flag = position_flag; 
    29422946    jd->u.trove.count = count; 
    29432947    jd->context_id = context_id; 
     
    29492953#ifdef __PVFS2_TROVE_SUPPORT__ 
    29502954    ret = trove_dspace_iterate_handles(coll_id, 
    2951                                &(jd->u.trove.position), handle_array, 
    2952                                &(jd->u.trove.count), flags, jd->u.trove.vtag, 
    2953                                user_ptr_internal, 
     2955                               &(jd->u.trove.position),  
     2956                               &(jd->u.trove.position_flag), handle_array,  
     2957                               &(jd->u.trove.count), flags,  
     2958                               jd->u.trove.vtag, user_ptr_internal, 
    29542959                               global_trove_context, &(jd->u.trove.id)); 
    29552960#else 
     
    61316136int job_precreate_pool_iterate_handles( 
    61326137    PVFS_fs_id fsid, 
    6133     PVFS_ds_position position, 
     6138    PVFS_kv_position position, 
     6139    unsigned int position_flag, 
    61346140    PVFS_handle* handle_array, 
    61356141    int count, 
     
    61436149    PVFS_hint hints) 
    61446150{ 
    6145     PVFS_ds_position local_position; 
    6146     PVFS_ds_position pool_index; 
     6151    PVFS_kv_position local_position; 
     6152    unsigned int local_position_flag = position_flag; 
    61476153    struct qlist_head* iterator; 
    61486154    PVFS_ds_position tmp_index = 1; 
     
    61566162 
    61576163    /* low order bits are the trove iterate position */ 
    6158     local_position = position & 0xffffffff; 
     6164    local_position.count = position.count; 
    61596165    /* high order bits tell us which pool we are on */ 
    6160     pool_index = position >> 32; 
     6166    local_position.session = position.session; 
    61616167 
    61626168    /* we start indexing at one and reserve 0 for the special start and end 
    61636169     * values for the entire set of pools 
    61646170     */ 
    6165     if(pool_index == 0) 
     6171    if(local_position.session == 0) 
    61666172    { 
    61676173        /* FIX: position stuff changed to use small int and flag */ 
    6168         if(local_position == PVFS_ITERATE_START) 
     6174        if(local_position_flag == PVFS_ITERATE_START) 
    61696175        { 
    61706176            pool_index = 1; 
     
    61726178        else 
    61736179        { 
    6174             gossip_err("Error: invalid position given to job_precreate_pool_iterate_handles().\n"); 
     6180            gossip_err("Error: invalid position given to " 
     6181                       "job_precreate_pool_iterate_handles().\n"); 
    61756182            out_status_p->error_code = -PVFS_EINVAL; 
    61766183            return(1); 
     
    61896196        out_status_p->error_code = 0; 
    61906197        out_status_p->count = 0; 
    6191         /* FIX: position stuff changed to use small int and flag */ 
    6192         out_status_p->position = PVFS_ITERATE_END; 
     6198        out_status_p->position_flag = PVFS_ITERATE_END; 
    61936199        return(1); 
    61946200    } 
     
    62116217        out_status_p->error_code = 0; 
    62126218        out_status_p->count = 0; 
    6213         /* FIX: position stuff changed to use small int and flag */ 
    6214         out_status_p->position = PVFS_ITERATE_END; 
     6219        out_status_p->position_flag = PVFS_ITERATE_END; 
    62156220        return(1); 
    62166221    } 
    62176222 
    6218     /* FIX: position stuff changed to use small int and flag */ 
    6219     if(local_position == PVFS_ITERATE_END) 
     6223    if(local_position_flag == PVFS_ITERATE_END) 
    62206224    { 
    62216225        /* we got all of the handles out of the pool */ 
     
    62246228        /* skip to next pool */ 
    62256229        pool_index++; 
    6226         out_status_p->position = pool_index << 32; 
    6227         /* FIX: position stuff changed to use small int and flag */ 
    6228         out_status_p->position |= PVFS_ITERATE_START; 
     6230        out_status_p->kv_position.session = pool_index; 
     6231        out_status_p->position_flag = PVFS_ITERATE_START; 
    62296232        out_status_p->count = 1; 
    62306233        out_status_p->error_code = 0; 
     
    62416244        return 1; 
    62426245    } 
    6243     jd->u.precreate_pool.key_array = malloc(count * sizeof(*jd->u.precreate_pool.key_array)); 
     6246    jd->u.precreate_pool.key_array =  
     6247        malloc(count * sizeof(*jd->u.precreate_pool.key_array)); 
    62446248    if(!jd->u.precreate_pool.key_array) 
    62456249    { 
     
    62566260    jd->job_user_ptr = user_ptr; 
    62576261    jd->hints = hints; 
    6258     jd->u.precreate_pool.position = local_position; 
     6262    memcpy(&jd->u.precreate_pool.position, &local_position,  
     6263           sizeof(PVFS_kv_position)); 
     6264    jd->u.precreate_pool.position_flag = local_position_flag; 
    62596265    jd->u.precreate_pool.count = count; 
    62606266    jd->u.precreate_pool.precreate_handle_array = handle_array; 
    6261     jd->u.precreate_pool.pool_index = pool_index; 
    62626267    jd->context_id = context_id; 
    62636268    jd->status_user_tag = status_user_tag; 
     
    62696274    ret = trove_keyval_iterate_keys(fsid, pool->pool_handle, 
    62706275                               &(jd->u.precreate_pool.position),  
     6276                               &(jd->u.precreate_pool.position_flag), 
    62716277                               jd->u.precreate_pool.key_array,  
    62726278                               &(jd->u.precreate_pool.count), flags, NULL, 
     
    62956301        out_status_p->error_code = 0; 
    62966302        out_status_p->status_user_tag = status_user_tag; 
    6297         out_status_p->position = pool_index << 32; 
    6298         out_status_p->position |= jd->u.precreate_pool.position; 
     6303        memcpy(out_status_p->kv_position, jd->u.precreate_pool.position, 
     6304               sizeof(PVFS_kv_position)); 
     6305        out_status_p->position_flag = jd->u.precreate_pool.position_flag; 
    62996306        out_status_p->count = jd->u.precreate_pool.count; 
    63006307        free(jd->u.precreate_pool.key_array); 
  • branches/orange-next/src/io/job/job.h

    r8496 r8933  
    3131{ 
    3232    /* the comments indicate which type of job will fill in which fields */ 
    33     job_aint status_user_tag;   /* tag supplied by caller */ 
    34     int error_code;             /* returned by all operations */ 
    35     PVFS_size actual_size;      /* resize, bmi_recv */ 
    36     PVFS_vtag *vtag;            /* most trove operations */ 
    37     PVFS_ds_position position;  /* iterate, iterate_keys, iterate_handles */ 
    38     PVFS_handle handle;         /* dspace_create */ 
    39     PVFS_ds_type type;          /* dspace_verify */ 
    40     PVFS_fs_id coll_id;         /* fs_lookup */ 
    41     int count;                  /* keyval_iterate, iterate_handles */ 
     33    job_aint status_user_tag;       /* tag supplied by caller */ 
     34    int error_code;                 /* returned by all operations */ 
     35    PVFS_size actual_size;          /* resize, bmi_recv */ 
     36    PVFS_vtag *vtag;                /* most trove operations */ 
     37    PVFS_ds_position ds_position;   /* iterate_handles */ 
     38    PVFS_kv_position kv_position;   /* iterate_keys,  iterate_handles */ 
     39    PVFS_rec_position rec_position; /* iterate */ 
     40    unsigned int position_flag;     /* flag for positions */ 
     41    PVFS_handle handle;             /* dspace_create */ 
     42    PVFS_ds_type type;              /* dspace_verify */ 
     43    PVFS_fs_id coll_id;             /* fs_lookup */ 
     44    int count;                      /* keyval_iterate, iterate_handles */ 
    4245} 
    4346job_status_s; 
     
    463466int job_trove_keyval_iterate(PVFS_fs_id coll_id, 
    464467                             PVFS_handle handle, 
    465                              PVFS_ds_position position, 
     468                             PVFS_kv_position position, 
     469                             unsigned int position_flag, 
    466470                             PVFS_ds_keyval * key_array, 
    467471                             PVFS_ds_keyval * val_array, 
     
    479483int job_trove_keyval_iterate_keys(PVFS_fs_id coll_id, 
    480484                                  PVFS_handle handle, 
    481                                   PVFS_ds_position position, 
     485                                  PVFS_kv_position position, 
     486                                  unsigned int position_flag, 
    482487                                  PVFS_ds_keyval * key_array, 
    483488                                  int count, 
     
    494499int job_trove_dspace_iterate_handles(PVFS_fs_id coll_id, 
    495500                                     PVFS_ds_position position, 
     501                                     unsigned int position_flag, 
    496502                                     PVFS_handle* handle_array, 
    497503                                     int count, 
     
    673679int job_precreate_pool_iterate_handles( 
    674680    PVFS_fs_id fsid, 
    675     PVFS_ds_position position, 
     681    PVFS_kv_position position, 
     682    unsigned int position_flag, 
    676683    PVFS_handle* handle_array, 
    677684    int count, 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf-dspace.c

    r8932 r8933  
    126126    PINT_event_type event_type; 
    127127    PINT_event_id event_id = 0; 
    128     PVFS_handle handle; 
     128    TROVE_handle handle; 
    129129 
    130130 
     
    137137    if( handle_p == NULL ) 
    138138    { 
    139         PVFS_handle_clear(handle); 
     139        TROVE_handle_clear(handle); 
    140140    } 
    141141    else 
    142142    { 
    143         PVFS_handle_copy(handle, *handle_p); 
     143        TROVE_handle_copy(handle, *handle_p); 
    144144    } 
    145145 
     
    205205    TROVE_handle new_handle; 
    206206    
    207     PVFS_handle_clear(new_handle); 
     207    TROVE_handle_clear(new_handle); 
    208208 
    209209    if (op_p->flags & TROVE_FORCE_REQUESTED_HANDLE) 
     
    214214    trove_handle_alloc(op_p->coll_p->coll_id, &new_handle); 
    215215 
    216     if ( PVFS_handle_is_null(new_handle) ) 
     216    if ( TROVE_handle_is_null(new_handle) ) 
    217217    { 
    218218        gossip_err("%s: handle allocator returned a zero handle.\n", __func__); 
     
    231231                    1, PINT_PERF_SUB); 
    232232 
    233     PVFS_handle_copy(*op_p->u.d_create.out_handle_p, new_handle); 
     233    TROVE_handle_copy(*op_p->u.d_create.out_handle_p, new_handle); 
    234234    return DBPF_OP_COMPLETE; 
    235235} 
     
    353353          -- or else something terrible has happened 
    354354        */ 
    355         if (PVFS_handle_is_null(new_handle)) 
     355        if (TROVE_handle_is_null(new_handle)) 
    356356        { 
    357357            gossip_err("Error: handle allocator returned a zero handle.\n"); 
     
    367367            for(j=0; j<=i; j++) 
    368368            { 
    369                 if( ! PVFS_handle_is_null( 
     369                if( ! TROVE_handle_is_null( 
    370370                                op_p->u.d_create_list.out_handle_array_p[j] ) ) 
    371371                { 
     
    383383        } 
    384384 
    385         PVFS_handle_copy(op_p->u.d_create_list.out_handle_array_p[i],  
     385        TROVE_handle_copy(op_p->u.d_create_list.out_handle_array_p[i],  
    386386                         new_handle); 
    387387    } 
     
    488488    int count = 0; 
    489489    int ret = -TROVE_EINVAL; 
     490    TROVE_kv_position pos; 
    490491    DBT key; 
     492 
     493    memset(&pos, 0, sizeof(TROVE_kv_position)); 
    491494 
    492495    memset(&key, 0, sizeof(key)); 
     
    535538        NULL, 
    536539        &count, 
     540        pos, 
    537541        TROVE_ITERATE_START, 
    538542        PINT_dbpf_dspace_remove_keyval); 
     
    558562 
    559563    ref.fs_id = op_p->coll_p->coll_id; 
    560     PVFS_handle_copy(ref.handle, op_p->handle); 
     564    TROVE_handle_copy(ref.handle, op_p->handle); 
    561565 
    562566    for(i=0; i<op_p->u.d_remove_list.count; i++) 
    563567    { 
    564         PVFS_handle_copy(ref.handle, op_p->u.d_remove_list.handle_array[i]); 
     568        TROVE_handle_copy(ref.handle, op_p->u.d_remove_list.handle_array[i]); 
    565569        ref.fs_id = op_p->coll_p->coll_id; 
    566570         
     
    599603 
    600604    ref.fs_id = op_p->coll_p->coll_id; 
    601     PVFS_handle_copy(ref.handle, op_p->handle); 
     605    TROVE_handle_copy(ref.handle, op_p->handle); 
    602606 
    603607    ret = remove_one_handle(ref, op_p->coll_p); 
     
    640644static int dbpf_dspace_iterate_handles(TROVE_coll_id coll_id, 
    641645                                       TROVE_ds_position *position_p, 
     646                                       unsigned int *position_flag_p, 
    642647                                       TROVE_handle *handle_array, 
    643648                                       int *inout_count_p, 
     
    655660    int ret; 
    656661 
    657     PVFS_handle_clear(handle); 
     662    TROVE_handle_clear(handle); 
    658663 
    659664    coll_p = dbpf_collection_find_registered(coll_id); 
     
    681686   /* initialize op-specific members */ 
    682687    op_p->u.d_iterate_handles.handle_array = handle_array; 
    683     op_p->u.d_iterate_handles.position_p = position_p; 
     688    TROVE_handle_copy(*op_p->u.d_iterate_handles.position_p, handle); 
     689    op_p->u.d_iterate_handles.position_flag_p = position_flag_p; 
    684690    op_p->u.d_iterate_handles.count_p = inout_count_p; 
    685691 
     
    702708    TROVE_ds_attributes attr; 
    703709 
    704     if (*op_p->u.d_iterate_handles.position_p == TROVE_ITERATE_END) 
     710    if (*op_p->u.d_iterate_handles.position_flag_p == TROVE_ITERATE_END) 
    705711    { 
    706712        /* already hit end of keyval space; return 1 */ 
     
    728734     * need to position with DB_FIRST. 
    729735     */ 
    730     if (*op_p->u.d_iterate_handles.position_p != TROVE_ITERATE_START) 
     736    if ( (*op_p->u.d_iterate_handles.position_flag_p == TROVE_ITERATE_AT_POINT) 
     737          && (!TROVE_handle_is_null(dummy_handle)) ) 
    731738    { 
    732739        /* we need to position the cursor before we can read new 
     
    736743         */ 
    737744        memset(&key, 0, sizeof(key)); 
    738         /* FIX: position_p stuff is broken */ 
    739         dummy_handle = *op_p->u.d_iterate_handles.position_p; 
     745 
     746        /* if position_flag_p is set to TROVE_ITERATE_AT_POINT, the value 
     747         * in position_p represents the handle to start at */ 
     748        TROVE_handle_copy(dummy_handle, *op_p->u.d_iterate_handles.position_p); 
    740749        key.data  = &dummy_handle; 
    741750        key.size  = key.ulen = sizeof(TROVE_handle); 
     
    756765            ret = -dbpf_db_error_to_trove_error(ret); 
    757766            gossip_err("failed to set cursor position at handle: %llu\n", 
    758                        llu(*(TROVE_handle *)op_p->u.d_iterate_handles.position_p)); 
     767                       llu(*(TROVE_handle *) 
     768                       op_p->u.d_iterate_handles.position_p)); 
    759769            goto return_error; 
    760770        } 
    761771    } 
    762     else 
     772    else if( *op_p->u.d_iterate_handles.position_flag_p == TROVE_ITERATE_START ) 
    763773    { 
    764774        memset(&key, 0, sizeof(key)); 
     
    786796        } 
    787797    } 
    788  
    789     PVFS_handle_copy(op_p->u.d_iterate_handles.handle_array[i], 
     798    else 
     799    { 
     800        gossip_err("%s: invalid position_flag_p value (%u) or null handle " 
     801                   " with TROVE_ITERATE_AT_POINT flag, returning\n", 
     802                   __func__,  *op_p->u.d_iterate_handles.position_flag_p); 
     803        ret = TROVE_EINVAL; 
     804        goto return_error; 
     805    } 
     806 
     807 
     808    TROVE_handle_copy(op_p->u.d_iterate_handles.handle_array[i], 
    790809                     dummy_handle); 
    791810    ++i; 
     
    883902 
    884903            /* check for duplicates */ 
    885             if(i > 0 && *(TROVE_handle*)tmp_handle ==  
    886                           op_p->u.d_iterate_handles.handle_array[i-1]) 
     904            if(i > 0 &&  
     905               (TROVE_handle_compare(*(TROVE_handle*)tmp_handle,   
     906                    op_p->u.d_iterate_handles.handle_array[i-1]) == 0 )) 
    887907            { 
    888908                gossip_err("Warning: got duplicate handle %llu.\n",  
     
    926946            } 
    927947 
    928             if(*(TROVE_handle*)tmp_handle ==  
    929                 op_p->u.d_iterate_handles.handle_array[ 
    930                     *op_p->u.d_iterate_handles.count_p]) 
     948            if( TROVE_handle_compare( *(TROVE_handle*)tmp_handle, 
     949                    op_p->u.d_iterate_handles.handle_array[ 
     950                        *op_p->u.d_iterate_handles.count_p]) == 0 ) 
    931951            { 
    932952                gossip_err("Warning: found duplicate handle: %llu\n",  
     
    935955            } 
    936956 
    937         } while (sizeof_handle != sizeof(TROVE_handle) || 
    938            sizeof_attr != sizeof(attr) || 
    939            *(TROVE_handle*)tmp_handle == op_p->u.d_iterate_handles.handle_array[*op_p->u.d_iterate_handles.count_p]); 
    940  
    941         *op_p->u.d_iterate_handles.position_p = *(TROVE_handle *)tmp_handle; 
     957        } while ( (sizeof_handle != sizeof(TROVE_handle)) || 
     958                  (sizeof_attr != sizeof(attr)) || 
     959                  (TROVE_handle_compare(*(TROVE_handle*)tmp_handle, 
     960                      op_p->u.d_iterate_handles.handle_array[ 
     961                          *op_p->u.d_iterate_handles.count_p])==0)); 
     962 
     963        /* store current handle and set the flag to indicate iteration should 
     964         * continue at this handle */ 
     965        TROVE_handle_copy(*op_p->u.d_iterate_handles.position_p,  
     966                          *(TROVE_handle *)tmp_handle); 
     967        *op_p->u.d_iterate_handles.position_flag_p = TROVE_ITERATE_AT_POINT; 
    942968        goto return_ok; 
    943969    } 
     
    969995        ret = -dbpf_db_error_to_trove_error(ret); 
    970996    } 
    971     if(*op_p->u.d_iterate_handles.count_p > 0 &&  
    972         dummy_handle == op_p->u.d_iterate_handles.handle_array[*op_p->u.d_iterate_handles.count_p]) 
     997    if( (*op_p->u.d_iterate_handles.count_p > 0) &&  
     998        (TROVE_handle_compare(dummy_handle,  
     999                             op_p->u.d_iterate_handles.handle_array[ 
     1000                                 *op_p->u.d_iterate_handles.count_p]) == 0) ) 
    9731001    { 
    9741002        gossip_err("Warning: found duplicate handle: %llu\n", llu(dummy_handle)); 
     
    9761004        (*op_p->u.d_iterate_handles.count_p)--; 
    9771005    } 
    978     *op_p->u.d_iterate_handles.position_p = dummy_handle; 
     1006    TROVE_handle_copy(*op_p->u.d_iterate_handles.position_p,  
     1007                      dummy_handle);  
     1008    *op_p->u.d_iterate_handles.position_flag_p = TROVE_ITERATE_AT_POINT; 
    9791009 
    9801010return_ok: 
     
    9821012    { 
    9831013        /* if off the end of the database, return TROVE_ITERATE_END */ 
    984         *op_p->u.d_iterate_handles.position_p = TROVE_ITERATE_END; 
     1014        TROVE_handle_clear(*op_p->u.d_iterate_handles.position_p); 
     1015        *op_p->u.d_iterate_handles.position_flag_p = TROVE_ITERATE_END; 
    9851016    } 
    9861017    /* 'position' points to record we just read, or is set to END */ 
     
    15271558        } 
    15281559 
    1529         PVFS_handle_copy(ref.handle, op_p->u.d_getattr_list.handle_array[i]); 
     1560        TROVE_handle_copy(ref.handle, op_p->u.d_getattr_list.handle_array[i]); 
    15301561        ref.fs_id = op_p->coll_p->coll_id; 
    15311562 
     
    22002231 
    22012232    /* add retrieved ds_attr to dbpf_attr cache here */ 
    2202     PVFS_handle_copy(ref.handle, new_handle); 
     2233    TROVE_handle_copy(ref.handle, new_handle); 
    22032234    gen_mutex_lock(&dbpf_attr_cache_mutex); 
    22042235    dbpf_attr_cache_insert(ref, &attr); 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf-keyval-pcache.c

    r7387 r8933  
    2323{ 
    2424    TROVE_handle handle; 
    25     TROVE_ds_position pos; 
     25    TROVE_kv_position pos; 
    2626}; 
    2727 
     
    2929{ 
    3030    TROVE_handle handle; 
    31     TROVE_ds_position pos; 
     31    TROVE_kv_position pos; 
    3232    char keyname[PVFS_NAME_MAX]; 
    3333    int keylen; 
     
    9292 
    9393    if(key_entry->handle == link_entry->handle && 
    94        key_entry->pos == link_entry->pos)  
     94       key_entry->pos.session == link_entry->pos.session &&  
     95       key_entry->pos.count == linux_entry.pos.count) 
    9596        return 1; 
    9697    return 0; 
     
    117118        (struct dbpf_keyval_pcache_entry *)key; 
    118119 
     120    /* FIX: needs refactored for both handle and pos.session/pos.count */ 
    119121    uint32_t a = (uint32_t)(key_entry->handle >> 32); 
    120122    uint32_t b = (uint32_t)(key_entry->handle & 0x00000000FFFFFFFF); 
    121     uint32_t c = (uint32_t)(key_entry->pos); 
     123    uint64_t c = key_entry->pos.session; 
    122124 
    123125    mix(a,b,c); 
     
    135137    PINT_dbpf_keyval_pcache *pcache, 
    136138    TROVE_handle handle, 
    137     TROVE_ds_position pos, 
     139    TROVE_kv_position pos, 
    138140    const void ** keyname, 
    139141    int * length) 
     
    144146 
    145147    key.handle = handle; 
    146     key.pos = pos; 
     148 
     149    /* this used to be a 64 bit number where the top 32 bits were a  
     150     * session id and the bottom 32 were a count. that's replaced with  
     151     * struct that is the same, should provide the same data to tcache */ 
     152    memcpy(&key.pos, &pos, sizeof(TROVE_kv_position) ); 
    147153     
    148154    gen_mutex_lock(&pcache->mutex); 
     
    154160            gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 
    155161                         "Trove KeyVal pcache NOTFOUND: " 
    156                          "handle: %llu, pos: %llu\n", 
    157                          llu(handle), llu(pos)); 
     162                         "handle: %llu, pos: session(%u), count(%u)\n", 
     163                         llu(handle), pos.session, pos.count); 
    158164        } 
    159165        else 
     
    161167            gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 
    162168                         "Trove KeyVal pcache failed: (error %d): " 
    163                          "handle: %llu, pos: %llu\n", 
    164                          ret, llu(handle), llu(pos)); 
     169                         "handle: %llu, pos: session(%u), count(%u)\n", 
     170                         ret, llu(handle), pos.session, pos.count); 
    165171        } 
    166172 
     
    175181    gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 
    176182                 "Trove KeyVal pcache lookup succeeded: " 
    177                  "handle: %llu, pos: %llu\n", 
    178                  llu(handle), llu(pos)); 
     183                 "handle: %llu, pos: session(%u), count(%u)\n", 
     184                 llu(handle), pos.session, pos.count); 
    179185 
    180186    return 0; 
     
    184190    PINT_dbpf_keyval_pcache *pcache, 
    185191    TROVE_handle handle, 
    186     TROVE_ds_position pos, 
     192    TROVE_kv_position pos, 
    187193    const char * keyname, 
    188194    int length) 
     
    202208 
    203209    key.handle = handle; 
    204     key.pos = pos; 
     210    memcpy(&key.pos, &pos, sizeof(PVFS_kv_position)); 
    205211 
    206212    gen_mutex_lock(&pcache->mutex); 
     
    213219 
    214220    entry->handle = handle; 
    215     entry->pos = pos; 
     221    memcpy(&entry->pos, &pos, sizeof(PVFS_kv_position)); 
    216222    memcpy(entry->keyname, keyname, length); 
    217223    entry->keylen = length; 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf-keyval-pcache.h

    r6268 r8933  
    2828    PINT_dbpf_keyval_pcache *pcache, 
    2929    TROVE_handle handle, 
    30     TROVE_ds_position pos, 
     30    TROVE_kv_position pos, 
    3131    const void ** keyname, 
    3232    int * length); 
     
    3535    PINT_dbpf_keyval_pcache *pcache, 
    3636    TROVE_handle handle, 
    37     TROVE_ds_position pos, 
     37    TROVE_kv_position pos, 
    3838    const char * keyname, 
    3939    int length); 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf-keyval.c

    r8920 r8933  
    134134static int dbpf_keyval_iterate_step_to_position( 
    135135    TROVE_handle handle,  
    136     TROVE_ds_position pos, 
     136    TROVE_kv_position pos, 
    137137    DBC * dbc_p); 
    138138 
    139139static int dbpf_keyval_iterate_skip_to_position( 
    140140    TROVE_handle handle,  
    141     TROVE_ds_position pos,  
     141    TROVE_kv_position pos,  
    142142    PINT_dbpf_keyval_pcache *pcache, 
    143143    DBC * dbc_p); 
     
    795795static int dbpf_keyval_iterate(TROVE_coll_id coll_id, 
    796796                               TROVE_handle handle, 
    797                                TROVE_ds_position *position_p, 
     797                               TROVE_kv_position *position_p, 
     798                               unsigned int *position_flag_p, 
    798799                               TROVE_keyval_s *key_array, 
    799800                               TROVE_keyval_s *val_array, 
     
    838839    op_p->u.k_iterate.val_array = val_array; 
    839840    op_p->u.k_iterate.position_p = position_p; 
     841    op_p->u.k_iterate.position_flag_p = position_flag_p; 
    840842    op_p->u.k_iterate.count_p = inout_count_p; 
    841843    op_p->hints = hints; 
     
    877879    gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 
    878880                  "dbpf_keyval_iterate_op_svc: starting: fsid: %u, " 
    879                   "handle: %llu, pos: %llu\n",  
     881                  "handle: %llu, pos_flag: %u\n",  
    880882                 op_p->coll_p->coll_id,  
    881883                 llu(op_p->handle), 
    882                  llu(*op_p->u.k_iterate.position_p)); 
     884                 *op_p->u.k_iterate.position_flag_p); 
    883885     
    884886    /* if they passed in that they are at the end, return 0. 
     
    886888     * work right. 
    887889     */ 
    888     if (*op_p->u.k_iterate.position_p == TROVE_ITERATE_END) 
     890    if (*op_p->u.k_iterate.position_flag_p == TROVE_ITERATE_END) 
    889891    { 
    890892        *op_p->u.k_iterate.count_p = 0; 
     
    904906                                   &count, 
    905907                                   *op_p->u.k_iterate.position_p, 
     908                                   *op_p->u.k_iterate.position_flag_p, 
    906909                                   tmp_callback); 
    907910    if (ret == -TROVE_ENOENT) 
    908911    { 
    909         *op_p->u.k_iterate.position_p = TROVE_ITERATE_END; 
     912        *op_p->u.k_iterate.position_flag_p = TROVE_ITERATE_END; 
    910913    } 
    911914    else if(ret != 0) 
     
    915918    else 
    916919    { 
    917         if(*op_p->u.k_iterate.position_p == TROVE_ITERATE_START) 
    918         { 
    919             *op_p->u.k_iterate.position_p = count; 
     920        if(*op_p->u.k_iterate.position_flag_p == TROVE_ITERATE_START) 
     921        { 
     922            (*op_p->u.k_iterate.position_p).count = count; 
    920923            /* store a session identifier in the top 32 bits */ 
    921924            tmp_pos += readdir_session; 
    922             *op_p->u.k_iterate.position_p += (tmp_pos << 32); 
     925            (*op_p->u.k_iterate.position_p).session = tmp_pos; 
    923926            readdir_session++; 
    924927        } 
    925928        else 
    926929        { 
    927             *op_p->u.k_iterate.position_p += count; 
     930            (*op_p->u.k_iterate.position_p).count += count; 
    928931        } 
    929932 
     
    936939                op_p->coll_p->pcache,  
    937940                op_p->handle, 
    938                 *op_p->u.k_iterate.position_p, 
     941                (*op_p->u.k_iterate.position_p), 
    939942                op_p->u.k_iterate.key_array[count-1].buffer,  
    940943                op_p->u.k_iterate.key_array[count-1].read_sz); 
     
    945948            for(i=0; i<count; i++) 
    946949            { 
    947                 ret = dbpf_keyval_handle_info_ops(op_p, DBPF_KEYVAL_HANDLE_COUNT_DECREMENT); 
     950                ret = dbpf_keyval_handle_info_ops(op_p,  
     951                        DBPF_KEYVAL_HANDLE_COUNT_DECREMENT); 
    948952                if(ret < 0) 
    949953                { 
     
    958962    gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG,  
    959963                 "dbpf_keyval_iterate_op_svc: finished: " 
    960                  "position: %llu, count: %d\n",  
    961                  llu(*op_p->u.k_iterate.position_p), *op_p->u.k_iterate.count_p); 
     964                 "position: session(%llu) count(%llu), count: %d\n",  
     965                 llu((*op_p->u.k_iterate.position_p).session),  
     966                 llu((*op_p->u.k_iterate.position_p).count),  
     967                 *op_p->u.k_iterate.count_p); 
    962968 
    963969    return 1; 
     
    966972static int dbpf_keyval_iterate_keys(TROVE_coll_id coll_id, 
    967973                                    TROVE_handle handle, 
    968                                     TROVE_ds_position *position_p, 
     974                                    TROVE_kv_position *position_p, 
     975                                    unsigned int *position_flag_p, 
    969976                                    TROVE_keyval_s *key_array, 
    970977                                    int *inout_count_p, 
     
    10071014    op_p->u.k_iterate_keys.key_array = key_array; 
    10081015    op_p->u.k_iterate_keys.position_p = position_p; 
     1016    op_p->u.k_iterate_keys.position_flag_p = position_flag_p; 
    10091017    op_p->u.k_iterate_keys.count_p = inout_count_p; 
    10101018    op_p->hints = hints; 
     
    10451053     * work right. 
    10461054     */ 
    1047     if (*op_p->u.k_iterate_keys.position_p == TROVE_ITERATE_END) 
     1055    if (*op_p->u.k_iterate_keys.position_flag_p == TROVE_ITERATE_END) 
    10481056    { 
    10491057        *op_p->u.k_iterate_keys.count_p = 0; 
     
    10641072                                   &count, 
    10651073                                   *op_p->u.k_iterate_keys.position_p, 
     1074                                   *op_p->u.k_iterate_keys.position_flag_p, 
    10661075                                   tmp_callback); 
    10671076    if (ret == -TROVE_ENOENT) 
    10681077    { 
    1069         *op_p->u.k_iterate_keys.position_p = TROVE_ITERATE_END; 
     1078        *op_p->u.k_iterate_keys.position_flag_p = TROVE_ITERATE_END; 
    10701079    } 
    10711080    else if(ret != 0) 
     
    10751084    else 
    10761085    { 
    1077         if(*op_p->u.k_iterate_keys.position_p == TROVE_ITERATE_START) 
    1078         { 
    1079             *op_p->u.k_iterate_keys.position_p = count; 
     1086        if(*op_p->u.k_iterate_keys.position_flag_p == TROVE_ITERATE_START) 
     1087        { 
     1088            (*op_p->u.k_iterate_keys.position_p).count = count; 
    10801089        } 
    10811090        else 
    10821091        { 
    1083             *op_p->u.k_iterate_keys.position_p += count; 
     1092            (*op_p->u.k_iterate_keys.position_p).count += count; 
    10841093        } 
    10851094 
     
    10971106            for(i=0; i<count; i++) 
    10981107            { 
    1099                 ret = dbpf_keyval_handle_info_ops(op_p, DBPF_KEYVAL_HANDLE_COUNT_DECREMENT); 
     1108                ret = dbpf_keyval_handle_info_ops(op_p,  
     1109                    DBPF_KEYVAL_HANDLE_COUNT_DECREMENT); 
    11001110                if(ret < 0) 
    11011111                { 
     
    14971507    TROVE_keyval_s *values_array, 
    14981508    int *count, 
    1499     TROVE_ds_position pos, 
     1509    TROVE_kv_position pos, 
     1510    unsigned int pos_flag, 
    15001511    PINT_dbpf_keyval_iterate_callback callback) 
    15011512{ 
     
    15261537    } 
    15271538 
    1528     if(pos == TROVE_ITERATE_START) 
     1539    if(pos_flag == TROVE_ITERATE_START) 
    15291540    { 
    15301541        ret = dbpf_keyval_iterate_get_first_entry(handle, dbc_p); 
     
    17251736static int dbpf_keyval_iterate_skip_to_position( 
    17261737    TROVE_handle handle, 
    1727     TROVE_ds_position pos, 
     1738    TROVE_kv_position pos, 
    17281739    PINT_dbpf_keyval_pcache *pcache, 
    17291740    DBC * dbc_p) 
     
    17311742    int ret = 0; 
    17321743    TROVE_keyval_s key; 
    1733  
    1734     assert(pos != TROVE_ITERATE_START); 
    17351744 
    17361745    memset(&key, 0, sizeof(TROVE_keyval_s)); 
     
    17481757         * integer offset if we get past the cache 
    17491758         */ 
    1750         pos = pos & 0xffffffff; 
     1759        pos.session = 0; 
    17511760        return dbpf_keyval_iterate_step_to_position(handle, pos, dbc_p); 
    17521761    } 
     
    17761785static int dbpf_keyval_iterate_step_to_position( 
    17771786    TROVE_handle handle, 
    1778     TROVE_ds_position pos, 
     1787    TROVE_kv_position pos, 
    17791788    DBC * dbc_p) 
    17801789{ 
     
    17831792    TROVE_keyval_s key; 
    17841793 
    1785     assert(pos != TROVE_ITERATE_START); 
    1786  
    17871794    ret = dbpf_keyval_iterate_get_first_entry(handle, dbc_p); 
    17881795    if(ret != 0) 
     
    17911798    } 
    17921799 
    1793     for(i = 0; i < pos; ++i) 
     1800    for(i = 0; i < pos.count; ++i) 
    17941801    { 
    17951802        memset(&key, 0, sizeof(TROVE_keyval_s)); 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf-mgmt.c

    r8860 r8933  
    14981498 
    14991499int dbpf_collection_iterate(TROVE_ds_position *inout_position_p, 
     1500                            unsigned int *inout_position_flag_p, 
    15001501                            TROVE_keyval_s *name_array, 
    15011502                            TROVE_coll_id *coll_id_array, 
     
    15141515 
    15151516    /* if caller passed that they're are at the end, return 0 */ 
    1516     if (*inout_position_p == TROVE_ITERATE_END) 
     1517    if (*inout_position_flag_p == TROVE_ITERATE_END) 
    15171518    { 
    15181519        *inout_count_p = 0; 
     
    15321533 
    15331534    /* see keyval iterate for discussion of this implementation */ 
    1534     if (*inout_position_p != TROVE_ITERATE_START) 
     1535    if (*inout_position_flag_p == TROVE_ITERATE_AT_POINT ) 
    15351536    { 
    15361537        /* need to position cursor before reading.  note that this 
     
    15441545        key.data = name_array[0].buffer; 
    15451546        key.ulen = name_array[0].buffer_sz; 
    1546         *(db_recno_t *)key.data = *(db_recno_t *)inout_position_p; 
     1547        *(db_recno_t *)key.data = *(db_recno_t *)inout_position_p.record; 
    15471548        key.size = sizeof(db_recno_t); 
    15481549        key.flags |= DB_DBT_USERMEM; 
     
    15651566        } 
    15661567    } 
     1568    else if (*inout_position_flag_p != TROVE_ITERATE_START) 
     1569    { 
     1570        gossip_debug(GOSSIP_TROVE_DEBUG, "%s: invalid position_flag_p (%u)\n", 
     1571                     __func__, *inout_position_flag_p); 
     1572        ret = -TROVE_EINVAL; 
     1573        goto return_error; 
     1574    } 
    15671575 
    15681576    for (i = 0; i < *inout_count_p; i++) 
     
    15941602    if (ret == DB_NOTFOUND) 
    15951603    { 
    1596         *inout_position_p = TROVE_ITERATE_END; 
     1604        *inout_position_flag_p = TROVE_ITERATE_END; 
    15971605    } 
    15981606    else 
     
    16301638        } 
    16311639 
    1632         assert(recno != TROVE_ITERATE_START && 
    1633                recno != TROVE_ITERATE_END); 
    1634         *inout_position_p = recno; 
     1640        *inout_position_p.record = recno; 
     1641        *inout_position_flag_p = TROVE_ITERATE_AT_POINT; 
    16351642    } 
    16361643    /* 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf-op.c

    r7387 r8933  
    4141    q_op_p->op.type = type; 
    4242    q_op_p->op.state = OP_NOT_QUEUED; 
    43     q_op_p->op.handle = handle; 
     43    TROVE_handle_copy(q_op_p->op.handle, handle); 
    4444    q_op_p->op.coll_p = coll_p; 
    4545    q_op_p->op.svc_fn = svc_fn; 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf-op.h

    r7471 r8933  
    2424        (_op).type = _type; \ 
    2525        (_op).state = OP_NOT_QUEUED; \ 
    26         (_op).handle = _handle; \ 
     26        TROVE_handle_copy((_op).handle, _handle); \ 
    2727        (_op).coll_p = _coll_p; \ 
    2828        (_op).svc_fn = _svc_fn; \ 
  • branches/orange-next/src/io/trove/trove-dbpf/dbpf.h

    r8496 r8933  
    191191    TROVE_keyval_s *values_array, 
    192192    int *count, 
    193     TROVE_ds_position pos, 
     193    TROVE_kv_position pos, 
     194    unsigned int pos_flag, 
    194195    PINT_dbpf_keyval_iterate_callback callback); 
    195196 
     
    286287    TROVE_handle *handle_array; 
    287288    TROVE_ds_position *position_p; 
     289    unsigned int *position_flag_p; 
    288290    int *count_p; 
    289291}; 
     
    367369    TROVE_keyval_s *key_array; 
    368370    TROVE_keyval_s *val_array; 
    369     TROVE_ds_position *position_p; 
     371    TROVE_kv_position *position_p; 
     372    unsigned int *position_flag_p; 
    370373    int *count_p; 
    371374    /* vtag? */ 
     
    375378{ 
    376379    TROVE_keyval_s *key_array; 
    377     TROVE_ds_position *position_p; 
     380    TROVE_kv_position *position_p; 
     381    unsigned int *position_flag_p; 
    378382    int *count_p; 
    379383    /* vtag? */ 
     
    724728 
    725729int dbpf_collection_iterate(TROVE_ds_position *inout_position_p, 
     730                            unsigned int *inout_postition_flag_p, 
    726731                            TROVE_keyval_s *name_array, 
    727732                            TROVE_coll_id *coll_id_array, 
  • branches/orange-next/src/io/trove/trove-internal.h

    r8496 r8933  
    182182                          TROVE_coll_id coll_id, 
    183183                          TROVE_handle handle, 
    184                           TROVE_ds_position *inout_position_p, 
     184                          TROVE_kv_position *inout_position_p, 
     185                          unsigned int *inout_position_flag_p, 
    185186                          TROVE_keyval_s *out_key_array, 
    186187                          TROVE_keyval_s *out_val_array, 
     
    196197                               TROVE_coll_id coll_id, 
    197198                               TROVE_handle handle, 
    198                                TROVE_ds_position *inout_position_p, 
     199                               TROVE_kv_position *inout_position_p, 
     200                               unsigned int *inout_position_flag_p, 
    199201                               TROVE_keyval_s *out_key_array, 
    200202                               int *inout_count_p, 
     
    301303                                  TROVE_coll_id coll_id, 
    302304                                  TROVE_ds_position *position_p, 
     305                                  unsigned int *position_flag_p, 
    303306                                  TROVE_handle *handle_array, 
    304307                                  int *inout_count_p, 
  • branches/orange-next/src/io/trove/trove-mgmt.c

    r7959 r8933  
    226226int trove_collection_iterate(TROVE_method_id method_id, 
    227227                             TROVE_ds_position *inout_position_p, 
     228                             unsigned int *inout_position_flag_p, 
    228229                             TROVE_keyval_s *name_array, 
    229230                             TROVE_coll_id *coll_id_array, 
     
    235236{ 
    236237    int ret = mgmt_method_table[method_id]->collection_iterate( 
    237         inout_position_p, name_array, coll_id_array, inout_count_p, 
    238         flags, vtag, user_ptr, out_op_id_p); 
     238        inout_position_p, inout_position_flag_pname_array, coll_id_array,  
     239        inout_count_p, flags, vtag, user_ptr, out_op_id_p); 
    239240 
    240241    return ((ret < 0) ? ret : 1); 
  • branches/orange-next/src/io/trove/trove-migrate.c

    r8659 r8933  
    432432    int               outstanding_op_count; 
    433433    int               immediate_completion; 
     434    unsigned int      pos_flag; 
    434435 
    435436    base_count = 10000; 
    436      
     437    
     438    TROVE_handle_clear(pos); 
     439 
    437440    handles = malloc(sizeof(TROVE_handle)*base_count); 
    438441    if (!handles) 
     
    506509    } 
    507510 
    508     pos = TROVE_ITERATE_START; 
     511    pos_flag = TROVE_ITERATE_START; 
    509512 
    510513    do 
     
    515518        ret = trove_dspace_iterate_handles(coll_id, 
    516519                                           &pos, 
     520                                           &pos_flag, 
    517521                                           handles, 
    518522                                           &handle_count, 
     
    525529        { 
    526530            gossip_err("trove_dspace_iterate_handles failed: \ 
    527 ret=%d coll=%d pos=%lld handles=%p count=%d context=%lld op=%lld\n", 
    528                        ret, coll_id, llu(pos), handles, handle_count, 
     531ret=%d coll=%d pos_flag=%lld handles=%p count=%d context=%lld op=%lld\n", 
     532                       ret, coll_id, llu(pos_flag), handles, handle_count, 
    529533                       llu(context_id), llu(iterate_op_id)); 
    530534            goto complete; 
  • branches/orange-next/src/io/trove/trove-types.h

    r8930 r8933  
    4040typedef PVFS_ds_keyval_handle_info TROVE_keyval_handle_info; 
    4141typedef PVFS_ds_position           TROVE_ds_position; 
     42typedef PVFS_kv_position           TROVE_kv_position; 
     43typedef PVFS_rec_position          TROVE_rec_position; 
    4244typedef PVFS_ds_attributes         TROVE_ds_attributes_s; 
    4345typedef PVFS_ds_attributes         TROVE_ds_attributes; 
     
    5052/* PVFS_handle to TROVE_handle helper function mappings */ 
    5153#define TROVE_handle_clear(u)           PVFS_handle_clear(u) 
    52 #define TROVE_handle_compare(u1, u2)    PVFS_handle_compuare(u1, u2) 
     54#define TROVE_handle_compare(u1, u2)    PVFS_handle_compare(u1, u2) 
    5355#define TROVE_handle_copy(dst, src)     PVFS_handle_copy(dst, src) 
    5456#define TROVE_handle_generate(u)        PVFS_handle_generate(u) 
  • branches/orange-next/src/io/trove/trove.h

    r8496 r8933  
    3636enum 
    3737{ 
    38     TROVE_ITERATE_START = PVFS_ITERATE_START, 
    39     TROVE_ITERATE_END   = PVFS_ITERATE_END  
     38    TROVE_ITERATE_START     = PVFS_ITERATE_START, 
     39    TROVE_ITERATE_END       = PVFS_ITERATE_END, 
     40    TROVE_ITERATE_AT_POINT  = PVFS_ITERATE_AT_POINT 
    4041}; 
    4142 
     
    157158    TROVE_method_id method_id, 
    158159    TROVE_ds_position *inout_position_p, 
     160    unsigned int *inout_position_flag_p, 
    159161    TROVE_keyval_s *name_array, 
    160162    TROVE_coll_id *coll_id_array, 
     
    303305                         TROVE_coll_id coll_id, 
    304306                         TROVE_handle handle, 
    305                          TROVE_ds_position *position_p, 
     307                         TROVE_kv_position *position_p, 
     308                         unsigned int *position_flag_p, 
    306309                         TROVE_keyval_s *key_array, 
    307310                         TROVE_keyval_s *val_array, 
     
    317320                              TROVE_coll_id coll_id, 
    318321                              TROVE_handle handle, 
    319                               TROVE_ds_position *position_p, 
     322                              TROVE_kv_position *position_p, 
     323                              unsigned int *position_flag_p, 
    320324                              TROVE_keyval_s *key_array, 
    321325                              int *inout_count_p, 
     
    426430int trove_dspace_iterate_handles(TROVE_coll_id coll_id, 
    427431                                 TROVE_ds_position *position_p, 
     432                                 unsigned int *position_flag_p, 
    428433                                 TROVE_handle *handle_array, 
    429434                                 int *inout_count_p, 
  • branches/orange-next/src/kernel/linux-2.6/upcall.h

    r8215 r8933  
    8888    PVFS_object_ref refn; 
    8989    PVFS_ds_position token; 
     90    uint32_t token_flag; 
    9091    int32_t max_dirent_count; 
    9192    int32_t buf_index; 
  • branches/orange-next/src/proto/pvfs2-req-proto.h

    r8929 r8933  
    923923    PVFS_handle handle;     /* handle of dir object */ 
    924924    PVFS_fs_id fs_id;       /* file system */ 
    925     PVFS_ds_position token; /* dir offset */ 
     925    PVFS_kv_position token; /* dir offset */ 
     926    uint32_t token_flag; 
    926927    uint32_t dirent_count;  /* desired # of entries */ 
    927928}; 
    928 endecode_fields_4_struct( 
     929endecode_fields_5_struct( 
    929930    PVFS_servreq_readdir, 
    930931    PVFS_handle, handle, 
    931932    PVFS_fs_id, fs_id, 
    932933    uint32_t, dirent_count, 
    933     PVFS_ds_position, token); 
     934    PVFS_kv_position, token, 
     935    uint32_t, token_flag); 
    934936 
    935937#define PINT_SERVREQ_READDIR_FILL(__req,              \ 
     
    938940                                  __handle,           \ 
    939941                                  __token,            \ 
     942                                  __token_flag,       \ 
    940943                                  __dirent_count,     \ 
    941944                                  __hints)            \ 
     
    947950    (__req).u.readdir.fs_id = (__fsid);               \ 
    948951    (__req).u.readdir.handle = (__handle);            \ 
    949     (__req).u.readdir.token = (__token);              \ 
     952    memcpy( &(__req).u.readdir.token). &(__token),    \ 
     953            sizeof(PVFS_kv_position);                 \ 
     954    (__req).u.readdir.token_flag = (__token_flag);    \ 
    950955    (__req).u.readdir.dirent_count = (__dirent_count);\ 
    951956} while (0); 
     
    953958struct PVFS_servresp_readdir 
    954959{ 
    955     PVFS_ds_position token;  /* new dir offset */ 
     960    PVFS_kv_position token;  /* new dir offset */ 
     961    uint32_t token_flag;  /* new dir offset */ 
    956962    /* array of directory entries */ 
    957963    PVFS_dirent *dirent_array; 
     
    959965    uint64_t directory_version; 
    960966}; 
    961 endecode_fields_3a_struct( 
     967endecode_fields_4a_struct( 
    962968    PVFS_servresp_readdir, 
    963     PVFS_ds_position, token, 
     969    PVFS_kv_position, token, 
     970    uint32_t, token_flag, 
    964971    uint64_t, directory_version, 
    965972    skip4,, 
     
    15901597/* mgmt_iterate_handles ***************************************/ 
    15911598/* iterates through handles stored on server */ 
    1592  
     1599/* not currently implemented to allow mixing of kv and ds positions, 
     1600 * flags specific which to fill */ 
    15931601struct PVFS_servreq_mgmt_iterate_handles 
    15941602{ 
     
    15961604    int32_t handle_count; 
    15971605    int32_t flags; 
    1598     PVFS_ds_position position; 
    1599 }; 
    1600 endecode_fields_4_struct( 
     1606    PVFS_kv_position kv_position; 
     1607    PVFS_ds_position ds_position; 
     1608    uint32_t position_flag; 
     1609}; 
     1610endecode_fields_7_struct( 
    16011611    PVFS_servreq_mgmt_iterate_handles, 
    16021612    PVFS_fs_id, fs_id, 
    16031613    int32_t, handle_count, 
    16041614    int32_t, flags, 
    1605     PVFS_ds_position, position); 
    1606  
    1607 #define PINT_SERVREQ_MGMT_ITERATE_HANDLES_FILL(__req,              \ 
    1608                                         __creds,                   \ 
    1609                                         __fs_id,                   \ 
    1610                                         __handle_count,            \ 
    1611                                         __position,                \ 
    1612                                         __flags,                   \ 
    1613                                         __hints)                   \ 
    1614 do {                                                               \ 
    1615     memset(&(__req), 0, sizeof(__req));                            \ 
    1616     (__req).op = PVFS_SERV_MGMT_ITERATE_HANDLES;                   \ 
    1617     (__req).credentials = (__creds);                               \ 
    1618     (__req).hints = (__hints);                                     \ 
    1619     (__req).u.mgmt_iterate_handles.fs_id = (__fs_id);              \ 
    1620     (__req).u.mgmt_iterate_handles.handle_count = (__handle_count);\ 
    1621     (__req).u.mgmt_iterate_handles.position = (__position),        \ 
    1622     (__req).u.mgmt_iterate_handles.flags = (__flags);              \ 
     1615    PVFS_kv_position, kv_position, 
     1616    PVFS_ds_position, ds_position, 
     1617    skip4,, 
     1618    uint32_t, position_flag); 
     1619 
     1620#define PINT_SERVREQ_MGMT_ITERATE_HANDLES_FILL(__req,                 \ 
     1621                                        __creds,                      \ 
     1622                                        __fs_id,                      \ 
     1623                                        __handle_count,               \ 
     1624                                        __kv_position,                \ 
     1625                                        __ds_position,                \ 
     1626                                        __position_flag,              \ 
     1627                                        __flags,                      \ 
     1628                                        __hints)                      \ 
     1629do {                                                                  \ 
     1630    memset(&(__req), 0, sizeof(__req));                               \ 
     1631    (__req).op = PVFS_SERV_MGMT_ITERATE_HANDLES;                      \ 
     1632    (__req).credentials = (__creds);                                  \ 
     1633    (__req).hints = (__hints);                                        \ 
     1634    (__req).u.mgmt_iterate_handles.fs_id = (__fs_id);                 \ 
     1635    (__req).u.mgmt_iterate_handles.handle_count = (__handle_count);   \ 
     1636    (__req).u.mgmt_iterate_handles.position_flag = (__position_flag); \ 
     1637    memcpy(&(__req).u.mgmt_iterate_handles.kv_position,               \ 
     1638            &(__position_flag), sizeof(PVFS_kv_position));            \ 
     1639    memcpy(&(__req).u.mgmt_iterate_handles.ds_position,               \ 
     1640            &(__position_flag), sizeof(PVFS_ds_position));            \ 
     1641    (__req).u.mgmt_iterate_handles.flags = (__flags);                 \ 
    16231642} while (0) 
    16241643 
    16251644struct PVFS_servresp_mgmt_iterate_handles 
    16261645{ 
    1627     PVFS_ds_position position; 
     1646    PVFS_kv_position kv_position; 
     1647    PVFS_ds_position ds_position; 
     1648    unsigned int position_flag; 
    16281649    PVFS_handle *handle_array; 
    16291650    int handle_count; 
    16301651}; 
    1631 endecode_fields_2a_struct( 
     1652endecode_fields_4a_struct( 
    16321653    PVFS_servresp_mgmt_iterate_handles, 
    1633     PVFS_ds_position, position, 
     1654    PVFS_kv_position, kv_position, 
     1655    PVFS_ds_position, ds_position, 
     1656    uint32_t, position_flag,  
    16341657    skip4,, 
    16351658    int32_t, handle_count, 
     
    18631886struct PVFS_servreq_listeattr 
    18641887{ 
    1865     PVFS_handle handle;     /* handle of dir object */ 
    1866     PVFS_fs_id  fs_id;      /* file system */ 
    1867     PVFS_ds_position token; /* offset */ 
    1868     uint32_t     nkey;      /* desired number of keys to read */ 
    1869     PVFS_size   *keysz;     /* array of key buffer sizes */ 
    1870 }; 
    1871 endecode_fields_4a_struct( 
     1888    PVFS_handle handle;         /* handle of dir object */ 
     1889    PVFS_fs_id  fs_id;          /* file system */ 
     1890    PVFS_kv_position token;     /* offset */ 
     1891    uint32_t    token_flag;    /* flags defining token meaning */ 
     1892    uint32_t    nkey;           /* desired number of keys to read */ 
     1893    PVFS_size   *keysz;         /* array of key buffer sizes */ 
     1894}; 
     1895endecode_fields_5a_struct( 
    18721896    PVFS_servreq_listeattr, 
    18731897    PVFS_handle, handle, 
    18741898    PVFS_fs_id, fs_id, 
    1875     skip4,, 
    1876     PVFS_ds_position, token, 
     1899    PVFS_kv_position, token, 
     1900    skip4,, 
     1901    uint32_t, token_flag, 
    18771902    uint32_t, nkey, 
    18781903    PVFS_size, keysz); 
     
    18851910                                  __handle,           \ 
    18861911                                  __token,            \ 
     1912                                  __token_flag,       \ 
    18871913                                  __nkey,             \ 
    18881914                                  __size_array,       \ 
     
    18951921    (__req).u.listeattr.fs_id = (__fsid);             \ 
    18961922    (__req).u.listeattr.handle = (__handle);          \ 
    1897     (__req).u.listeattr.token = (__token);            \ 
     1923    memcpy( &(__req).u.listeattr.token, &(__token),   \ 
     1924           sizeof(PVFS_kv_position));                 \ 
     1925    (__req).u.listeattr.token_flag = (__token_flag);  \ 
    18981926    (__req).u.listeattr.nkey = (__nkey);              \ 
    18991927    (__req).u.listeattr.keysz = (__size_array);       \ 
     
    19021930struct PVFS_servresp_listeattr 
    19031931{ 
    1904     PVFS_ds_position token;  /* new dir offset */ 
     1932    PVFS_kv_position token;  /* new dir offset */ 
     1933    uint32_t token_flag; 
    19051934    uint32_t nkey;   /* # of keys retrieved */ 
    19061935    PVFS_ds_keyval *key; /* array of keys returned */ 
    19071936}; 
    1908 endecode_fields_2a_struct( 
     1937endecode_fields_3a_struct( 
    19091938    PVFS_servresp_listeattr, 
    1910     PVFS_ds_position, token, 
    1911     skip4,, 
     1939    PVFS_kv_position, token, 
     1940    skip4,, 
     1941    uint32_t, token_flag, 
    19121942    uint32_t, nkey, 
    19131943    PVFS_ds_keyval, key); 
  • branches/orange-next/src/server/iterate-handles.sm

    r8929 r8933  
    8888    } 
    8989     
    90     s_op->resp.u.mgmt_iterate_handles.position 
    91         = s_op->req->u.mgmt_iterate_handles.position; 
    92  
    9390    if(s_op->req->u.mgmt_iterate_handles.flags == PVFS_MGMT_RESERVED) 
    9491    { 
     
    9693         * allocated by precreate 
    9794         */ 
     95        memcpy(&s_op->resp.u.mgmt_iterate_handles.kv_position, 
     96               &s_op->req->u.mgmt_iterate_handles.kv_position,  
     97               sizeof(PVFS_kv_position)); 
    9898        ret = job_precreate_pool_iterate_handles( 
    9999            s_op->req->u.mgmt_iterate_handles.fs_id, 
    100             s_op->resp.u.mgmt_iterate_handles.position, 
     100            s_op->resp.u.mgmt_iterate_handles.kv_position, 
     101            s_op->req->u.mgmt_iterate_handles.position_flag, 
    101102            s_op->resp.u.mgmt_iterate_handles.handle_array, 
    102103            s_op->req->u.mgmt_iterate_handles.handle_count, 
     
    112113    else if(s_op->req->u.mgmt_iterate_handles.flags == 0) 
    113114    { 
     115        memcpy(&s_op->resp.u.mgmt_iterate_handles.ds_position, 
     116               &s_op->req->u.mgmt_iterate_handles.ds_position,  
     117               sizeof(PVFS_ds_position)); 
    114118        ret = job_trove_dspace_iterate_handles( 
    115119            s_op->req->u.mgmt_iterate_handles.fs_id, 
    116             s_op->resp.u.mgmt_iterate_handles.position, 
     120            s_op->resp.u.mgmt_iterate_handles.ds_position, 
     121            s_op->req->u.mgmt_iterate_handles.position_flag, 
    117122            s_op->resp.u.mgmt_iterate_handles.handle_array, 
    118123            s_op->req->u.mgmt_iterate_handles.handle_count, 
     
    155160 
    156161    s_op->resp.u.mgmt_iterate_handles.handle_count = js_p->count; 
    157     s_op->resp.u.mgmt_iterate_handles.position = js_p->position; 
    158  
     162    if(s_op->req->u.mgmt_iterate_handles.flags == PVFS_MGMT_RESERVED) 
     163    { 
     164        memcpy(&s_op->resp.u.mgmt_iterate_handles.kv_position, 
     165               &js_p->kv_position, sizeof(PVFS_kv_position)); 
     166    } 
     167    else if( s_op->req->u.mgmt_iterate_handles.flags == 0 ) 
     168    { 
     169        memcpy(&s_op->resp.u.mgmt_iterate_handles.ds_position, 
     170               &js_p->ds_position, sizeof(PVFS_ds_position)); 
     171    } 
     172    else 
     173    { 
     174        js_p->error_code = -PVFS_EINVAL; 
     175        return SM_ACTION_COMPLETE; 
     176    } 
    159177    return SM_ACTION_COMPLETE; 
    160178} 
  • branches/orange-next/src/server/list-eattr.sm

    r8866 r8933  
    162162        s_op->req->u.listeattr.handle, 
    163163        s_op->req->u.listeattr.token, 
     164        s_op->req->u.listeattr.token_flag, 
    164165        s_op->resp.u.listeattr.key, 
    165166        s_op->req->u.listeattr.nkey, 
     
    212213    if (s_op->resp.u.listeattr.nkey == 0) 
    213214    { 
    214         s_op->resp.u.listeattr.token = js_p->count; 
     215        s_op->resp.u.listeattr.token.count = js_p->count; 
    215216        js_p->error_code = 0; 
    216217        return SM_ACTION_COMPLETE; 
     
    224225    } 
    225226 
    226     s_op->resp.u.listeattr.token = js_p->position; 
     227    memcpy(&(s_op->resp.u.listeattr.token.count), &(js_p->kv_position.count), 
     228           sizeof(PVFS_kv_position)); 
    227229    s_op->resp.u.listeattr.nkey = num_found; 
    228230 
  • branches/orange-next/src/server/readdir.sm

    r7471 r8933  
    195195    gossip_debug( 
    196196        GOSSIP_READDIR_DEBUG, " - iterating keyvals: [%llu,%d], " 
    197         "\n\ttoken=%llu, count=%d\n", 
     197        "\n\ttoken_flag=%u, count=%d\n", 
    198198        llu(s_op->u.readdir.dirent_handle), s_op->req->u.readdir.fs_id, 
    199         llu(s_op->req->u.readdir.token), 
     199        s_op->req->u.readdir.token_flag, 
    200200        s_op->req->u.readdir.dirent_count); 
    201201 
    202202    ret = job_trove_keyval_iterate( 
    203203        s_op->req->u.readdir.fs_id, s_op->u.readdir.dirent_handle, 
    204         s_op->req->u.readdir.token, s_op->key_a, s_op->val_a, 
    205         s_op->req->u.readdir.dirent_count,  
     204        s_op->req->u.readdir.token, s_op->req->u.readdir.token_flag, 
     205        s_op->key_a, s_op->val_a, s_op->req->u.readdir.dirent_count,  
    206206        0,  
    207207        NULL, smcb, 0, js_p, 
     
    239239     * interface users could break because of this... 
    240240     */ 
    241     s_op->resp.u.readdir.token = js_p->position; 
     241    memcpy(&s_op->resp.u.readdir.token, &js_p->kv_position,  
     242           sizeof(TROVE_kv_position)); 
     243    s_op->resp.u.readdir.token_flag = js_p->position_flag; 
     244 
    242245    js_p->error_code = 0; 
    243246    return SM_ACTION_COMPLETE; 
  • branches/orange-next/src/server/remove.sm

    r8932 r8933  
    259259    int ret; 
    260260    job_id_t tmp_id; 
     261    PVFS_kv_position pos; 
     262    unsigned int pos_flag; 
     263 
     264    memset(&pos, 0, sizeof(PVFS_kv_position)); 
     265    pos_flag = PVFS_ITERATE_START; 
    261266 
    262267    if (js_p->error_code) 
     
    270275        s_op->req->u.remove.fs_id, 
    271276        s_op->u.remove.dirdata_handle, 
    272         /* FIX: position stuff changed to use small int and flag */ 
    273         PVFS_ITERATE_START, 
     277        pos, 
     278        pos_flag, 
    274279        &s_op->u.remove.key, 
    275280        1, 
  • branches/orange-next/src/server/setparam.sm

    r8929 r8933  
    188188{ 
    189189    int ret = -PVFS_ENOENT, count = 1; 
    190     TROVE_ds_position pos = TROVE_ITERATE_START; 
     190    TROVE_ds_position pos; 
     191    unsigned int pos_flag = TROVE_ITERATE_START; 
    191192    TROVE_keyval_s name; 
    192193    TROVE_coll_id tmp_coll; 
     
    208209        ret = trove_collection_iterate( 
    209210            server_config->trove_method, 
    210             &pos, &name, &tmp_coll, &count, 0, 0, NULL, &tmp_id); 
     211            &pos, &pos_flag, &name, &tmp_coll, &count, 0, 0, NULL, &tmp_id); 
    211212 
    212213        if (ret == 0)