Changeset 8933
- Timestamp:
- 07/11/11 14:02:11 (23 months ago)
- Location:
- branches/orange-next
- Files:
-
- 28 modified
-
include/pvfs2-sysint.h (modified) (4 diffs)
-
include/pvfs2-types.h (modified) (3 diffs)
-
src/apps/admin/pvfs2-showcoll.c (modified) (2 diffs)
-
src/client/sysint/client-state-machine.h (modified) (2 diffs)
-
src/client/sysint/sys-readdir.sm (modified) (7 diffs)
-
src/io/job/job-desc-queue.h (modified) (1 diff)
-
src/io/job/job.c (modified) (16 diffs)
-
src/io/job/job.h (modified) (5 diffs)
-
src/io/trove/trove-dbpf/dbpf-dspace.c (modified) (28 diffs)
-
src/io/trove/trove-dbpf/dbpf-keyval-pcache.c (modified) (12 diffs)
-
src/io/trove/trove-dbpf/dbpf-keyval-pcache.h (modified) (2 diffs)
-
src/io/trove/trove-dbpf/dbpf-keyval.c (modified) (24 diffs)
-
src/io/trove/trove-dbpf/dbpf-mgmt.c (modified) (7 diffs)
-
src/io/trove/trove-dbpf/dbpf-op.c (modified) (1 diff)
-
src/io/trove/trove-dbpf/dbpf-op.h (modified) (1 diff)
-
src/io/trove/trove-dbpf/dbpf.h (modified) (5 diffs)
-
src/io/trove/trove-internal.h (modified) (3 diffs)
-
src/io/trove/trove-mgmt.c (modified) (2 diffs)
-
src/io/trove/trove-migrate.c (modified) (4 diffs)
-
src/io/trove/trove-types.h (modified) (2 diffs)
-
src/io/trove/trove.h (modified) (5 diffs)
-
src/kernel/linux-2.6/upcall.h (modified) (1 diff)
-
src/proto/pvfs2-req-proto.h (modified) (11 diffs)
-
src/server/iterate-handles.sm (modified) (4 diffs)
-
src/server/list-eattr.sm (modified) (3 diffs)
-
src/server/readdir.sm (modified) (2 diffs)
-
src/server/remove.sm (modified) (2 diffs)
-
src/server/setparam.sm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/orange-next/include/pvfs2-sysint.h
r8891 r8933 154 154 struct PVFS_sysresp_readdir_s 155 155 { 156 PVFS_ds_position token; 156 PVFS_kv_position token; 157 uint32_t token_flag; 157 158 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 */ 159 161 uint64_t directory_version; 160 162 }; … … 162 164 163 165 /** Holds results of a readdirplus operation (position token, directory version 164 * information, array of directory entries, array of stat error codes and array of165 * a ttribute information).166 * information, array of directory entries, array of stat error codes and 167 * array of attribute information). 166 168 */ 167 169 struct PVFS_sysresp_readdirplus_s 168 170 { 169 PVFS_ ds_position token;171 PVFS_kv_position token; 170 172 PVFS_dirent *dirent_array; 171 173 uint32_t pvfs_dirent_outcount; /**< uint32_t for portable, fixed size structure */ … … 330 332 PVFS_error PVFS_isys_readdir( 331 333 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 343 PVFS_error PVFS_sys_readdir( 344 PVFS_object_ref ref, 332 345 PVFS_ds_position token, 333 346 int32_t pvfs_dirent_incount, 334 347 const PVFS_credentials *credentials, 335 348 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 351 PVFS_error PVFS_isys_readdirplus( 341 352 PVFS_object_ref ref, 342 353 PVFS_ds_position token, 343 354 int32_t pvfs_dirent_incount, 344 355 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,353 356 uint32_t attrmask, 354 357 PVFS_sysresp_readdirplus *resp, … … 359 362 PVFS_error PVFS_sys_readdirplus( 360 363 PVFS_object_ref ref, 361 PVFS_ ds_position token,364 PVFS_kv_position token, 362 365 int32_t pvfs_dirent_incount, 363 366 const PVFS_credentials *credentials, -
branches/orange-next/include/pvfs2-types.h
r8930 r8933 146 146 */ 147 147 typedef int32_t PVFS_fs_id; 148 typedef uint64_t PVFS_ds_position; 148 typedef PVFS_handle PVFS_ds_position; 149 typedef struct { 150 uint64_t count; 151 uint64_t session; 152 } PVFS_kv_position; 153 endecode_fields_2( 154 PVFS_kv_position, 155 uint64_t, count, 156 uint64_t, session); 157 158 typedef uint32_t PVFS_rec_position; 159 149 160 typedef int32_t PVFS_ds_flags; 150 161 … … 161 172 #define encode_PVFS_fs_id encode_int32_t 162 173 #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 165 178 166 179 /* Basic types used within metadata. */ … … 258 271 #define PVFS_OP_NULL ((PVFS_id_gen_t)0) 259 272 #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 262 276 #define PVFS_READDIR_START PVFS_ITERATE_START 263 277 #define PVFS_READDIR_END PVFS_ITERATE_END -
branches/orange-next/src/apps/admin/pvfs2-showcoll.c
r8626 r8933 257 257 TROVE_op_id op_id; 258 258 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; 261 263 count = 64; 262 264 … … 266 268 ret = trove_dspace_iterate_handles(coll_id, 267 269 &pos, 270 &pos_flag, 268 271 harray, 269 272 &count, -
branches/orange-next/src/client/sysint/client-state-machine.h
r8891 r8933 269 269 struct PINT_client_readdir_sm 270 270 { 271 PVFS_ds_position pos_token; /* input parameter */ 271 PVFS_kv_position pos_token; /* input parameter */ 272 unsigned int pos_token_flag; /* input parameter */ 272 273 int dirent_limit; /* input parameter */ 273 274 PVFS_sysresp_readdir *readdir_resp; /* in/out parameter*/ … … 282 283 struct PINT_client_readdirplus_sm 283 284 { 284 PVFS_ds_position pos_token; /* input parameter */ 285 PVFS_kv_position pos_token; /* input parameter */ 286 unsigned int pos_token_flag; /* input parameter */ 285 287 int dirent_limit; /* input parameter */ 286 288 int attrmask; /* input parameter */ -
branches/orange-next/src/client/sysint/sys-readdir.sm
r7471 r8933 98 98 PVFS_error PVFS_isys_readdir( 99 99 PVFS_object_ref ref, 100 PVFS_ds_position token, 100 PVFS_kv_position token, 101 uint32_t token_flag, 101 102 int32_t pvfs_dirent_incount, 102 103 const PVFS_credentials *credentials, … … 143 144 sm_p->object_ref = ref; 144 145 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); 146 148 147 149 /* point the sm dirent array and outcount to the readdir response field */ … … 149 151 sm_p->readdir.dirent_outcount = &resp->pvfs_dirent_outcount; 150 152 sm_p->readdir.token = &resp->token; 153 sm_p->readdir.token_flag = &resp->token; 151 154 sm_p->readdir.directory_version = &resp->directory_version; 152 155 … … 170 173 PVFS_error PVFS_sys_readdir( 171 174 PVFS_object_ref ref, 172 PVFS_ds_position token, 175 PVFS_kv_position token, 176 uint32_t token_flag, 173 177 int32_t pvfs_dirent_incount, 174 178 const PVFS_credentials *credentials, … … 181 185 gossip_debug(GOSSIP_CLIENT_DEBUG, "PVFS_sys_readdir entered\n"); 182 186 183 ret = PVFS_isys_readdir(ref, token, pvfs_dirent_incount,187 ret = PVFS_isys_readdir(ref, token, token_flag, pvfs_dirent_incount, 184 188 credentials, resp, &op_id, hints, NULL); 185 189 if (ret) … … 256 260 sm_p->object_ref.handle, 257 261 sm_p->u.readdir.pos_token, 262 sm_p->u.readdir.pos_token_flag, 258 263 sm_p->u.readdir.dirent_limit, 259 264 sm_p->hints); … … 296 301 /* convert servresp_readdir response to a sysresp_readdir obj */ 297 302 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)); 299 305 *(sm_p->readdir.directory_version) = 300 306 resp_p->u.readdir.directory_version; 301 307 *(sm_p->readdir.dirent_outcount) = 302 308 resp_p->u.readdir.dirent_count; 309 *(sm_p->readdir.token_flag( = resp_p->u.readdir.token_flag; 310 303 311 if (*(sm_p->readdir.dirent_outcount) > 0) 304 312 { -
branches/orange-next/src/io/job/job-desc-queue.h
r8476 r8933 36 36 PVFS_error state; 37 37 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; 39 41 PVFS_ds_attributes attr; 40 42 PVFS_ds_type type; -
branches/orange-next/src/io/job/job.c
r8932 r8933 2819 2819 int job_trove_keyval_iterate_keys(PVFS_fs_id coll_id, 2820 2820 PVFS_handle handle, 2821 PVFS_ds_position position, 2821 PVFS_kv_position position, 2822 unsigned int position_flag, 2822 2823 PVFS_ds_keyval * key_array, 2823 2824 int count, … … 2852 2853 jd->u.trove.vtag = vtag; 2853 2854 jd->u.trove.position = position; 2855 jd->u.trove.position_flag = position_flag; 2854 2856 jd->u.trove.count = count; 2855 2857 jd->context_id = context_id; … … 2910 2912 int job_trove_dspace_iterate_handles(PVFS_fs_id coll_id, 2911 2913 PVFS_ds_position position, 2914 unsigned int position_flag, 2912 2915 PVFS_handle* handle_array, 2913 2916 int count, … … 2940 2943 jd->u.trove.vtag = vtag; 2941 2944 jd->u.trove.position = position; 2945 jd->u.trove.position_flag = position_flag; 2942 2946 jd->u.trove.count = count; 2943 2947 jd->context_id = context_id; … … 2949 2953 #ifdef __PVFS2_TROVE_SUPPORT__ 2950 2954 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, 2954 2959 global_trove_context, &(jd->u.trove.id)); 2955 2960 #else … … 6131 6136 int job_precreate_pool_iterate_handles( 6132 6137 PVFS_fs_id fsid, 6133 PVFS_ds_position position, 6138 PVFS_kv_position position, 6139 unsigned int position_flag, 6134 6140 PVFS_handle* handle_array, 6135 6141 int count, … … 6143 6149 PVFS_hint hints) 6144 6150 { 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; 6147 6153 struct qlist_head* iterator; 6148 6154 PVFS_ds_position tmp_index = 1; … … 6156 6162 6157 6163 /* low order bits are the trove iterate position */ 6158 local_position = position & 0xffffffff;6164 local_position.count = position.count; 6159 6165 /* high order bits tell us which pool we are on */ 6160 pool_index = position >> 32;6166 local_position.session = position.session; 6161 6167 6162 6168 /* we start indexing at one and reserve 0 for the special start and end 6163 6169 * values for the entire set of pools 6164 6170 */ 6165 if( pool_index== 0)6171 if(local_position.session == 0) 6166 6172 { 6167 6173 /* 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) 6169 6175 { 6170 6176 pool_index = 1; … … 6172 6178 else 6173 6179 { 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"); 6175 6182 out_status_p->error_code = -PVFS_EINVAL; 6176 6183 return(1); … … 6189 6196 out_status_p->error_code = 0; 6190 6197 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; 6193 6199 return(1); 6194 6200 } … … 6211 6217 out_status_p->error_code = 0; 6212 6218 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; 6215 6220 return(1); 6216 6221 } 6217 6222 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) 6220 6224 { 6221 6225 /* we got all of the handles out of the pool */ … … 6224 6228 /* skip to next pool */ 6225 6229 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; 6229 6232 out_status_p->count = 1; 6230 6233 out_status_p->error_code = 0; … … 6241 6244 return 1; 6242 6245 } 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)); 6244 6248 if(!jd->u.precreate_pool.key_array) 6245 6249 { … … 6256 6260 jd->job_user_ptr = user_ptr; 6257 6261 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; 6259 6265 jd->u.precreate_pool.count = count; 6260 6266 jd->u.precreate_pool.precreate_handle_array = handle_array; 6261 jd->u.precreate_pool.pool_index = pool_index;6262 6267 jd->context_id = context_id; 6263 6268 jd->status_user_tag = status_user_tag; … … 6269 6274 ret = trove_keyval_iterate_keys(fsid, pool->pool_handle, 6270 6275 &(jd->u.precreate_pool.position), 6276 &(jd->u.precreate_pool.position_flag), 6271 6277 jd->u.precreate_pool.key_array, 6272 6278 &(jd->u.precreate_pool.count), flags, NULL, … … 6295 6301 out_status_p->error_code = 0; 6296 6302 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; 6299 6306 out_status_p->count = jd->u.precreate_pool.count; 6300 6307 free(jd->u.precreate_pool.key_array); -
branches/orange-next/src/io/job/job.h
r8496 r8933 31 31 { 32 32 /* 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 */ 42 45 } 43 46 job_status_s; … … 463 466 int job_trove_keyval_iterate(PVFS_fs_id coll_id, 464 467 PVFS_handle handle, 465 PVFS_ds_position position, 468 PVFS_kv_position position, 469 unsigned int position_flag, 466 470 PVFS_ds_keyval * key_array, 467 471 PVFS_ds_keyval * val_array, … … 479 483 int job_trove_keyval_iterate_keys(PVFS_fs_id coll_id, 480 484 PVFS_handle handle, 481 PVFS_ds_position position, 485 PVFS_kv_position position, 486 unsigned int position_flag, 482 487 PVFS_ds_keyval * key_array, 483 488 int count, … … 494 499 int job_trove_dspace_iterate_handles(PVFS_fs_id coll_id, 495 500 PVFS_ds_position position, 501 unsigned int position_flag, 496 502 PVFS_handle* handle_array, 497 503 int count, … … 673 679 int job_precreate_pool_iterate_handles( 674 680 PVFS_fs_id fsid, 675 PVFS_ds_position position, 681 PVFS_kv_position position, 682 unsigned int position_flag, 676 683 PVFS_handle* handle_array, 677 684 int count, -
branches/orange-next/src/io/trove/trove-dbpf/dbpf-dspace.c
r8932 r8933 126 126 PINT_event_type event_type; 127 127 PINT_event_id event_id = 0; 128 PVFS_handle handle;128 TROVE_handle handle; 129 129 130 130 … … 137 137 if( handle_p == NULL ) 138 138 { 139 PVFS_handle_clear(handle);139 TROVE_handle_clear(handle); 140 140 } 141 141 else 142 142 { 143 PVFS_handle_copy(handle, *handle_p);143 TROVE_handle_copy(handle, *handle_p); 144 144 } 145 145 … … 205 205 TROVE_handle new_handle; 206 206 207 PVFS_handle_clear(new_handle);207 TROVE_handle_clear(new_handle); 208 208 209 209 if (op_p->flags & TROVE_FORCE_REQUESTED_HANDLE) … … 214 214 trove_handle_alloc(op_p->coll_p->coll_id, &new_handle); 215 215 216 if ( PVFS_handle_is_null(new_handle) )216 if ( TROVE_handle_is_null(new_handle) ) 217 217 { 218 218 gossip_err("%s: handle allocator returned a zero handle.\n", __func__); … … 231 231 1, PINT_PERF_SUB); 232 232 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); 234 234 return DBPF_OP_COMPLETE; 235 235 } … … 353 353 -- or else something terrible has happened 354 354 */ 355 if ( PVFS_handle_is_null(new_handle))355 if (TROVE_handle_is_null(new_handle)) 356 356 { 357 357 gossip_err("Error: handle allocator returned a zero handle.\n"); … … 367 367 for(j=0; j<=i; j++) 368 368 { 369 if( ! PVFS_handle_is_null(369 if( ! TROVE_handle_is_null( 370 370 op_p->u.d_create_list.out_handle_array_p[j] ) ) 371 371 { … … 383 383 } 384 384 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], 386 386 new_handle); 387 387 } … … 488 488 int count = 0; 489 489 int ret = -TROVE_EINVAL; 490 TROVE_kv_position pos; 490 491 DBT key; 492 493 memset(&pos, 0, sizeof(TROVE_kv_position)); 491 494 492 495 memset(&key, 0, sizeof(key)); … … 535 538 NULL, 536 539 &count, 540 pos, 537 541 TROVE_ITERATE_START, 538 542 PINT_dbpf_dspace_remove_keyval); … … 558 562 559 563 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); 561 565 562 566 for(i=0; i<op_p->u.d_remove_list.count; i++) 563 567 { 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]); 565 569 ref.fs_id = op_p->coll_p->coll_id; 566 570 … … 599 603 600 604 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); 602 606 603 607 ret = remove_one_handle(ref, op_p->coll_p); … … 640 644 static int dbpf_dspace_iterate_handles(TROVE_coll_id coll_id, 641 645 TROVE_ds_position *position_p, 646 unsigned int *position_flag_p, 642 647 TROVE_handle *handle_array, 643 648 int *inout_count_p, … … 655 660 int ret; 656 661 657 PVFS_handle_clear(handle);662 TROVE_handle_clear(handle); 658 663 659 664 coll_p = dbpf_collection_find_registered(coll_id); … … 681 686 /* initialize op-specific members */ 682 687 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; 684 690 op_p->u.d_iterate_handles.count_p = inout_count_p; 685 691 … … 702 708 TROVE_ds_attributes attr; 703 709 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) 705 711 { 706 712 /* already hit end of keyval space; return 1 */ … … 728 734 * need to position with DB_FIRST. 729 735 */ 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)) ) 731 738 { 732 739 /* we need to position the cursor before we can read new … … 736 743 */ 737 744 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); 740 749 key.data = &dummy_handle; 741 750 key.size = key.ulen = sizeof(TROVE_handle); … … 756 765 ret = -dbpf_db_error_to_trove_error(ret); 757 766 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)); 759 769 goto return_error; 760 770 } 761 771 } 762 else 772 else if( *op_p->u.d_iterate_handles.position_flag_p == TROVE_ITERATE_START ) 763 773 { 764 774 memset(&key, 0, sizeof(key)); … … 786 796 } 787 797 } 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], 790 809 dummy_handle); 791 810 ++i; … … 883 902 884 903 /* 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 )) 887 907 { 888 908 gossip_err("Warning: got duplicate handle %llu.\n", … … 926 946 } 927 947 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 ) 931 951 { 932 952 gossip_err("Warning: found duplicate handle: %llu\n", … … 935 955 } 936 956 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; 942 968 goto return_ok; 943 969 } … … 969 995 ret = -dbpf_db_error_to_trove_error(ret); 970 996 } 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) ) 973 1001 { 974 1002 gossip_err("Warning: found duplicate handle: %llu\n", llu(dummy_handle)); … … 976 1004 (*op_p->u.d_iterate_handles.count_p)--; 977 1005 } 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; 979 1009 980 1010 return_ok: … … 982 1012 { 983 1013 /* 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; 985 1016 } 986 1017 /* 'position' points to record we just read, or is set to END */ … … 1527 1558 } 1528 1559 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]); 1530 1561 ref.fs_id = op_p->coll_p->coll_id; 1531 1562 … … 2200 2231 2201 2232 /* 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); 2203 2234 gen_mutex_lock(&dbpf_attr_cache_mutex); 2204 2235 dbpf_attr_cache_insert(ref, &attr); -
branches/orange-next/src/io/trove/trove-dbpf/dbpf-keyval-pcache.c
r7387 r8933 23 23 { 24 24 TROVE_handle handle; 25 TROVE_ ds_position pos;25 TROVE_kv_position pos; 26 26 }; 27 27 … … 29 29 { 30 30 TROVE_handle handle; 31 TROVE_ ds_position pos;31 TROVE_kv_position pos; 32 32 char keyname[PVFS_NAME_MAX]; 33 33 int keylen; … … 92 92 93 93 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) 95 96 return 1; 96 97 return 0; … … 117 118 (struct dbpf_keyval_pcache_entry *)key; 118 119 120 /* FIX: needs refactored for both handle and pos.session/pos.count */ 119 121 uint32_t a = (uint32_t)(key_entry->handle >> 32); 120 122 uint32_t b = (uint32_t)(key_entry->handle & 0x00000000FFFFFFFF); 121 uint 32_t c = (uint32_t)(key_entry->pos);123 uint64_t c = key_entry->pos.session; 122 124 123 125 mix(a,b,c); … … 135 137 PINT_dbpf_keyval_pcache *pcache, 136 138 TROVE_handle handle, 137 TROVE_ ds_position pos,139 TROVE_kv_position pos, 138 140 const void ** keyname, 139 141 int * length) … … 144 146 145 147 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) ); 147 153 148 154 gen_mutex_lock(&pcache->mutex); … … 154 160 gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 155 161 "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); 158 164 } 159 165 else … … 161 167 gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 162 168 "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); 165 171 } 166 172 … … 175 181 gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 176 182 "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); 179 185 180 186 return 0; … … 184 190 PINT_dbpf_keyval_pcache *pcache, 185 191 TROVE_handle handle, 186 TROVE_ ds_position pos,192 TROVE_kv_position pos, 187 193 const char * keyname, 188 194 int length) … … 202 208 203 209 key.handle = handle; 204 key.pos = pos;210 memcpy(&key.pos, &pos, sizeof(PVFS_kv_position)); 205 211 206 212 gen_mutex_lock(&pcache->mutex); … … 213 219 214 220 entry->handle = handle; 215 entry->pos = pos;221 memcpy(&entry->pos, &pos, sizeof(PVFS_kv_position)); 216 222 memcpy(entry->keyname, keyname, length); 217 223 entry->keylen = length; -
branches/orange-next/src/io/trove/trove-dbpf/dbpf-keyval-pcache.h
r6268 r8933 28 28 PINT_dbpf_keyval_pcache *pcache, 29 29 TROVE_handle handle, 30 TROVE_ ds_position pos,30 TROVE_kv_position pos, 31 31 const void ** keyname, 32 32 int * length); … … 35 35 PINT_dbpf_keyval_pcache *pcache, 36 36 TROVE_handle handle, 37 TROVE_ ds_position pos,37 TROVE_kv_position pos, 38 38 const char * keyname, 39 39 int length); -
branches/orange-next/src/io/trove/trove-dbpf/dbpf-keyval.c
r8920 r8933 134 134 static int dbpf_keyval_iterate_step_to_position( 135 135 TROVE_handle handle, 136 TROVE_ ds_position pos,136 TROVE_kv_position pos, 137 137 DBC * dbc_p); 138 138 139 139 static int dbpf_keyval_iterate_skip_to_position( 140 140 TROVE_handle handle, 141 TROVE_ ds_position pos,141 TROVE_kv_position pos, 142 142 PINT_dbpf_keyval_pcache *pcache, 143 143 DBC * dbc_p); … … 795 795 static int dbpf_keyval_iterate(TROVE_coll_id coll_id, 796 796 TROVE_handle handle, 797 TROVE_ds_position *position_p, 797 TROVE_kv_position *position_p, 798 unsigned int *position_flag_p, 798 799 TROVE_keyval_s *key_array, 799 800 TROVE_keyval_s *val_array, … … 838 839 op_p->u.k_iterate.val_array = val_array; 839 840 op_p->u.k_iterate.position_p = position_p; 841 op_p->u.k_iterate.position_flag_p = position_flag_p; 840 842 op_p->u.k_iterate.count_p = inout_count_p; 841 843 op_p->hints = hints; … … 877 879 gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 878 880 "dbpf_keyval_iterate_op_svc: starting: fsid: %u, " 879 "handle: %llu, pos : %llu\n",881 "handle: %llu, pos_flag: %u\n", 880 882 op_p->coll_p->coll_id, 881 883 llu(op_p->handle), 882 llu(*op_p->u.k_iterate.position_p));884 *op_p->u.k_iterate.position_flag_p); 883 885 884 886 /* if they passed in that they are at the end, return 0. … … 886 888 * work right. 887 889 */ 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) 889 891 { 890 892 *op_p->u.k_iterate.count_p = 0; … … 904 906 &count, 905 907 *op_p->u.k_iterate.position_p, 908 *op_p->u.k_iterate.position_flag_p, 906 909 tmp_callback); 907 910 if (ret == -TROVE_ENOENT) 908 911 { 909 *op_p->u.k_iterate.position_ p = TROVE_ITERATE_END;912 *op_p->u.k_iterate.position_flag_p = TROVE_ITERATE_END; 910 913 } 911 914 else if(ret != 0) … … 915 918 else 916 919 { 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; 920 923 /* store a session identifier in the top 32 bits */ 921 924 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; 923 926 readdir_session++; 924 927 } 925 928 else 926 929 { 927 *op_p->u.k_iterate.position_p+= count;930 (*op_p->u.k_iterate.position_p).count += count; 928 931 } 929 932 … … 936 939 op_p->coll_p->pcache, 937 940 op_p->handle, 938 *op_p->u.k_iterate.position_p,941 (*op_p->u.k_iterate.position_p), 939 942 op_p->u.k_iterate.key_array[count-1].buffer, 940 943 op_p->u.k_iterate.key_array[count-1].read_sz); … … 945 948 for(i=0; i<count; i++) 946 949 { 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); 948 952 if(ret < 0) 949 953 { … … 958 962 gossip_debug(GOSSIP_DBPF_KEYVAL_DEBUG, 959 963 "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); 962 968 963 969 return 1; … … 966 972 static int dbpf_keyval_iterate_keys(TROVE_coll_id coll_id, 967 973 TROVE_handle handle, 968 TROVE_ds_position *position_p, 974 TROVE_kv_position *position_p, 975 unsigned int *position_flag_p, 969 976 TROVE_keyval_s *key_array, 970 977 int *inout_count_p, … … 1007 1014 op_p->u.k_iterate_keys.key_array = key_array; 1008 1015 op_p->u.k_iterate_keys.position_p = position_p; 1016 op_p->u.k_iterate_keys.position_flag_p = position_flag_p; 1009 1017 op_p->u.k_iterate_keys.count_p = inout_count_p; 1010 1018 op_p->hints = hints; … … 1045 1053 * work right. 1046 1054 */ 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) 1048 1056 { 1049 1057 *op_p->u.k_iterate_keys.count_p = 0; … … 1064 1072 &count, 1065 1073 *op_p->u.k_iterate_keys.position_p, 1074 *op_p->u.k_iterate_keys.position_flag_p, 1066 1075 tmp_callback); 1067 1076 if (ret == -TROVE_ENOENT) 1068 1077 { 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; 1070 1079 } 1071 1080 else if(ret != 0) … … 1075 1084 else 1076 1085 { 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; 1080 1089 } 1081 1090 else 1082 1091 { 1083 *op_p->u.k_iterate_keys.position_p+= count;1092 (*op_p->u.k_iterate_keys.position_p).count += count; 1084 1093 } 1085 1094 … … 1097 1106 for(i=0; i<count; i++) 1098 1107 { 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); 1100 1110 if(ret < 0) 1101 1111 { … … 1497 1507 TROVE_keyval_s *values_array, 1498 1508 int *count, 1499 TROVE_ds_position pos, 1509 TROVE_kv_position pos, 1510 unsigned int pos_flag, 1500 1511 PINT_dbpf_keyval_iterate_callback callback) 1501 1512 { … … 1526 1537 } 1527 1538 1528 if(pos == TROVE_ITERATE_START)1539 if(pos_flag == TROVE_ITERATE_START) 1529 1540 { 1530 1541 ret = dbpf_keyval_iterate_get_first_entry(handle, dbc_p); … … 1725 1736 static int dbpf_keyval_iterate_skip_to_position( 1726 1737 TROVE_handle handle, 1727 TROVE_ ds_position pos,1738 TROVE_kv_position pos, 1728 1739 PINT_dbpf_keyval_pcache *pcache, 1729 1740 DBC * dbc_p) … … 1731 1742 int ret = 0; 1732 1743 TROVE_keyval_s key; 1733 1734 assert(pos != TROVE_ITERATE_START);1735 1744 1736 1745 memset(&key, 0, sizeof(TROVE_keyval_s)); … … 1748 1757 * integer offset if we get past the cache 1749 1758 */ 1750 pos = pos & 0xffffffff;1759 pos.session = 0; 1751 1760 return dbpf_keyval_iterate_step_to_position(handle, pos, dbc_p); 1752 1761 } … … 1776 1785 static int dbpf_keyval_iterate_step_to_position( 1777 1786 TROVE_handle handle, 1778 TROVE_ ds_position pos,1787 TROVE_kv_position pos, 1779 1788 DBC * dbc_p) 1780 1789 { … … 1783 1792 TROVE_keyval_s key; 1784 1793 1785 assert(pos != TROVE_ITERATE_START);1786 1787 1794 ret = dbpf_keyval_iterate_get_first_entry(handle, dbc_p); 1788 1795 if(ret != 0) … … 1791 1798 } 1792 1799 1793 for(i = 0; i < pos ; ++i)1800 for(i = 0; i < pos.count; ++i) 1794 1801 { 1795 1802 memset(&key, 0, sizeof(TROVE_keyval_s)); -
branches/orange-next/src/io/trove/trove-dbpf/dbpf-mgmt.c
r8860 r8933 1498 1498 1499 1499 int dbpf_collection_iterate(TROVE_ds_position *inout_position_p, 1500 unsigned int *inout_position_flag_p, 1500 1501 TROVE_keyval_s *name_array, 1501 1502 TROVE_coll_id *coll_id_array, … … 1514 1515 1515 1516 /* 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) 1517 1518 { 1518 1519 *inout_count_p = 0; … … 1532 1533 1533 1534 /* 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 ) 1535 1536 { 1536 1537 /* need to position cursor before reading. note that this … … 1544 1545 key.data = name_array[0].buffer; 1545 1546 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; 1547 1548 key.size = sizeof(db_recno_t); 1548 1549 key.flags |= DB_DBT_USERMEM; … … 1565 1566 } 1566 1567 } 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 } 1567 1575 1568 1576 for (i = 0; i < *inout_count_p; i++) … … 1594 1602 if (ret == DB_NOTFOUND) 1595 1603 { 1596 *inout_position_ p = TROVE_ITERATE_END;1604 *inout_position_flag_p = TROVE_ITERATE_END; 1597 1605 } 1598 1606 else … … 1630 1638 } 1631 1639 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; 1635 1642 } 1636 1643 /* -
branches/orange-next/src/io/trove/trove-dbpf/dbpf-op.c
r7387 r8933 41 41 q_op_p->op.type = type; 42 42 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); 44 44 q_op_p->op.coll_p = coll_p; 45 45 q_op_p->op.svc_fn = svc_fn; -
branches/orange-next/src/io/trove/trove-dbpf/dbpf-op.h
r7471 r8933 24 24 (_op).type = _type; \ 25 25 (_op).state = OP_NOT_QUEUED; \ 26 (_op).handle = _handle; \26 TROVE_handle_copy((_op).handle, _handle); \ 27 27 (_op).coll_p = _coll_p; \ 28 28 (_op).svc_fn = _svc_fn; \ -
branches/orange-next/src/io/trove/trove-dbpf/dbpf.h
r8496 r8933 191 191 TROVE_keyval_s *values_array, 192 192 int *count, 193 TROVE_ds_position pos, 193 TROVE_kv_position pos, 194 unsigned int pos_flag, 194 195 PINT_dbpf_keyval_iterate_callback callback); 195 196 … … 286 287 TROVE_handle *handle_array; 287 288 TROVE_ds_position *position_p; 289 unsigned int *position_flag_p; 288 290 int *count_p; 289 291 }; … … 367 369 TROVE_keyval_s *key_array; 368 370 TROVE_keyval_s *val_array; 369 TROVE_ds_position *position_p; 371 TROVE_kv_position *position_p; 372 unsigned int *position_flag_p; 370 373 int *count_p; 371 374 /* vtag? */ … … 375 378 { 376 379 TROVE_keyval_s *key_array; 377 TROVE_ds_position *position_p; 380 TROVE_kv_position *position_p; 381 unsigned int *position_flag_p; 378 382 int *count_p; 379 383 /* vtag? */ … … 724 728 725 729 int dbpf_collection_iterate(TROVE_ds_position *inout_position_p, 730 unsigned int *inout_postition_flag_p, 726 731 TROVE_keyval_s *name_array, 727 732 TROVE_coll_id *coll_id_array, -
branches/orange-next/src/io/trove/trove-internal.h
r8496 r8933 182 182 TROVE_coll_id coll_id, 183 183 TROVE_handle handle, 184 TROVE_ds_position *inout_position_p, 184 TROVE_kv_position *inout_position_p, 185 unsigned int *inout_position_flag_p, 185 186 TROVE_keyval_s *out_key_array, 186 187 TROVE_keyval_s *out_val_array, … … 196 197 TROVE_coll_id coll_id, 197 198 TROVE_handle handle, 198 TROVE_ds_position *inout_position_p, 199 TROVE_kv_position *inout_position_p, 200 unsigned int *inout_position_flag_p, 199 201 TROVE_keyval_s *out_key_array, 200 202 int *inout_count_p, … … 301 303 TROVE_coll_id coll_id, 302 304 TROVE_ds_position *position_p, 305 unsigned int *position_flag_p, 303 306 TROVE_handle *handle_array, 304 307 int *inout_count_p, -
branches/orange-next/src/io/trove/trove-mgmt.c
r7959 r8933 226 226 int trove_collection_iterate(TROVE_method_id method_id, 227 227 TROVE_ds_position *inout_position_p, 228 unsigned int *inout_position_flag_p, 228 229 TROVE_keyval_s *name_array, 229 230 TROVE_coll_id *coll_id_array, … … 235 236 { 236 237 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); 239 240 240 241 return ((ret < 0) ? ret : 1); -
branches/orange-next/src/io/trove/trove-migrate.c
r8659 r8933 432 432 int outstanding_op_count; 433 433 int immediate_completion; 434 unsigned int pos_flag; 434 435 435 436 base_count = 10000; 436 437 438 TROVE_handle_clear(pos); 439 437 440 handles = malloc(sizeof(TROVE_handle)*base_count); 438 441 if (!handles) … … 506 509 } 507 510 508 pos = TROVE_ITERATE_START;511 pos_flag = TROVE_ITERATE_START; 509 512 510 513 do … … 515 518 ret = trove_dspace_iterate_handles(coll_id, 516 519 &pos, 520 &pos_flag, 517 521 handles, 518 522 &handle_count, … … 525 529 { 526 530 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,531 ret=%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, 529 533 llu(context_id), llu(iterate_op_id)); 530 534 goto complete; -
branches/orange-next/src/io/trove/trove-types.h
r8930 r8933 40 40 typedef PVFS_ds_keyval_handle_info TROVE_keyval_handle_info; 41 41 typedef PVFS_ds_position TROVE_ds_position; 42 typedef PVFS_kv_position TROVE_kv_position; 43 typedef PVFS_rec_position TROVE_rec_position; 42 44 typedef PVFS_ds_attributes TROVE_ds_attributes_s; 43 45 typedef PVFS_ds_attributes TROVE_ds_attributes; … … 50 52 /* PVFS_handle to TROVE_handle helper function mappings */ 51 53 #define TROVE_handle_clear(u) PVFS_handle_clear(u) 52 #define TROVE_handle_compare(u1, u2) PVFS_handle_comp uare(u1, u2)54 #define TROVE_handle_compare(u1, u2) PVFS_handle_compare(u1, u2) 53 55 #define TROVE_handle_copy(dst, src) PVFS_handle_copy(dst, src) 54 56 #define TROVE_handle_generate(u) PVFS_handle_generate(u) -
branches/orange-next/src/io/trove/trove.h
r8496 r8933 36 36 enum 37 37 { 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 40 41 }; 41 42 … … 157 158 TROVE_method_id method_id, 158 159 TROVE_ds_position *inout_position_p, 160 unsigned int *inout_position_flag_p, 159 161 TROVE_keyval_s *name_array, 160 162 TROVE_coll_id *coll_id_array, … … 303 305 TROVE_coll_id coll_id, 304 306 TROVE_handle handle, 305 TROVE_ds_position *position_p, 307 TROVE_kv_position *position_p, 308 unsigned int *position_flag_p, 306 309 TROVE_keyval_s *key_array, 307 310 TROVE_keyval_s *val_array, … … 317 320 TROVE_coll_id coll_id, 318 321 TROVE_handle handle, 319 TROVE_ds_position *position_p, 322 TROVE_kv_position *position_p, 323 unsigned int *position_flag_p, 320 324 TROVE_keyval_s *key_array, 321 325 int *inout_count_p, … … 426 430 int trove_dspace_iterate_handles(TROVE_coll_id coll_id, 427 431 TROVE_ds_position *position_p, 432 unsigned int *position_flag_p, 428 433 TROVE_handle *handle_array, 429 434 int *inout_count_p, -
branches/orange-next/src/kernel/linux-2.6/upcall.h
r8215 r8933 88 88 PVFS_object_ref refn; 89 89 PVFS_ds_position token; 90 uint32_t token_flag; 90 91 int32_t max_dirent_count; 91 92 int32_t buf_index; -
branches/orange-next/src/proto/pvfs2-req-proto.h
r8929 r8933 923 923 PVFS_handle handle; /* handle of dir object */ 924 924 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; 926 927 uint32_t dirent_count; /* desired # of entries */ 927 928 }; 928 endecode_fields_ 4_struct(929 endecode_fields_5_struct( 929 930 PVFS_servreq_readdir, 930 931 PVFS_handle, handle, 931 932 PVFS_fs_id, fs_id, 932 933 uint32_t, dirent_count, 933 PVFS_ds_position, token); 934 PVFS_kv_position, token, 935 uint32_t, token_flag); 934 936 935 937 #define PINT_SERVREQ_READDIR_FILL(__req, \ … … 938 940 __handle, \ 939 941 __token, \ 942 __token_flag, \ 940 943 __dirent_count, \ 941 944 __hints) \ … … 947 950 (__req).u.readdir.fs_id = (__fsid); \ 948 951 (__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); \ 950 955 (__req).u.readdir.dirent_count = (__dirent_count);\ 951 956 } while (0); … … 953 958 struct PVFS_servresp_readdir 954 959 { 955 PVFS_ds_position token; /* new dir offset */ 960 PVFS_kv_position token; /* new dir offset */ 961 uint32_t token_flag; /* new dir offset */ 956 962 /* array of directory entries */ 957 963 PVFS_dirent *dirent_array; … … 959 965 uint64_t directory_version; 960 966 }; 961 endecode_fields_ 3a_struct(967 endecode_fields_4a_struct( 962 968 PVFS_servresp_readdir, 963 PVFS_ds_position, token, 969 PVFS_kv_position, token, 970 uint32_t, token_flag, 964 971 uint64_t, directory_version, 965 972 skip4,, … … 1590 1597 /* mgmt_iterate_handles ***************************************/ 1591 1598 /* 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 */ 1593 1601 struct PVFS_servreq_mgmt_iterate_handles 1594 1602 { … … 1596 1604 int32_t handle_count; 1597 1605 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 }; 1610 endecode_fields_7_struct( 1601 1611 PVFS_servreq_mgmt_iterate_handles, 1602 1612 PVFS_fs_id, fs_id, 1603 1613 int32_t, handle_count, 1604 1614 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) \ 1629 do { \ 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); \ 1623 1642 } while (0) 1624 1643 1625 1644 struct PVFS_servresp_mgmt_iterate_handles 1626 1645 { 1627 PVFS_ds_position position; 1646 PVFS_kv_position kv_position; 1647 PVFS_ds_position ds_position; 1648 unsigned int position_flag; 1628 1649 PVFS_handle *handle_array; 1629 1650 int handle_count; 1630 1651 }; 1631 endecode_fields_ 2a_struct(1652 endecode_fields_4a_struct( 1632 1653 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, 1634 1657 skip4,, 1635 1658 int32_t, handle_count, … … 1863 1886 struct PVFS_servreq_listeattr 1864 1887 { 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 }; 1895 endecode_fields_5a_struct( 1872 1896 PVFS_servreq_listeattr, 1873 1897 PVFS_handle, handle, 1874 1898 PVFS_fs_id, fs_id, 1875 skip4,, 1876 PVFS_ds_position, token, 1899 PVFS_kv_position, token, 1900 skip4,, 1901 uint32_t, token_flag, 1877 1902 uint32_t, nkey, 1878 1903 PVFS_size, keysz); … … 1885 1910 __handle, \ 1886 1911 __token, \ 1912 __token_flag, \ 1887 1913 __nkey, \ 1888 1914 __size_array, \ … … 1895 1921 (__req).u.listeattr.fs_id = (__fsid); \ 1896 1922 (__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); \ 1898 1926 (__req).u.listeattr.nkey = (__nkey); \ 1899 1927 (__req).u.listeattr.keysz = (__size_array); \ … … 1902 1930 struct PVFS_servresp_listeattr 1903 1931 { 1904 PVFS_ds_position token; /* new dir offset */ 1932 PVFS_kv_position token; /* new dir offset */ 1933 uint32_t token_flag; 1905 1934 uint32_t nkey; /* # of keys retrieved */ 1906 1935 PVFS_ds_keyval *key; /* array of keys returned */ 1907 1936 }; 1908 endecode_fields_ 2a_struct(1937 endecode_fields_3a_struct( 1909 1938 PVFS_servresp_listeattr, 1910 PVFS_ds_position, token, 1911 skip4,, 1939 PVFS_kv_position, token, 1940 skip4,, 1941 uint32_t, token_flag, 1912 1942 uint32_t, nkey, 1913 1943 PVFS_ds_keyval, key); -
branches/orange-next/src/server/iterate-handles.sm
r8929 r8933 88 88 } 89 89 90 s_op->resp.u.mgmt_iterate_handles.position91 = s_op->req->u.mgmt_iterate_handles.position;92 93 90 if(s_op->req->u.mgmt_iterate_handles.flags == PVFS_MGMT_RESERVED) 94 91 { … … 96 93 * allocated by precreate 97 94 */ 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)); 98 98 ret = job_precreate_pool_iterate_handles( 99 99 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, 101 102 s_op->resp.u.mgmt_iterate_handles.handle_array, 102 103 s_op->req->u.mgmt_iterate_handles.handle_count, … … 112 113 else if(s_op->req->u.mgmt_iterate_handles.flags == 0) 113 114 { 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)); 114 118 ret = job_trove_dspace_iterate_handles( 115 119 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, 117 122 s_op->resp.u.mgmt_iterate_handles.handle_array, 118 123 s_op->req->u.mgmt_iterate_handles.handle_count, … … 155 160 156 161 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 } 159 177 return SM_ACTION_COMPLETE; 160 178 } -
branches/orange-next/src/server/list-eattr.sm
r8866 r8933 162 162 s_op->req->u.listeattr.handle, 163 163 s_op->req->u.listeattr.token, 164 s_op->req->u.listeattr.token_flag, 164 165 s_op->resp.u.listeattr.key, 165 166 s_op->req->u.listeattr.nkey, … … 212 213 if (s_op->resp.u.listeattr.nkey == 0) 213 214 { 214 s_op->resp.u.listeattr.token = js_p->count;215 s_op->resp.u.listeattr.token.count = js_p->count; 215 216 js_p->error_code = 0; 216 217 return SM_ACTION_COMPLETE; … … 224 225 } 225 226 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)); 227 229 s_op->resp.u.listeattr.nkey = num_found; 228 230 -
branches/orange-next/src/server/readdir.sm
r7471 r8933 195 195 gossip_debug( 196 196 GOSSIP_READDIR_DEBUG, " - iterating keyvals: [%llu,%d], " 197 "\n\ttoken =%llu, count=%d\n",197 "\n\ttoken_flag=%u, count=%d\n", 198 198 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, 200 200 s_op->req->u.readdir.dirent_count); 201 201 202 202 ret = job_trove_keyval_iterate( 203 203 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, 206 206 0, 207 207 NULL, smcb, 0, js_p, … … 239 239 * interface users could break because of this... 240 240 */ 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 242 245 js_p->error_code = 0; 243 246 return SM_ACTION_COMPLETE; -
branches/orange-next/src/server/remove.sm
r8932 r8933 259 259 int ret; 260 260 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; 261 266 262 267 if (js_p->error_code) … … 270 275 s_op->req->u.remove.fs_id, 271 276 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, 274 279 &s_op->u.remove.key, 275 280 1, -
branches/orange-next/src/server/setparam.sm
r8929 r8933 188 188 { 189 189 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; 191 192 TROVE_keyval_s name; 192 193 TROVE_coll_id tmp_coll; … … 208 209 ret = trove_collection_iterate( 209 210 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); 211 212 212 213 if (ret == 0)
