Triton Repository branch, master, updated. 2e6c4841ce062739de191721e7a85aebcd65d7aa
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Triton Repository". The branch, master has been updated via 2e6c4841ce062739de191721e7a85aebcd65d7aa (commit) via d0177bc24a22e8b823925d2dda7735bd477beff3 (commit) from f3855cfbc4fe3fc1d69c6346303dc207bb995ade (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2e6c4841ce062739de191721e7a85aebcd65d7aa Author: Phil Carns <[email protected]> Date: Wed Apr 28 11:14:53 2010 -0400 partial progress on vosd_read() commit d0177bc24a22e8b823925d2dda7735bd477beff3 Author: Phil Carns <[email protected]> Date: Wed Apr 28 09:42:34 2010 -0400 disable fakess build if mpi not present ----------------------------------------------------------------------- Summary of changes: code/src/fakess/module.mk.in | 4 + code/src/versioned-osd/prototype/versioned-osd.ae | 206 +++++++++++++++++++- code/src/versioned-osd/prototype/versioned-osd.hae | 2 +- 3 files changed, 207 insertions(+), 5 deletions(-) Diff of changes: diff --git a/code/src/fakess/module.mk.in b/code/src/fakess/module.mk.in index 8032547..e9c8cc8 100644 --- a/code/src/fakess/module.mk.in +++ b/code/src/fakess/module.mk.in @@ -1,8 +1,12 @@ DIR := src/fakess +ifneq (,$(BUILD_MPI)) + AELIBSRC += $(DIR)/fakess.ae MODCFLAGS_$(DIR)/fakess = $(MPICFLAGS) MODLDFLAGS_$(DIR)/fakess = $(MPILDFLAGS) MODLIBS_$(DIR)/fakess = $(MPILIBS) MODCC_$(DIR)/fakess = $(MPICC) + +endif # BUILD_MPI diff --git a/code/src/versioned-osd/prototype/versioned-osd.ae b/code/src/versioned-osd/prototype/versioned-osd.ae index c25789a..4b96584 100644 --- a/code/src/versioned-osd/prototype/versioned-osd.ae +++ b/code/src/versioned-osd/prototype/versioned-osd.ae @@ -317,7 +317,7 @@ static __blocking triton_ret_t __vosd_txn_close_retryable( int64_t missing_ver; DBT mv_key, mv_value; struct missing_version mv; - void* free_ptr; + void* free_ptr = NULL; DBC *dbc_p = NULL; struct logical_map_key lmk; triton_ret_t tret; @@ -387,7 +387,6 @@ static __blocking triton_ret_t __vosd_txn_close_retryable( if(tret != TRITON_SUCCESS) { free_logical_map_list(&on_disk_entries); - free(free_ptr); tret_tmp = bdb_txn_abort(txn); #if 0 triton_err_destroy(tret_tmp); @@ -506,6 +505,162 @@ static __blocking triton_ret_t __vosd_txn_close_retryable( return(tret); } + +#if 0 +static __blocking triton_ret_t __get_read_region_retryable( + struct logical_map_key* lmk, struct logical_map_entry* lme) +#endif + +static __blocking triton_ret_t __get_read_region_retryable( + struct logical_map_key* lmk, struct logical_map_entry* lme) +{ + DB_TXN *txn; + DBT key, value; + triton_ret_t tret; + triton_ret_t tret_tmp; + DBC *dbc_p = NULL; + + tret = bdb_txn_begin(envp, NULL, &txn, 0); + if(tret != TRITON_SUCCESS) + { + return(tret); + } + + /* create a cursor to move through logical map db */ + tret = bdb_cursor(log_map_dbp, txn, &dbc_p, 0); + if(tret != TRITON_SUCCESS) + { + tret_tmp = bdb_txn_abort(txn); +#if 0 + triton_err_destroy(tret_tmp); +#endif + return(tret); + } + VOSD_INIT_DBT(key, (*lmk)); + VOSD_INIT_DBT(value, (*lme)); + + tret = bdb_cursor_get(dbc_p, &key, &value, DB_SET_RANGE); + /* return whatever error code we got here */ + + tret_tmp = bdb_cursor_close(dbc_p); +#if 0 + triton_err_destroy(tret_tmp); +#endif + tret_tmp = bdb_txn_commit(txn, 0); +#if 0 + triton_err_destroy(tret_tmp); +#endif + + return(tret); +} + +#if 0 +static __blocking triton_ret_t get_read_region( + struct logical_map_key* lmk, struct logical_map_entry* lme) +#endif + +static __blocking triton_ret_t get_read_region( + struct logical_map_key* lmk, struct logical_map_entry* lme) +{ + struct logical_map_key lmk_orig = *lmk; + triton_ret_t tret; + + for(tret = TRITON_ERR_DEADLOCK; tret == TRITON_ERR_DEADLOCK; ) + { +#if 0 + triton_error_destroy(tret); +#endif + *lmk = lmk_orig; + tret = __get_read_region_retryable(lmk, lme); + } + + if(tret == TRITON_SUCCESS && + (lmk->oid != lmk_orig.oid || lmk->fork != lmk_orig.fork)) + { + /* We overshot the object that we were looking for (EOF, in other + * words). Return NOENT to caller. + */ + return(TRITON_ERR_NOENT); + } + + return(tret); +} + +#if 0 +static __blocking triton_ret_t read_segment( + uint64_t oid, + uint64_t fork, + char* mem_offset, + int64_t mem_size, + int64_t obj_offset, + int64_t obj_size, + int64_t *amt_read); +#endif + +static __blocking triton_ret_t read_segment( + uint64_t oid, + uint64_t fork, + char* mem_offset, + int64_t mem_size, + int64_t obj_offset, + int64_t obj_size, + int64_t *amt_read) +{ + struct logical_map_entry lme; + struct logical_map_key lmk; + triton_ret_t tret; + struct fd_cache_entry* fd_entry; + + /* get a file descriptor */ + tret = fd_cache_get(&fd_entry, oid); + if(tret != TRITON_SUCCESS) + { + return(tret); + } + + /* look for logical mapping for the object offset we need to access */ + lmk.oid = oid; + lmk.fork = fork; + lmk.logical_offset_end = obj_offset + 1; + + /* look for logical mapping for the object offset we need to access */ + /* NOTE: reads do not have to be atomic. It is possible (and legal + * in our semantics) for each region to see a different logical view + * if concurrent writes are modifying the log + */ + tret = get_read_region(&lmk, &lme); + if(tret != TRITON_SUCCESS) + { + fd_cache_put(fd_entry); + return(tret); + } + + if(lme.logical_offset > obj_offset) + { + /* hit a "hole" in the object, no data in this extent yet */ + int64_t amt_to_zero; + + /* figure out how big the hole is (in object) */ + if(obj_size > (lme.logical_offset - obj_offset)) + amt_to_zero = lme.logical_offset - obj_offset; + else + amt_to_zero = obj_size; + + /* how big is the memory segment we are working on? */ + if(mem_size < amt_to_zero) + amt_to_zero = mem_size; + + memset(mem_offset, 0, amt_to_zero); + *amt_read = amt_to_zero; + return(TRITON_SUCCESS); + } + + /* TODO: pick up here */ + + + return(TRITON_ERR_NOSYS); +} + triton_ret_t vosd_init(const char* path) { triton_ret_t tret; @@ -1234,7 +1389,7 @@ __blocking triton_ret_t vosd_txn_close( } -__blocking triton_ret_t gs_cosd_read( +__blocking triton_ret_t vosd_read( uint64_t oid, uint64_t fork, char** mem_offsets, @@ -1245,8 +1400,51 @@ __blocking triton_ret_t gs_cosd_read( int obj_count, int64_t* out_size) { + triton_ret_t tret; + int done = 0; + int64_t amt_read = 0; + int mem_index = 0; + int obj_index = 0; + + *out_size = 0; - return(TRITON_ERR_NOSYS); + /* TODO: safety check that total mem size equals total obj size */ + /* TODO: safety check no zero buffers in either list */ + + while(!done) + { + /* try to read one piece */ + tret = read_segment(oid, fork, mem_offsets[mem_index], + mem_sizes[mem_index], obj_offsets[obj_index], obj_sizes[obj_index], + &amt_read); + if(tret == TRITON_ERR_NOENT) + { + /* hit eof, return success with what we have so far (short read) */ +#if 0 + triton_err_destroy(tret); +#endif + return(TRITON_SUCCESS); + } + if(tret != TRITON_SUCCESS) + { + return(tret); + } + + /* move to next segment */ + done = advance_listio_ptrs( + mem_offsets, + mem_sizes, + mem_count, + &mem_index, + obj_offsets, + obj_sizes, + obj_count, + &obj_index, + amt_read); + *out_size += amt_read; + } + + return(TRITON_SUCCESS); } diff --git a/code/src/versioned-osd/prototype/versioned-osd.hae b/code/src/versioned-osd/prototype/versioned-osd.hae index d43c3f0..39dd7d0 100644 --- a/code/src/versioned-osd/prototype/versioned-osd.hae +++ b/code/src/versioned-osd/prototype/versioned-osd.hae @@ -94,7 +94,7 @@ __blocking triton_ret_t vosd_txn_close( /** * Reads data from an object */ -__blocking triton_ret_t gs_cosd_read( +__blocking triton_ret_t vosd_read( uint64_t oid, /**< object to operate on */ uint64_t fork, /**< object fork to operate on */ char** mem_offsets, /**< memory region pointers */ hooks/post-receive -- Triton Repository
participants (1)
-
noreply@mcs.anl.gov