Triton-commits
Threads by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2010
- 1 participants
- 13 discussions
Triton Repository branch, master, updated. b7dc68eef2cbbf499c8d1a7f87a2e1e4e4b6e683
by noreply@mcs.anl.gov 29 Jul '10
by noreply@mcs.anl.gov 29 Jul '10
29 Jul '10
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 b7dc68eef2cbbf499c8d1a7f87a2e1e4e4b6e683 (commit)
from cecec3e2e49839556db09fa697380158853d07e4 (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 b7dc68eef2cbbf499c8d1a7f87a2e1e4e4b6e683
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Thu Jul 29 13:47:16 2010 -0400
add niid argument to relevant vosd functions
-----------------------------------------------------------------------
Summary of changes:
.../prototype/tests/vosd-bench-concurrent.ae | 6 +-
.../prototype/tests/vosd-multi-object.ae | 8 ++--
code/src/versioned-osd/prototype/tests/vosd1.ae | 54 ++++++++++----------
code/src/versioned-osd/prototype/versioned-osd.ae | 51 ++++++++++++++----
code/src/versioned-osd/prototype/versioned-osd.hae | 23 ++++++---
5 files changed, 88 insertions(+), 54 deletions(-)
Diff of changes:
diff --git a/code/src/versioned-osd/prototype/tests/vosd-bench-concurrent.ae b/code/src/versioned-osd/prototype/tests/vosd-bench-concurrent.ae
index 06e6411..0b9b098 100644
--- a/code/src/versioned-osd/prototype/tests/vosd-bench-concurrent.ae
+++ b/code/src/versioned-osd/prototype/tests/vosd-bench-concurrent.ae
@@ -48,7 +48,7 @@ static __blocking int do_vosd_test(void)
if(data_mode == 'k')
w_flags |= VOSD_FLAG_TRUNC_WRITE;
- tret = vosd_create(oid);
+ tret = vosd_create(oid, 0);
if(tret == TRITON_ERR_EXIST)
{
printf("# operating on existing object.\n");
@@ -120,7 +120,7 @@ static __blocking int do_vosd_test(void)
{
b_ret = vosd_write(oid, fork, b_version, &buffer,
&tmp_op->size, 1, &tmp_op->offset,
- &tmp_op->size, 1, w_flags);
+ &tmp_op->size, 1, w_flags, 0);
assert(b_ret == TRITON_SUCCESS);
}
else
@@ -128,7 +128,7 @@ static __blocking int do_vosd_test(void)
assert(tmp_op->type == READ);
b_ret = vosd_read(oid, fork, &buffer, &tmp_op->size, 1,
- &tmp_op->offset, &tmp_op->size, 1, &out_size);
+ &tmp_op->offset, &tmp_op->size, 1, &out_size, 0);
assert(b_ret == TRITON_SUCCESS);
assert(out_size == tmp_op->size);
}
diff --git a/code/src/versioned-osd/prototype/tests/vosd-multi-object.ae b/code/src/versioned-osd/prototype/tests/vosd-multi-object.ae
index 2b69854..1e503df 100644
--- a/code/src/versioned-osd/prototype/tests/vosd-multi-object.ae
+++ b/code/src/versioned-osd/prototype/tests/vosd-multi-object.ae
@@ -33,7 +33,7 @@ static __blocking int do_vosd_test(void)
for(i=0; i<500; i++)
{
oid = triton_uint128_from_uint64(i+1);
- tret = vosd_create(oid);
+ tret = vosd_create(oid, 0);
if(tret != TRITON_SUCCESS && tret != TRITON_ERR_EXIST)
{
printf("Error creating oid=%llu\n", llu(i+1));
@@ -69,7 +69,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 0;
obj_szs[0] = 1024;
tret = vosd_write(oid, 0, version_array[i], buffer_offsets, buffer_szs, 1,
- obj_offsets, obj_szs, 1, VOSD_FLAG_AUTO_TXN);
+ obj_offsets, obj_szs, 1, VOSD_FLAG_AUTO_TXN, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error writing 0-1024 on oid=%llu: %d\n", llu(i+1), ret);
@@ -89,7 +89,7 @@ static __blocking int do_vosd_test(void)
{
oid = triton_uint128_from_uint64(i+1);
- tret = vosd_remove(oid);
+ tret = vosd_remove(oid, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error deleting oid=%llu\n", i+1);
@@ -106,7 +106,7 @@ static __blocking int do_vosd_test(void)
/* try to delete something that doesn't exist */
oid = triton_uint128_from_uint64(0);
- tret = vosd_remove(oid);
+ tret = vosd_remove(oid, 0);
assert(tret == TRITON_ERR_NOENT);
#if 0
triton_error_destroy(tret);
diff --git a/code/src/versioned-osd/prototype/tests/vosd1.ae b/code/src/versioned-osd/prototype/tests/vosd1.ae
index d35a16c..17fa278 100644
--- a/code/src/versioned-osd/prototype/tests/vosd1.ae
+++ b/code/src/versioned-osd/prototype/tests/vosd1.ae
@@ -35,7 +35,7 @@ static __blocking int do_vosd_test(void)
buffer = void_buffer;
printf("Creating oid 1 ...\n");
- tret = vosd_create(oid);
+ tret = vosd_create(oid, 0);
if(tret != TRITON_SUCCESS && tret != TRITON_ERR_EXIST)
{
free(buffer);
@@ -76,7 +76,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
- tret = vosd_txn_open(oid, 0, (++version));
+ tret = vosd_txn_open(oid, 0, (++version), 0);
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1.\n");
@@ -94,7 +94,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 0;
obj_szs[0] = 1024;
tret = vosd_write(oid, 0, (version), buffer_offsets, buffer_szs, 1,
- obj_offsets, obj_szs, 1, 0);
+ obj_offsets, obj_szs, 1, 0, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error writing 0-1024.\n");
@@ -133,7 +133,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
version = version+2;
- tret = vosd_txn_open(oid, 0, (version));
+ tret = vosd_txn_open(oid, 0, (version), 0);
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1: %d\n", ret);
@@ -157,7 +157,7 @@ static __blocking int do_vosd_test(void)
obj_szs[0] = 100;
obj_szs[1] = 924;
tret = vosd_write(oid, 0, (version), buffer_offsets, buffer_szs, 3,
- obj_offsets, obj_szs, 2, 0);
+ obj_offsets, obj_szs, 2, 0, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error writing with listio: %d\n", ret);
@@ -195,7 +195,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
- tret = vosd_txn_open(oid, 0, (version-1));
+ tret = vosd_txn_open(oid, 0, (version-1), 0);
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1: %d\n", ret);
@@ -213,7 +213,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 200;
obj_szs[0] = 4096;
tret = vosd_write(oid, 0, (version-1), buffer_offsets, buffer_szs, 1,
- obj_offsets, obj_szs, 1, 0);
+ obj_offsets, obj_szs, 1, 0, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error writing with listio: %d\n", ret);
@@ -256,7 +256,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 1024;
obj_szs[0] = 512;
tret = vosd_read(oid, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
- obj_szs, 1, &out_size);
+ obj_szs, 1, &out_size, 0);
assert(out_size == 512);
if(tret != TRITON_SUCCESS)
{
@@ -276,7 +276,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 51200;
obj_szs[0] = 512;
tret = vosd_read(oid, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
- obj_szs, 1, &out_size);
+ obj_szs, 1, &out_size, 0);
if(tret != TRITON_SUCCESS || out_size != 0)
{
printf("Error: bad error code or out size from EOF read\n");
@@ -290,7 +290,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("checking size of fork 0...\n");
- tret = vosd_get_size(oid, 0, obj_offsets);
+ tret = vosd_get_size(oid, 0, obj_offsets, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error: bad error code from vosd_get_size()\n");
@@ -303,7 +303,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("checking size of fork 1...\n");
- tret = vosd_get_size(oid, 1, obj_offsets);
+ tret = vosd_get_size(oid, 1, obj_offsets, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error: bad error code from vosd_get_size()\n");
@@ -324,7 +324,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 13;
obj_szs[0] = 1524;
tret = vosd_read(oid, 0, buffer_offsets, buffer_szs, 2, obj_offsets,
- obj_szs, 1, &out_size);
+ obj_szs, 1, &out_size, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error: could not read unaligned buffers: %d\n", ret);
@@ -339,7 +339,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
- tret = vosd_txn_open(oid, 0, (++version));
+ tret = vosd_txn_open(oid, 0, (++version), 0);
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1: %d\n", ret);
@@ -358,7 +358,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 10024;
obj_szs[0] = 13;
tret = vosd_write(oid, 0, (version), buffer_offsets, buffer_szs, 1,
- obj_offsets, obj_szs, 1, 0);
+ obj_offsets, obj_szs, 1, 0, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error writing 10024-10037: %d\n", ret);
@@ -393,7 +393,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 9525;
obj_szs[0] = 512;
tret = vosd_read(oid, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
- obj_szs, 1, &out_size);
+ obj_szs, 1, &out_size, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error on read with hole: %d\n", ret);
@@ -414,7 +414,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("writing to two forks...\n");
- tret = vosd_txn_open(oid, 1, (++version));
+ tret = vosd_txn_open(oid, 1, (++version), 0);
assert(tret == TRITON_SUCCESS);
buffer_offsets[0] = buffer;
@@ -423,13 +423,13 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 0;
obj_szs[0] = 6;
tret = vosd_write(oid, 1, (version), buffer_offsets, buffer_szs, 1,
- obj_offsets, obj_szs, 1, 0);
+ obj_offsets, obj_szs, 1, 0, 0);
assert(tret == TRITON_SUCCESS);
tret = vosd_txn_close(oid, 1, (version));
assert(tret == TRITON_SUCCESS);
- tret = vosd_txn_open(oid, 2, (++version));
+ tret = vosd_txn_open(oid, 2, (++version), 0);
assert(tret == TRITON_SUCCESS);
buffer_offsets[0] = buffer;
@@ -438,7 +438,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 0;
obj_szs[0] = 6;
tret = vosd_write(oid, 2, (version), buffer_offsets, buffer_szs, 1,
- obj_offsets, obj_szs, 1, 0);
+ obj_offsets, obj_szs, 1, 0, 0);
assert(tret == TRITON_SUCCESS);
tret = vosd_txn_close(oid, 2, (version));
@@ -452,7 +452,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 0;
obj_szs[0] = 512;
tret = vosd_read(oid, 1, buffer_offsets, buffer_szs, 1, obj_offsets,
- obj_szs, 1, &out_size);
+ obj_szs, 1, &out_size, 0);
assert(tret == TRITON_SUCCESS && out_size == 6);
printf("DONE\n");
@@ -463,7 +463,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 0;
obj_szs[0] = 256;
tret = vosd_read(oid, 2, buffer_offsets, buffer_szs, 1, obj_offsets,
- obj_szs, 1, &out_size);
+ obj_szs, 1, &out_size, 0);
assert(tret == TRITON_SUCCESS && out_size == 6);
printf("buffer from fork 1: %s, buffer from fork 2: %s\n",
@@ -476,7 +476,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("checking size of fork 0...\n");
- tret = vosd_get_size(oid, 0, obj_offsets);
+ tret = vosd_get_size(oid, 0, obj_offsets, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error: bad error code from vosd_get_size()\n");
@@ -489,7 +489,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("checking size of fork 1...\n");
- tret = vosd_get_size(oid, 1, obj_offsets);
+ tret = vosd_get_size(oid, 1, obj_offsets, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error: bad error code from vosd_get_size()\n");
@@ -502,7 +502,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("checking size of fork 2...\n");
- tret = vosd_get_size(oid, 2, obj_offsets);
+ tret = vosd_get_size(oid, 2, obj_offsets, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error: bad error code from vosd_get_size()\n");
@@ -517,7 +517,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
- tret = vosd_txn_open(oid, 0, (++version));
+ tret = vosd_txn_open(oid, 0, (++version), 0);
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1: %d\n", ret);
@@ -535,7 +535,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 0;
obj_szs[0] = 1024;
tret = vosd_write(oid, 0, (version), buffer_offsets, buffer_szs, 1,
- obj_offsets, obj_szs, 1, VOSD_FLAG_TRUNC_WRITE);
+ obj_offsets, obj_szs, 1, VOSD_FLAG_TRUNC_WRITE, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error writing 0-1024: %d\n", ret);
@@ -571,7 +571,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[0] = 512;
obj_szs[0] = 512;
tret = vosd_write(oid, 0, (++version), buffer_offsets, buffer_szs, 1,
- obj_offsets, obj_szs, 1, VOSD_FLAG_AUTO_TXN);
+ obj_offsets, obj_szs, 1, VOSD_FLAG_AUTO_TXN, 0);
if(tret != TRITON_SUCCESS)
{
printf("Error writing 512-1024\n");
diff --git a/code/src/versioned-osd/prototype/versioned-osd.ae b/code/src/versioned-osd/prototype/versioned-osd.ae
index 10179cf..4303862 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.ae
+++ b/code/src/versioned-osd/prototype/versioned-osd.ae
@@ -1563,10 +1563,13 @@ static __blocking triton_ret_t __vosd_truncate_retryable(uint128_t oid, uint64_t
return(tret);
}
-__blocking triton_ret_t vosd_truncate(uint128_t oid, uint64_t fork, int64_t size)
+__blocking triton_ret_t vosd_truncate(uint128_t oid, uint64_t fork, int64_t size, uint64_t niid)
{
triton_ret_t tret;
+ /* not supported yet */
+ assert(niid == 0);
+
/* actual work of truncate; retry if DB deadlock */
for(tret = TRITON_ERR_DEADLOCK; tret == TRITON_ERR_DEADLOCK; )
{
@@ -1599,12 +1602,15 @@ __blocking triton_ret_t vosd_get_version(uint128_t oid, uint64_t* version)
return(tret);
}
-__blocking triton_ret_t vosd_create(uint128_t oid)
+__blocking triton_ret_t vosd_create(uint128_t oid, uint64_t niid)
{
triton_ret_t tret;
triton_ret_t tret_tmp;
struct coalesce_obj co;
+ /* not supported yet */
+ assert(niid == 0);
+
co.oid = oid;
co.flags = COALESCE_DB;
start_write(&co);
@@ -1860,14 +1866,19 @@ __blocking triton_ret_t vosd_dump(void)
}
triton_ret_t vosd_txn_open(
- uint128_t oid, /**< object to operate on */
- uint64_t oid_fork, /**< fork to operate on */
- uint64_t txn_number /**< caller-assigned txn identifier */
+ uint128_t oid,
+ uint64_t oid_fork,
+ uint64_t txn_number,
+ uint64_t niid
)
{
struct txn_accumulator *txn_acc;
+ /* not supported yet */
+ assert(niid == 0);
+
txn_acc = malloc(sizeof(*txn_acc));
+
if(!txn_acc)
{
return(TRITON_ERR_NOMEM);
@@ -1897,7 +1908,8 @@ static __blocking triton_ret_t vosd_write_internal(
int64_t* obj_offsets,
int64_t* obj_sizes,
int obj_count,
- int flags)
+ int flags,
+ uint64_t niid)
{
int done = 0;
int mem_index = 0;
@@ -1938,7 +1950,7 @@ static __blocking triton_ret_t vosd_write_internal(
if(flags & VOSD_FLAG_AUTO_TXN)
{
- tret = vosd_txn_open(oid, oid_fork, txn_number);
+ tret = vosd_txn_open(oid, oid_fork, txn_number, niid);
if(tret != TRITON_SUCCESS)
{
free_tmp_listio();
@@ -2099,7 +2111,8 @@ static __blocking triton_ret_t vosd_write_internal(
__blocking triton_ret_t vosd_get_size(
uint128_t oid,
uint64_t fork,
- int64_t* size
+ int64_t* size,
+ uint64_t niid
)
{
DB_TXN *txn;
@@ -2110,6 +2123,9 @@ __blocking triton_ret_t vosd_get_size(
struct logical_map_key lmk;
struct logical_map_entry lme;
+ /* not supported yet */
+ assert(niid == 0);
+
*size = 0;
tret = bdb_txn_begin(envp, NULL, &txn, 0);
@@ -2223,18 +2239,22 @@ __blocking triton_ret_t vosd_write(
int64_t* obj_offsets,
int64_t* obj_sizes,
int obj_count,
- int flags)
+ int flags,
+ uint64_t niid)
{
triton_ret_t tret;
triton_ret_t tret_tmp;
struct coalesce_obj co;
+ /* not supported yet */
+ assert(niid == 0);
+
co.oid = oid;
co.flags = COALESCE_DB|COALESCE_DATA;
start_write(&co);
tret = vosd_write_internal(oid, oid_fork, txn_number, mem_offsets,
- mem_sizes, mem_count, obj_offsets, obj_sizes, obj_count, flags);
+ mem_sizes, mem_count, obj_offsets, obj_sizes, obj_count, flags, niid);
tret_tmp = end_write(&co);
if(tret == TRITON_SUCCESS)
@@ -2284,7 +2304,8 @@ __blocking triton_ret_t vosd_read(
int64_t* obj_offsets,
int64_t* obj_sizes,
int obj_count,
- int64_t* out_size)
+ int64_t* out_size,
+ uint64_t niid)
{
triton_ret_t tret;
int done = 0;
@@ -2296,6 +2317,9 @@ __blocking triton_ret_t vosd_read(
int64_t* tmp_obj_offsets = NULL;
int64_t* tmp_obj_sizes = NULL;
+ /* not supported yet */
+ assert(niid == 0);
+
*out_size = 0;
/* TODO: safety check that total mem size equals total obj size */
@@ -2360,12 +2384,15 @@ __blocking triton_ret_t vosd_read(
return(TRITON_SUCCESS);
}
-__blocking triton_ret_t vosd_remove(uint128_t oid)
+__blocking triton_ret_t vosd_remove(uint128_t oid, uint64_t niid)
{
triton_ret_t tret;
triton_ret_t tret_tmp;
struct coalesce_obj co;
+ /* not supported yet */
+ assert(niid == 0);
+
co.oid = oid;
co.flags = COALESCE_DB;
start_write(&co);
diff --git a/code/src/versioned-osd/prototype/versioned-osd.hae b/code/src/versioned-osd/prototype/versioned-osd.hae
index fb4ea04..1393e21 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.hae
+++ b/code/src/versioned-osd/prototype/versioned-osd.hae
@@ -50,7 +50,8 @@ void vosd_finalize(void);
* Creates a new object
*/
__blocking triton_ret_t vosd_create(
- uint128_t oid /**< requested identifier */
+ uint128_t oid, /**< requested identifier */
+ uint64_t niid /**< non-idempotent identifier */
);
@@ -72,9 +73,10 @@ __blocking triton_ret_t vosd_dump(void);
* Opens a txn
*/
triton_ret_t vosd_txn_open(
- uint128_t oid, /**< object to operate on */
+ uint128_t oid, /**< object to operate on */
uint64_t fork, /**< fork to operate on */
- uint64_t txn_number /**< caller-assigned txn identifier */
+ uint64_t txn_number, /**< caller-assigned txn identifier */
+ uint64_t niid /**< non-idempotent identifier */
);
/**
@@ -83,7 +85,8 @@ triton_ret_t vosd_txn_open(
__blocking triton_ret_t vosd_get_size(
uint128_t oid, /**< object to operate on */
uint64_t fork, /**< fork identifier */
- int64_t* size /**< logical size of fork */
+ int64_t* size, /**< logical size of fork */
+ uint64_t niid /**< non-idempotent identifier */
);
/**
@@ -99,7 +102,8 @@ __blocking triton_ret_t vosd_write(
int64_t* obj_offsets, /**< object region offsets */
int64_t* obj_sizes, /**< object region sizes */
int obj_count, /**< object region count */
- int flags /**< optional flags */
+ int flags, /**< optional flags */
+ uint64_t niid /**< non-idempotent identifier */
);
/**
@@ -123,14 +127,16 @@ __blocking triton_ret_t vosd_read(
int64_t* obj_offsets, /**< object region offsets */
int64_t* obj_sizes, /**< object region sizes */
int obj_count, /**< object region count */
- int64_t* out_size /**< amount read */
+ int64_t* out_size, /**< amount read */
+ uint64_t niid /**< non-idempotent identifier */
);
/**
* Removes an existing object
*/
__blocking triton_ret_t vosd_remove(
- uint128_t oid /**< oid to remove */
+ uint128_t oid, /**< oid to remove */
+ uint64_t niid /**< non-idempotent identifier */
);
/**
@@ -139,7 +145,8 @@ __blocking triton_ret_t vosd_remove(
__blocking triton_ret_t vosd_truncate(
uint128_t oid, /**< object to operate on */
uint64_t fork, /**< object fork to operate on */
- int64_t size /**< size to truncate to (maybe be larger than current size) */
+ int64_t size, /**< size to truncate to (maybe be larger than current size) */
+ uint64_t niid /**< non-idempotent identifier */
);
#endif /* __VERSIONED_OSD_HAE__ */
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. cecec3e2e49839556db09fa697380158853d07e4
by noreply@mcs.anl.gov 27 Jul '10
by noreply@mcs.anl.gov 27 Jul '10
27 Jul '10
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 cecec3e2e49839556db09fa697380158853d07e4 (commit)
from 96f4856b89da19ec03ed14adfc9c9be6f664d9c3 (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 cecec3e2e49839556db09fa697380158853d07e4
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Tue Jul 27 16:54:01 2010 -0400
added function to retrieve size of fork
-----------------------------------------------------------------------
Summary of changes:
code/src/versioned-osd/prototype/tests/vosd1.ae | 68 +++++++++++
code/src/versioned-osd/prototype/versioned-osd.ae | 117 ++++++++++++++++++++
code/src/versioned-osd/prototype/versioned-osd.hae | 9 ++
3 files changed, 194 insertions(+), 0 deletions(-)
Diff of changes:
diff --git a/code/src/versioned-osd/prototype/tests/vosd1.ae b/code/src/versioned-osd/prototype/tests/vosd1.ae
index 38fb992..d35a16c 100644
--- a/code/src/versioned-osd/prototype/tests/vosd1.ae
+++ b/code/src/versioned-osd/prototype/tests/vosd1.ae
@@ -289,6 +289,33 @@ static __blocking int do_vosd_test(void)
printf("DONE\n");
/********************************************************/
+ printf("checking size of fork 0...\n");
+ tret = vosd_get_size(oid, 0, obj_offsets);
+ if(tret != TRITON_SUCCESS)
+ {
+ printf("Error: bad error code from vosd_get_size()\n");
+#if 0
+ triton_error_destroy(tret);
+#endif
+ return(-1);
+ }
+ printf("DONE: size: %lld\n", lld(obj_offsets[0]));
+
+ /********************************************************/
+ printf("checking size of fork 1...\n");
+ tret = vosd_get_size(oid, 1, obj_offsets);
+ if(tret != TRITON_SUCCESS)
+ {
+ printf("Error: bad error code from vosd_get_size()\n");
+#if 0
+ triton_error_destroy(tret);
+#endif
+ return(-1);
+ }
+ printf("DONE: size: %lld\n", lld(obj_offsets[0]));
+
+
+ /********************************************************/
printf("reading unaligned data with listio...\n");
buffer_offsets[0] = buffer+100;
buffer_offsets[1] = buffer+1612;
@@ -448,6 +475,47 @@ static __blocking int do_vosd_test(void)
assert(tret == TRITON_SUCCESS);
/********************************************************/
+ printf("checking size of fork 0...\n");
+ tret = vosd_get_size(oid, 0, obj_offsets);
+ if(tret != TRITON_SUCCESS)
+ {
+ printf("Error: bad error code from vosd_get_size()\n");
+#if 0
+ triton_error_destroy(tret);
+#endif
+ return(-1);
+ }
+ printf("DONE: size: %lld\n", lld(obj_offsets[0]));
+
+ /********************************************************/
+ printf("checking size of fork 1...\n");
+ tret = vosd_get_size(oid, 1, obj_offsets);
+ if(tret != TRITON_SUCCESS)
+ {
+ printf("Error: bad error code from vosd_get_size()\n");
+#if 0
+ triton_error_destroy(tret);
+#endif
+ return(-1);
+ }
+ printf("DONE: size: %lld\n", lld(obj_offsets[0]));
+
+ /********************************************************/
+ printf("checking size of fork 2...\n");
+ tret = vosd_get_size(oid, 2, obj_offsets);
+ if(tret != TRITON_SUCCESS)
+ {
+ printf("Error: bad error code from vosd_get_size()\n");
+#if 0
+ triton_error_destroy(tret);
+#endif
+ return(-1);
+ }
+ printf("DONE: size: %lld\n", lld(obj_offsets[0]));
+
+
+
+ /********************************************************/
printf("opening txn...\n");
tret = vosd_txn_open(oid, 0, (++version));
if(tret != TRITON_SUCCESS)
diff --git a/code/src/versioned-osd/prototype/versioned-osd.ae b/code/src/versioned-osd/prototype/versioned-osd.ae
index f8e4318..10179cf 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.ae
+++ b/code/src/versioned-osd/prototype/versioned-osd.ae
@@ -2096,6 +2096,123 @@ static __blocking triton_ret_t vosd_write_internal(
return(tret);
}
+__blocking triton_ret_t vosd_get_size(
+ uint128_t oid,
+ uint64_t fork,
+ int64_t* size
+)
+{
+ DB_TXN *txn;
+ DBT key, value;
+ triton_ret_t tret;
+ triton_ret_t tret_tmp;
+ DBC *dbc_p = NULL;
+ struct logical_map_key lmk;
+ struct logical_map_entry lme;
+
+ *size = 0;
+
+ 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);
+
+ /* we want to go to the first record _after_ the fork that we are
+ * interested in
+ */
+ lmk.oid = oid;
+ lmk.oid_fork = fork + 1;
+ lmk.logical_offset_end = -1;
+ if(lmk.oid_fork == 0)
+ {
+ lmk.oid = triton_uint128_inc(lmk.oid);
+ }
+
+ tret = bdb_cursor_get(dbc_p, &key, &value, DB_SET_RANGE);
+ if(tret != TRITON_SUCCESS && tret != TRITON_ERR_NOENT)
+ {
+ tret_tmp = bdb_cursor_close(dbc_p);
+#if 0
+ triton_err_destroy(tret_tmp);
+#endif
+ tret_tmp = bdb_txn_abort(txn);
+#if 0
+ triton_err_destroy(tret_tmp);
+#endif
+ return(tret);
+ }
+
+ if(tret == TRITON_SUCCESS)
+ {
+ /* we found the entry after the one we were looking for */
+ /* back up one and see if we find the last entry in the fork we are
+ * actually interested in
+ */
+ tret = bdb_cursor_get(dbc_p, &key, &value, DB_PREV);
+ }
+ else
+ {
+ /* we didn't find a fork/oid after this one. Try looking for the
+ * very last thing in the db instead
+ */
+ tret = bdb_cursor_get(dbc_p, &key, &value, DB_LAST);
+ }
+
+ if(tret != TRITON_SUCCESS && tret != TRITON_ERR_NOENT)
+ {
+ tret_tmp = bdb_cursor_close(dbc_p);
+ #if 0
+ triton_err_destroy(tret_tmp);
+ #endif
+ tret_tmp = bdb_txn_abort(txn);
+ #if 0
+ triton_err_destroy(tret_tmp);
+ #endif
+ return(tret);
+ }
+
+ if(tret == TRITON_ERR_NOENT)
+ {
+ /* nothing in the vosd at all yet */
+ *size = 0;
+ }
+ else if(triton_cmp_uint128(lmk.oid,oid) == 0 && lmk.oid_fork == fork)
+ {
+ /* this should be the last element in the fork */
+ *size = lmk.logical_offset_end;
+ }
+ else
+ {
+ /* this fork doesn't have anything in it yet */
+ *size = 0;
+ }
+
+ tret_tmp = bdb_cursor_close(dbc_p);
+ if(tret_tmp != TRITON_SUCCESS)
+ {
+ return(tret_tmp);
+ }
+
+ tret = bdb_txn_commit(txn, 0);
+
+ return(tret);
+}
+
+
__blocking triton_ret_t vosd_write(
uint128_t oid,
uint64_t oid_fork,
diff --git a/code/src/versioned-osd/prototype/versioned-osd.hae b/code/src/versioned-osd/prototype/versioned-osd.hae
index 7f631b0..fb4ea04 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.hae
+++ b/code/src/versioned-osd/prototype/versioned-osd.hae
@@ -78,6 +78,15 @@ triton_ret_t vosd_txn_open(
);
/**
+ * Get logical size of a fork
+ */
+__blocking triton_ret_t vosd_get_size(
+ uint128_t oid, /**< object to operate on */
+ uint64_t fork, /**< fork identifier */
+ int64_t* size /**< logical size of fork */
+);
+
+/**
* Writes data into an object
*/
__blocking triton_ret_t vosd_write(
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. 96f4856b89da19ec03ed14adfc9c9be6f664d9c3
by noreply@mcs.anl.gov 21 Jul '10
by noreply@mcs.anl.gov 21 Jul '10
21 Jul '10
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 96f4856b89da19ec03ed14adfc9c9be6f664d9c3 (commit)
from 5939a749f1924384c140623311cf55618b3916b4 (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 96f4856b89da19ec03ed14adfc9c9be6f664d9c3
Author: xclski <xclski(a)beatrice.(none)>
Date: Tue Jul 20 11:28:16 2010 -0400
Initial commit of btree code
-----------------------------------------------------------------------
Summary of changes:
code/src/btree/btree.c | 255 ++++++++++++++++++++++++++++++++++++++++++++++++
code/src/btree/btree.h | 29 ++++++
2 files changed, 284 insertions(+), 0 deletions(-)
create mode 100644 code/src/btree/btree.c
create mode 100644 code/src/btree/btree.h
Diff of changes:
diff --git a/code/src/btree/btree.c b/code/src/btree/btree.c
new file mode 100644
index 0000000..366afbd
--- /dev/null
+++ b/code/src/btree/btree.c
@@ -0,0 +1,255 @@
+#include "btree.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+Tree btree;
+int file_end;
+FILE *fp;
+
+int t = MIN_FACTOR;
+
+//helper functions:
+void diskRead(long node_location, TreeNode ** node){
+
+ fseek(fp, node_location, SEEK_SET);
+ fread(*node, sizeof(**node), 1, fp);
+
+}
+
+void diskWrite(TreeNode * node){
+
+ if(node->disk_loc != -1){
+ fseek(fp, node->disk_loc, SEEK_SET);
+ fwrite(node, sizeof(*node), 1, fp);
+ }else{
+ fseek(fp, 0, SEEK_END);
+ fgetpos(fp, &(node->disk_loc));
+ fwrite(node, sizeof(*node), 1, fp);
+ }
+
+}
+
+void allocate_node(TreeNode ** node){
+
+ //allocate space for our new node
+ *node = malloc(sizeof(TreeNode));
+
+ //initialize attributes of the node
+ int i;
+ (*node)->disk_loc = -1;
+ (*node)->keyCount = 0;
+ (*node)->leaf = 1;
+ for(i = 0; i < t*2-1; i++){
+ (*node)->keys[i].key = -1;
+ (*node)->keys[i].value = -1;
+ (*node)->children[i] = -1;
+ }
+ (*node)->children[t*2-1] = -1;
+
+}
+
+void move_key(TreeNode * from, int key_from, TreeNode * to, int key_to){
+
+ to->keys[key_to].key = from->keys[key_from].key;
+ to->keys[key_to].value = from->keys[key_from].value;
+ to->keyCount++;
+ from->keys[key_from].key = -1;
+ from->keys[key_from].value = -1;
+ from->keyCount--;
+
+}
+
+void print_tabs(int num){
+
+ int i;
+ for(i = 0; i < num; i++)
+ printf("\t");
+
+}
+
+void print_node(TreeNode * node, int depth){
+
+ print_tabs(depth);
+ printf("Node at depth %d\n", depth);
+ print_tabs(depth);
+ printf("disk_loc:\t%ld\n", node->disk_loc);
+ print_tabs(depth);
+ printf("leaf:\t%d\n", node->leaf);
+ print_tabs(depth);
+ printf("keyCount:\t%d\n", node->keyCount);
+ int i;
+ for(i = 0; i < t*2-1; i++){
+ print_tabs(depth);
+ printf("Key %d:\t%d\t\tValue:\t%d\n", i, node->keys[i].key, node->keys[i].value);
+ }
+ for(i = 0; i < t*2; i++){
+ print_tabs(depth);
+ printf("Child %d:\t%ld\n", i, node->children[i]);
+ }
+
+ TreeNode * child;
+ allocate_node(&child);
+ for(i = 0; i < t*2; i++){
+ if(node->children[i] != -1){
+ diskRead(node->children[i], &child);
+ print_node(child, depth+1);
+ }
+ }
+
+}
+
+void print_tree(){
+
+ print_node(btree.root, 0);
+
+}
+
+void debug(){
+
+ btree.root->keys[2].key = 6;
+ diskWrite(btree.root);
+
+}
+
+int Create(){
+
+ allocate_node(&(btree.root));
+ btree.root->disk_loc = 0;
+
+ fp = fopen("data/btree.dat", "w+");
+ diskWrite(btree.root);
+
+ return 0;
+
+}
+
+int Close(Tree * btree){
+
+ fclose(fp);
+
+}
+
+TreeNode* Search(TreeNode * node, Item * item){
+
+ int i = 0;
+ while(i < node->keyCount && item->key > node->keys[i].key){
+ i++;
+ }
+
+ if(i < node->keyCount && item->key == node->keys[i].key){
+ return node;
+ }
+
+ if(node->leaf){
+ return NULL;
+ }else{
+ diskRead(node->children[i], &node);
+ return Search(node, item);
+ }
+
+}
+
+TreeNode* SearchTree(Item * item){
+
+ return Search(btree.root, item);
+
+}
+
+int SplitChild(TreeNode * x, int i, TreeNode * y){
+
+ printf("Splitting child %ld\n", x->disk_loc);
+ int j;
+ TreeNode * z;
+ allocate_node(&z);
+
+ /*duplicate leaf setting*/
+ z->leaf = y->leaf;
+
+ /*move t-1 keys from the right of the median
+ * in the y to the new node*/
+ for(j = 0; j < t - 1; j++){
+ move_key(y, j+t, z, j);
+ }
+
+ /*if it is an internal node, copy the right
+ *children too*/
+ if(!y->leaf){
+ for(j = 0; j < t; j++){
+ z->children[j] = y->children[j+t];
+ y->children[j+t] = -1;
+ }
+ }
+
+ /*move node pointers in x node down one*/
+ for(j = x->keyCount; j > i; j--){
+ x->children[j+1] = x->children[j];
+ }
+
+ /*move keys accordingly*/
+ for(j = x->keyCount - 1; j >= i; j--){
+ x->keys[j+1] = x->keys[j];
+ }
+ move_key(y, t-1, x, i);
+ diskWrite(z);
+ x->children[i+1] = z->disk_loc;
+ diskWrite(x);
+ diskWrite(y);
+
+}
+
+int Insert(Item * item){
+
+ printf("Inserting ");
+
+ if(btree.root->keyCount == 2*t - 1){
+ printf("into full root\n");
+ TreeNode * root_temp = btree.root;
+ TreeNode * new_node;
+ allocate_node(&new_node);
+ btree.root = new_node;
+ new_node->leaf = 0;
+ new_node->children[0] = root_temp->disk_loc;
+ SplitChild(new_node, 0, root_temp);
+ InsertNonfull(new_node, item);
+ }else{
+ printf("into nonfull root\n");
+ InsertNonfull(btree.root, item);
+ }
+
+}
+
+int InsertNonfull(TreeNode * node, Item * item){
+
+ printf("InsertNonfull ");
+ int i = node->keyCount - 1;
+ if(node->leaf){
+ printf("into leaf %ld\n", node->disk_loc);
+ while(i >= 0 && item->key < node->keys[i].key){
+ node->keys[i+1] = node->keys[i];
+ i--;
+ }
+ node->keys[i+1] = *item;
+ node->keyCount++;
+ diskWrite(node);
+ }else{
+ printf("into internal node %ld\n", node->disk_loc);
+ while(i >= 0 && item->key < node->keys[i].key){
+ i--;
+ }
+ i++;
+ TreeNode * child;
+ allocate_node(&child);
+ diskRead(node->children[i], &child);
+ if(child->keyCount == 2*t - 1){
+ SplitChild(node, i, child);
+ if(item->key > node->keys[i].key){
+ i++;
+ }
+ diskRead(node->children[i], &child);
+ }
+ InsertNonfull(child, item);
+
+ }
+
+}
+
diff --git a/code/src/btree/btree.h b/code/src/btree/btree.h
new file mode 100644
index 0000000..17becf3
--- /dev/null
+++ b/code/src/btree/btree.h
@@ -0,0 +1,29 @@
+#define MIN_FACTOR 2
+
+typedef struct Item{
+ int key;
+ int value;
+} Item;
+
+typedef struct TreeNode{
+ int keyCount;
+ long disk_loc;
+ int leaf;
+ Item keys[MIN_FACTOR*2-1];
+ long children[MIN_FACTOR*2];
+} TreeNode;
+
+typedef struct Tree{
+ int maxKey;
+ int keyTotal;
+ TreeNode * root;
+} Tree;
+
+void print_tree();
+void debug();
+
+int Create();
+TreeNode* SearchTree(Item * item);
+int SplitChild(TreeNode * child, int child_num, TreeNode * parent);
+int Insert(Item * item);
+int Delete(int search_key);
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. 5939a749f1924384c140623311cf55618b3916b4
by noreply@mcs.anl.gov 20 Jul '10
by noreply@mcs.anl.gov 20 Jul '10
20 Jul '10
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 5939a749f1924384c140623311cf55618b3916b4 (commit)
from f7252902e359000a483f66f7d70deb4b7a635792 (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 5939a749f1924384c140623311cf55618b3916b4
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Tue Jul 20 17:27:34 2010 -0400
stub for a truncate function
-----------------------------------------------------------------------
Summary of changes:
code/src/versioned-osd/prototype/versioned-osd.ae | 47 ++++++++++++++++++++
code/src/versioned-osd/prototype/versioned-osd.hae | 9 ++++
2 files changed, 56 insertions(+), 0 deletions(-)
Diff of changes:
diff --git a/code/src/versioned-osd/prototype/versioned-osd.ae b/code/src/versioned-osd/prototype/versioned-osd.ae
index e8f1585..f8e4318 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.ae
+++ b/code/src/versioned-osd/prototype/versioned-osd.ae
@@ -1532,6 +1532,53 @@ void vosd_finalize(void)
return;
}
+#if 0
+static __blocking triton_ret_t __vosd_truncate_retryable(uint128_t oid, uint64_t fork, int64_t size)
+#endif
+static __blocking triton_ret_t __vosd_truncate_retryable(uint128_t oid, uint64_t fork, int64_t size)
+{
+ triton_ret_t tret;
+
+#if 0
+ tret = bdb_txn_begin(envp, NULL, &txn, 0);
+ if(tret != TRITON_SUCCESS)
+ {
+ return(tret);
+ }
+#endif
+
+ /* TODO: fill this in.
+ * 1) determine if there is a log entry spanning the target size
+ * a) if so, modify the entry appropriately
+ * b) if not, add a zero byte entry at the offset (make sure this
+ * works with read and write)
+ * 2) delete all entries that come afterwards
+ */
+ tret = TRITON_ERR_NOSYS;
+
+#if 0
+ tret = bdb_txn_commit(txn, 0);
+#endif
+
+ return(tret);
+}
+
+__blocking triton_ret_t vosd_truncate(uint128_t oid, uint64_t fork, int64_t size)
+{
+ triton_ret_t tret;
+
+ /* actual work of truncate; retry if DB deadlock */
+ for(tret = TRITON_ERR_DEADLOCK; tret == TRITON_ERR_DEADLOCK; )
+ {
+ /* TODO: triton_error_destroy() causes segfaults. */
+#if 0
+ triton_error_destroy(tret);
+#endif
+ tret = __vosd_truncate_retryable(oid, fork, size);
+ }
+
+ return(tret);
+}
__blocking triton_ret_t vosd_get_version(uint128_t oid, uint64_t* version)
{
diff --git a/code/src/versioned-osd/prototype/versioned-osd.hae b/code/src/versioned-osd/prototype/versioned-osd.hae
index abe0b86..7f631b0 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.hae
+++ b/code/src/versioned-osd/prototype/versioned-osd.hae
@@ -124,6 +124,15 @@ __blocking triton_ret_t vosd_remove(
uint128_t oid /**< oid to remove */
);
+/**
+ * Truncates
+ */
+__blocking triton_ret_t vosd_truncate(
+ uint128_t oid, /**< object to operate on */
+ uint64_t fork, /**< object fork to operate on */
+ int64_t size /**< size to truncate to (maybe be larger than current size) */
+);
+
#endif /* __VERSIONED_OSD_HAE__ */
/* @} */
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. f7252902e359000a483f66f7d70deb4b7a635792
by noreply@mcs.anl.gov 17 Jul '10
by noreply@mcs.anl.gov 17 Jul '10
17 Jul '10
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 f7252902e359000a483f66f7d70deb4b7a635792 (commit)
from f1d517b2a0f7699f2832fd2711b6a9fa59ebecf1 (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 f7252902e359000a483f66f7d70deb4b7a635792
Author: slang <slang(a)mcs.anl.gov>
Date: Sat Jul 17 12:36:52 2010 -0500
opcache count needs to be atomic
-----------------------------------------------------------------------
Summary of changes:
code/src/aesop/opcache.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
Diff of changes:
diff --git a/code/src/aesop/opcache.c b/code/src/aesop/opcache.c
index 316ff1a..321eb8d 100644
--- a/code/src/aesop/opcache.c
+++ b/code/src/aesop/opcache.c
@@ -92,7 +92,13 @@ inline int ae_opcache_size(ae_opcache_t cache)
inline int ae_opcache_count(ae_opcache_t cache)
{
- return cache->count;
+ int count;
+
+ triton_mutex_lock(&cache->mutex);
+ count = cache->count;
+ triton_mutex_unlock(&cache->mutex);
+
+ return count;
}
struct ae_op *ae_opcache_get(ae_opcache_t cache)
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. f1d517b2a0f7699f2832fd2711b6a9fa59ebecf1
by noreply@mcs.anl.gov 01 Jul '10
by noreply@mcs.anl.gov 01 Jul '10
01 Jul '10
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 f1d517b2a0f7699f2832fd2711b6a9fa59ebecf1 (commit)
via c2ac4d2b97a21717c1a21d748ee139971555eff3 (commit)
from 6b345fe8aeb7140b8691d17ca5140b183943fbdf (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 f1d517b2a0f7699f2832fd2711b6a9fa59ebecf1
Author: slang <slang(a)mcs.anl.gov>
Date: Thu Jul 1 16:22:22 2010 -0500
more fixes after lone pbranch changes
commit c2ac4d2b97a21717c1a21d748ee139971555eff3
Author: slang <slang(a)mcs.anl.gov>
Date: Thu Jul 1 16:10:08 2010 -0500
fix for pbranch that doesn't post a blocking op. Introduced with lone pbranch additions.
-----------------------------------------------------------------------
Summary of changes:
code/src/aesop/ae-blocking-parser.h | 54 +++++++++----------
code/src/aesop/parser/ae-blocking-parser.lhs | 6 +-
.../aesop/parser/tests/blocking/parallelfor2.ae | 2 +-
3 files changed, 30 insertions(+), 32 deletions(-)
Diff of changes:
diff --git a/code/src/aesop/ae-blocking-parser.h b/code/src/aesop/ae-blocking-parser.h
index 2bc6fd0..c7b5c18 100644
--- a/code/src/aesop/ae-blocking-parser.h
+++ b/code/src/aesop/ae-blocking-parser.h
@@ -157,30 +157,29 @@
}
#define AE_MK_PBRANCH_POST_DECLS(__ctl_type) \
- struct __ctl_type * child_ctl, *parent_ctl;
+ struct __ctl_type *parent_ctl;
#define AE_MK_PBRANCH_POST_STMTS(__pwait_ctl, __ctl_type, __fname, __location, __pbranch_id) \
{ \
parent_ctl = ctl; \
- child_ctl = malloc(sizeof(*child_ctl)); \
- if(child_ctl == NULL) \
+ ctl = malloc(sizeof(*ctl)); \
+ if(ctl == NULL) \
{ \
triton_err(triton_log_default, "INVALID STATE: %s:%d: memory allocation for control structure failed!\n", #__fname, __location); \
- assert(child_ctl != NULL); \
+ assert(ctl != NULL); \
goto __ae_##__pbranch_id##_end; \
} \
- ae_ctl_init(&child_ctl->gen, #__ctl_type ":" #__pbranch_id, NULL, ctl->gen.context); \
- child_ctl->parent = ctl; \
- ae_hints_copy(ctl->gen.hints, &child_ctl->gen.hints); \
- child_ctl->params = ctl->params; \
- memcpy(&child_ctl->__pwait_ctl.private, &ctl->__pwait_ctl.private, sizeof(child_ctl->__pwait_ctl.private)); \
- child_ctl->__pwait_ctl.shared_params = &ctl->__pwait_ctl.shared; \
- ctl = child_ctl; \
- triton_mutex_lock(&child_ctl->parent->gen.mutex); \
- child_ctl->parent->gen.posted++; \
- triton_list_link_clear(&child_ctl->gen.link); \
- triton_queue_enqueue(&child_ctl->gen.link, &child_ctl->parent->gen.children); \
- triton_mutex_unlock(&child_ctl->parent->gen.mutex); \
+ ae_ctl_init(&ctl->gen, #__ctl_type ":" #__pbranch_id, NULL, ctl->gen.context); \
+ ctl->parent = parent_ctl; \
+ ae_hints_copy(parent_ctl->gen.hints, &ctl->gen.hints); \
+ ctl->params = parent_ctl->params; \
+ memcpy(&ctl->__pwait_ctl.private, &parent_ctl->__pwait_ctl.private, sizeof(ctl->__pwait_ctl.private)); \
+ ctl->__pwait_ctl.shared_params = &parent_ctl->__pwait_ctl.shared; \
+ triton_mutex_lock(&ctl->parent->gen.mutex); \
+ ctl->parent->gen.posted++; \
+ triton_list_link_clear(&ctl->gen.link); \
+ triton_queue_enqueue(&ctl->gen.link, &ctl->parent->gen.children); \
+ triton_mutex_unlock(&ctl->parent->gen.mutex); \
}
#define AE_MK_PBRANCH_POST_END_STMTS(__pwait_ctl, __ctl_type, __fname, __location, __pbranch_id) \
@@ -189,26 +188,25 @@
}
#define AE_MK_LONE_PBRANCH_POST_DECLS(__ctl_type) \
- struct __ctl_type * child_ctl, *parent_ctl;
+ struct __ctl_type *parent_ctl;
#define AE_MK_LONE_PBRANCH_POST_STMTS(__ctl_type, __fname, __location, __pbranch_id) \
{ \
parent_ctl = ctl; \
- child_ctl = malloc(sizeof(*child_ctl)); \
- if(child_ctl == NULL) \
+ ctl = malloc(sizeof(*ctl)); \
+ if(ctl == NULL) \
{ \
triton_err(triton_log_default, "INVALID STATE: %s:%d: memory allocation for control structure failed!\n", #__fname, __location); \
- assert(child_ctl != NULL); \
+ assert(ctl != NULL); \
goto __ae_##__pbranch_id##_end; \
} \
- ae_ctl_init(&child_ctl->gen, #__ctl_type ":" #__pbranch_id, NULL, ctl->gen.context); \
- child_ctl->parent = ctl; \
- ae_hints_copy(ctl->gen.hints, &child_ctl->gen.hints); \
- child_ctl->params = ctl->params; \
- ctl = child_ctl; \
- triton_list_link_clear(&child_ctl->gen.link); \
- ae_lone_pbranches_add(&child_ctl->gen); \
- ae_ctl_refinc(&child_ctl->parent->gen); \
+ ae_ctl_init(&ctl->gen, #__ctl_type ":" #__pbranch_id, NULL, ctl->gen.context); \
+ ctl->parent = parent_ctl; \
+ ae_hints_copy(parent_ctl->gen.hints, &ctl->gen.hints); \
+ ctl->params = parent_ctl->params; \
+ triton_list_link_clear(&ctl->gen.link); \
+ ae_lone_pbranches_add(&ctl->gen); \
+ ae_ctl_refinc(&ctl->parent->gen); \
}
#define AE_MK_LONE_PBRANCH_POST_END_STMTS(__ctl_type, __fname, __location, __pbranch_id) \
diff --git a/code/src/aesop/parser/ae-blocking-parser.lhs b/code/src/aesop/parser/ae-blocking-parser.lhs
index b04fbfe..817e86d 100644
--- a/code/src/aesop/parser/ae-blocking-parser.lhs
+++ b/code/src/aesop/parser/ae-blocking-parser.lhs
@@ -1082,7 +1082,7 @@ Special case where the if has blocking call(s), but the else doesn't (an else ma
> pwaitCtx = getPWaitAncestor pb
> (pbreakDecls, pbreakStmts) <- mkPBreakStmts pp ni
-> (pbranchDecls, pbranchStart) <- mkPBranchPostStartStmts "child_ctl" fname ni
+> (pbranchDecls, pbranchStart) <- mkPBranchPostStartStmts "ctl" fname ni
> setDoneCtlStmt <- mkDoneCtlSetStmt pp ni
> afterPWaitStmts <- generateAfterStmts pwaitCtx []
> pbDone <- getPBDone
@@ -1098,7 +1098,7 @@ Special case where the if has blocking call(s), but the else doesn't (an else ma
> afterPWaitStmts) ni) tlBeforeStmts
> afterPBranchNBStmts <- translateForCB pb (nbStmtsAfter pb)
-> pushPrefix "child_ctl"
+> -- pushPrefix "child_ctl"
> tlPBDeclInits <- translateForCB b pbDeclInits
> tlCtxInits <- translateForCB b ctxInitStmts
> setPBDone mkPBranchPostDoneStmts
@@ -1106,7 +1106,7 @@ Special case where the if has blocking call(s), but the else doesn't (an else ma
> cp <- getPrefix
> branchStmts <- mkPBranchPostStmts pb pwaitName cp pp (getParentName pb)
> (tlPBDeclInits ++ beforeStmts ++ tlCtxInits ++ branchPostStmts) (nodeInfo branchDef)
-> popPrefix
+> -- popPrefix
> return $ branchStmts ++ pbend ++ afterPBranchNBStmts
> getParallelStmts pw@(PWaitContext _ waitDef waitStmts@(w:ws) before after parent next prev) tr = do
diff --git a/code/src/aesop/parser/tests/blocking/parallelfor2.ae b/code/src/aesop/parser/tests/blocking/parallelfor2.ae
index bfae47f..794c5d9 100644
--- a/code/src/aesop/parser/tests/blocking/parallelfor2.ae
+++ b/code/src/aesop/parser/tests/blocking/parallelfor2.ae
@@ -15,7 +15,7 @@ static __blocking void run_parfor(
pwait
{
- int i;
+ pprivate int i;
for (i = 0; i < 2; ++i)
{
pbranch
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. 6b345fe8aeb7140b8691d17ca5140b183943fbdf
by noreply@mcs.anl.gov 01 Jul '10
by noreply@mcs.anl.gov 01 Jul '10
01 Jul '10
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 6b345fe8aeb7140b8691d17ca5140b183943fbdf (commit)
from 63f39865aa07deca6bae37e8c71f4d381689f51b (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 6b345fe8aeb7140b8691d17ca5140b183943fbdf
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Thu Jul 1 17:12:33 2010 -0400
add uint128.h header
-----------------------------------------------------------------------
Summary of changes:
code/src/common/triton-uint128.h | 75 ++++++++++++++++++++++++++++++++++++++
1 files changed, 75 insertions(+), 0 deletions(-)
create mode 100644 code/src/common/triton-uint128.h
Diff of changes:
diff --git a/code/src/common/triton-uint128.h b/code/src/common/triton-uint128.h
new file mode 100644
index 0000000..2056f72
--- /dev/null
+++ b/code/src/common/triton-uint128.h
@@ -0,0 +1,75 @@
+#ifndef __TRITON_UINT128_H__
+#define __TRITON_UINT128_H__
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "src/common/triton-base.h"
+
+/* unsigned 128 bit integer type */
+typedef struct { uint64_t l; uint64_t u; } uint128_t;
+
+/* maximum true value of unsigned 128 bit integer is:
+ * 340282366920938463463374607431768211455
+ *
+ * but we will actually print it as two 64 bit integers:
+ * 18446744073709551615:18446744073709551615
+ *
+ * need 41 characters to print, 42 including terminating \0
+ */
+#define TRITON_UINT128_STRLEN 42
+
+/* convert to string in uint64_t:uint64_t format (for now) */
+static inline void triton_uint128_to_string(char* buf, int buflen, uint128_t big)
+{
+ assert(buflen >= TRITON_UINT128_STRLEN);
+ snprintf(buf, buflen, "%llu:%llu", llu(big.u), llu(big.l));
+ return;
+}
+
+/* assign a 64 bit value to a uint128_t */
+static inline uint128_t triton_uint128_from_uint64(uint64_t small)
+{
+ uint128_t big;
+ big.u = 0;
+ big.l = small;
+
+ return(big);
+}
+
+/* increment a 128 bit id by 1 */
+static inline uint128_t triton_uint128_inc(uint128_t big)
+{
+ big.l++;
+ if(big.l == 0)
+ big.u++;
+
+ return(big);
+}
+
+/* returns -1, 0, or 1 if a is less than, equal to, or greater than b */
+static inline int triton_cmp_uint128(uint128_t a, uint128_t b)
+{
+ if(a.u > b.u)
+ return 1;
+ if(a.u < b.u)
+ return -1;
+
+ if(a.l > b.l)
+ return 1;
+ if(a.l < b.l)
+ return -1;
+
+ return 0;
+}
+
+#endif /* __TRITON_UINT128_H__ */
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. 63f39865aa07deca6bae37e8c71f4d381689f51b
by noreply@mcs.anl.gov 01 Jul '10
by noreply@mcs.anl.gov 01 Jul '10
01 Jul '10
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 63f39865aa07deca6bae37e8c71f4d381689f51b (commit)
from 298b7af84c187afabf2730e2a471fcbf3b0c4013 (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 63f39865aa07deca6bae37e8c71f4d381689f51b
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Thu Jul 1 16:34:58 2010 -0400
fix #include for hints
-----------------------------------------------------------------------
Summary of changes:
.../aesop/parser/tests/remote/test-remote-mpi.aer | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Diff of changes:
diff --git a/code/src/aesop/parser/tests/remote/test-remote-mpi.aer b/code/src/aesop/parser/tests/remote/test-remote-mpi.aer
index 608ba17..106427a 100644
--- a/code/src/aesop/parser/tests/remote/test-remote-mpi.aer
+++ b/code/src/aesop/parser/tests/remote/test-remote-mpi.aer
@@ -1,7 +1,7 @@
#include <unistd.h>
#include "src/common/triton-types.h"
-#include "src/common/triton-hints.h"
+#include "src/aesop/hints.h"
#include "src/aesop/aesop.h"
#include "src/remote/encoding.h"
#include "src/remote/remote.hae"
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. 298b7af84c187afabf2730e2a471fcbf3b0c4013
by noreply@mcs.anl.gov 01 Jul '10
by noreply@mcs.anl.gov 01 Jul '10
01 Jul '10
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 298b7af84c187afabf2730e2a471fcbf3b0c4013 (commit)
from e9869d51d01ce21660463c6c7b62421e3c0902fb (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 298b7af84c187afabf2730e2a471fcbf3b0c4013
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Thu Jul 1 15:50:21 2010 -0400
cleaning up bdb flags
-----------------------------------------------------------------------
Summary of changes:
code/src/versioned-osd/prototype/versioned-osd.ae | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
Diff of changes:
diff --git a/code/src/versioned-osd/prototype/versioned-osd.ae b/code/src/versioned-osd/prototype/versioned-osd.ae
index 6103f22..e8f1585 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.ae
+++ b/code/src/versioned-osd/prototype/versioned-osd.ae
@@ -1439,7 +1439,6 @@ triton_ret_t vosd_init(const char* db_path,
/* open dbs */
open_flags = DB_CREATE | /* Allow database creation */
- DB_READ_UNCOMMITTED | /* Allow dirty reads */
DB_AUTO_COMMIT; /* Allow autocommit */
ret = log_map_dbp->open(log_map_dbp, NULL, "logical-map.db",
NULL, DB_BTREE, open_flags, 0);
hooks/post-receive
--
Triton Repository
1
0
Triton Repository branch, master, updated. e9869d51d01ce21660463c6c7b62421e3c0902fb
by noreply@mcs.anl.gov 01 Jul '10
by noreply@mcs.anl.gov 01 Jul '10
01 Jul '10
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 e9869d51d01ce21660463c6c7b62421e3c0902fb (commit)
via 2c24c6dcb71bd253c92782664a91c2cf7ec70c67 (commit)
from 68217da6eaf3b790d3fbfed1e50269832cee82bf (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 e9869d51d01ce21660463c6c7b62421e3c0902fb
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Thu Jul 1 15:25:52 2010 -0400
convert vosd to 128 bit oids
commit 2c24c6dcb71bd253c92782664a91c2cf7ec70c67
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Thu Jul 1 14:18:33 2010 -0400
trivial helper functions for uint128_t
-----------------------------------------------------------------------
Summary of changes:
code/src/common/tests/module.mk.in | 2 +
code/src/common/tests/test-uint128.c | 38 ++++++
code/src/common/triton-types.h | 3 +-
.../prototype/tests/vosd-bench-concurrent.ae | 11 +-
.../prototype/tests/vosd-multi-object.ae | 23 ++--
code/src/versioned-osd/prototype/tests/vosd1.ae | 63 +++++-----
code/src/versioned-osd/prototype/versioned-osd.ae | 126 ++++++++++----------
code/src/versioned-osd/prototype/versioned-osd.hae | 14 +-
code/src/versioned-osd/prototype/vosd-fd-cache.ae | 19 ++-
code/src/versioned-osd/prototype/vosd-fd-cache.hae | 6 +-
10 files changed, 176 insertions(+), 129 deletions(-)
create mode 100644 code/src/common/tests/test-uint128.c
Diff of changes:
diff --git a/code/src/common/tests/module.mk.in b/code/src/common/tests/module.mk.in
index c7404cb..6a9df61 100644
--- a/code/src/common/tests/module.mk.in
+++ b/code/src/common/tests/module.mk.in
@@ -7,3 +7,5 @@ TESTSRC += $(DIR)/testhash.c
TESTPARAMS_$(DIR)/testhash = 1000
AETESTSRC += $(DIR)/testnoter.ae
+
+TESTSRC += $(DIR)/test-uint128.c
diff --git a/code/src/common/tests/test-uint128.c b/code/src/common/tests/test-uint128.c
new file mode 100644
index 0000000..d2dedd2
--- /dev/null
+++ b/code/src/common/tests/test-uint128.c
@@ -0,0 +1,38 @@
+
+/* test program to exercies uint128_t utility functions */
+
+#include <stdlib.h>
+#include "src/common/triton-uint128.h"
+
+int main(int argc, char *argv[])
+{
+ uint128_t big;
+ char big_str[TRITON_UINT128_STRLEN];
+
+ big = triton_uint128_from_uint64(0);
+ triton_uint128_to_string(big_str, TRITON_UINT128_STRLEN, big);
+ printf("initialize to zero: %s\n", big_str);
+
+ big = triton_uint128_inc(big);
+ triton_uint128_to_string(big_str, TRITON_UINT128_STRLEN, big);
+ printf("increment by one: %s\n", big_str);
+
+ big = triton_uint128_from_uint64(UINT64_MAX);
+ triton_uint128_to_string(big_str, TRITON_UINT128_STRLEN, big);
+ printf("initialize to UINT64_MAX: %s\n", big_str);
+
+ big = triton_uint128_inc(big);
+ triton_uint128_to_string(big_str, TRITON_UINT128_STRLEN, big);
+ printf("increment by one: %s\n", big_str);
+
+ return(0);
+}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/code/src/common/triton-types.h b/code/src/common/triton-types.h
index 64df71e..1c19662 100644
--- a/code/src/common/triton-types.h
+++ b/code/src/common/triton-types.h
@@ -2,13 +2,12 @@
#define __TRITON_TYPES_H__
#include "src/common/triton-base.h"
+#include "src/common/triton-uint128.h"
/**
* triton-types.h defines fundamental type primitives.
*/
-typedef struct { uint64_t l; uint64_t u; } uint128_t;
-
#include <sys/time.h>
#define TRITON_REL_MSECS_TO_ABS_TIMESPEC(__msecs, __abs) \
diff --git a/code/src/versioned-osd/prototype/tests/vosd-bench-concurrent.ae b/code/src/versioned-osd/prototype/tests/vosd-bench-concurrent.ae
index 7245e7c..06e6411 100644
--- a/code/src/versioned-osd/prototype/tests/vosd-bench-concurrent.ae
+++ b/code/src/versioned-osd/prototype/tests/vosd-bench-concurrent.ae
@@ -38,6 +38,7 @@ static char sync_mode;
static uint64_t first_version;
static uint64_t version;
static int max_seconds = 0;
+static uint128_t oid;
static __blocking int do_vosd_test(void)
{
@@ -47,7 +48,7 @@ static __blocking int do_vosd_test(void)
if(data_mode == 'k')
w_flags |= VOSD_FLAG_TRUNC_WRITE;
- tret = vosd_create(1);
+ tret = vosd_create(oid);
if(tret == TRITON_ERR_EXIST)
{
printf("# operating on existing object.\n");
@@ -55,7 +56,7 @@ static __blocking int do_vosd_test(void)
}
assert(tret == TRITON_ERR_EXIST || tret == TRITON_SUCCESS);
- tret = vosd_get_version(1, &version);
+ tret = vosd_get_version(oid, &version);
assert(tret == TRITON_SUCCESS);
first_version = version;
@@ -117,7 +118,7 @@ static __blocking int do_vosd_test(void)
if(tmp_op->type == WRITE)
{
- b_ret = vosd_write(1, fork, b_version, &buffer,
+ b_ret = vosd_write(oid, fork, b_version, &buffer,
&tmp_op->size, 1, &tmp_op->offset,
&tmp_op->size, 1, w_flags);
assert(b_ret == TRITON_SUCCESS);
@@ -126,7 +127,7 @@ static __blocking int do_vosd_test(void)
{
assert(tmp_op->type == READ);
- b_ret = vosd_read(1, fork, &buffer, &tmp_op->size, 1,
+ b_ret = vosd_read(oid, fork, &buffer, &tmp_op->size, 1,
&tmp_op->offset, &tmp_op->size, 1, &out_size);
assert(b_ret == TRITON_SUCCESS);
assert(out_size == tmp_op->size);
@@ -185,6 +186,8 @@ int main(int argc, char *argv[])
int vosd_init_flags = 0;
int i;
+ oid = triton_uint128_from_uint64(1);
+
if(argc != 11)
{
fprintf(stderr, "Usage: vosd-bench-concurrent <workload description file> <vosd db dir> <vosd log dir> <concurrent ops> <k|d> <db highwater mark> <log highwater mark> <alignment> <o|s|b|n> <max seconds>\n");
diff --git a/code/src/versioned-osd/prototype/tests/vosd-multi-object.ae b/code/src/versioned-osd/prototype/tests/vosd-multi-object.ae
index a521ef8..2b69854 100644
--- a/code/src/versioned-osd/prototype/tests/vosd-multi-object.ae
+++ b/code/src/versioned-osd/prototype/tests/vosd-multi-object.ae
@@ -20,10 +20,10 @@ static __blocking int do_vosd_test(void)
int64_t obj_szs[3];
uint64_t version_array[500];
- uint64_t oid;
+ uint128_t oid;
int64_t out_size;
- int i;
+ uint64_t i;
ret = posix_memalign(&void_buffer, 512, 4096);
assert(ret == 0);
@@ -32,11 +32,11 @@ static __blocking int do_vosd_test(void)
/* create and get version for 500 objects */
for(i=0; i<500; i++)
{
- oid = i+1;
+ oid = triton_uint128_from_uint64(i+1);
tret = vosd_create(oid);
if(tret != TRITON_SUCCESS && tret != TRITON_ERR_EXIST)
{
- printf("Error creating oid=%llu\n", oid);
+ printf("Error creating oid=%llu\n", llu(i+1));
free(buffer);
#if 0
triton_error_destroy(tret);
@@ -50,7 +50,7 @@ static __blocking int do_vosd_test(void)
tret = vosd_get_version(oid, &version_array[i]);
if(tret != TRITON_SUCCESS)
{
- printf("Error getting version number for oid=%llu: %d\n", oid, ret);
+ printf("Error getting version number for oid=%llu: %d\n", llu(i+1), ret);
free(buffer);
#if 0
triton_error_destroy(tret);
@@ -62,7 +62,7 @@ static __blocking int do_vosd_test(void)
/* write something into each object */
for(i=0; i<500; i++)
{
- oid = i+1;
+ oid = triton_uint128_from_uint64(i+1);
buffer_offsets[0] = buffer;
buffer_szs[0] = 1024;
@@ -72,7 +72,7 @@ static __blocking int do_vosd_test(void)
obj_offsets, obj_szs, 1, VOSD_FLAG_AUTO_TXN);
if(tret != TRITON_SUCCESS)
{
- printf("Error writing 0-1024 on oid=%llu: %d\n", oid, ret);
+ printf("Error writing 0-1024 on oid=%llu: %d\n", llu(i+1), ret);
free(buffer);
#if 0
triton_error_destroy(tret);
@@ -87,12 +87,12 @@ static __blocking int do_vosd_test(void)
/* delete them all */
for(i=0; i<500; i++)
{
- oid = i+1;
+ oid = triton_uint128_from_uint64(i+1);
tret = vosd_remove(oid);
if(tret != TRITON_SUCCESS)
{
- printf("Error deleting oid=%llu\n", oid);
+ printf("Error deleting oid=%llu\n", i+1);
free(buffer);
#if 0
triton_error_destroy(tret);
@@ -105,7 +105,8 @@ static __blocking int do_vosd_test(void)
assert(tret == TRITON_SUCCESS);
/* try to delete something that doesn't exist */
- tret = vosd_remove(0);
+ oid = triton_uint128_from_uint64(0);
+ tret = vosd_remove(oid);
assert(tret == TRITON_ERR_NOENT);
#if 0
triton_error_destroy(tret);
@@ -154,7 +155,7 @@ int main(int argc, char *argv[])
return(-1);
}
- ret = vosd_init("/tmp/vosd", "/tmp/vosd/logs", 0, 4096, VOSD_INIT_FLAG_DATA_ODIRECT);
+ ret = vosd_init("/tmp/vosd", "/tmp/vosd/logs", 0, 0, 4096, VOSD_INIT_FLAG_DATA_ODIRECT);
if(ret != TRITON_SUCCESS)
{
triton_perror("vosd_init", ret);
diff --git a/code/src/versioned-osd/prototype/tests/vosd1.ae b/code/src/versioned-osd/prototype/tests/vosd1.ae
index ba5897d..38fb992 100644
--- a/code/src/versioned-osd/prototype/tests/vosd1.ae
+++ b/code/src/versioned-osd/prototype/tests/vosd1.ae
@@ -28,13 +28,14 @@ static __blocking int do_vosd_test(void)
int ret;
int64_t out_size;
int i;
+ uint128_t oid = triton_uint128_from_uint64(1);
ret = posix_memalign(&void_buffer, 512, 4096);
assert(ret == 0);
buffer = void_buffer;
printf("Creating oid 1 ...\n");
- tret = vosd_create(1);
+ tret = vosd_create(oid);
if(tret != TRITON_SUCCESS && tret != TRITON_ERR_EXIST)
{
free(buffer);
@@ -50,7 +51,7 @@ static __blocking int do_vosd_test(void)
#endif
printf("Getting version number of oid 1...\n");
- tret = vosd_get_version(1, &version);
+ tret = vosd_get_version(oid, &version);
if(tret != TRITON_SUCCESS)
{
printf("Error getting version number for oid=1.\n");
@@ -75,7 +76,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
- tret = vosd_txn_open(1, 0, (++version));
+ tret = vosd_txn_open(oid, 0, (++version));
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1.\n");
@@ -92,7 +93,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 1024;
obj_offsets[0] = 0;
obj_szs[0] = 1024;
- tret = vosd_write(1, 0, (version), buffer_offsets, buffer_szs, 1,
+ tret = vosd_write(oid, 0, (version), buffer_offsets, buffer_szs, 1,
obj_offsets, obj_szs, 1, 0);
if(tret != TRITON_SUCCESS)
{
@@ -106,7 +107,7 @@ static __blocking int do_vosd_test(void)
printf("DONE\n");
printf("closing txn...\n");
- tret = vosd_txn_close(1, 0, (version));
+ tret = vosd_txn_close(oid, 0, (version));
if(tret != TRITON_SUCCESS)
{
printf("Error closing txn 1.\n");
@@ -132,7 +133,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
version = version+2;
- tret = vosd_txn_open(1, 0, (version));
+ tret = vosd_txn_open(oid, 0, (version));
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1: %d\n", ret);
@@ -155,7 +156,7 @@ static __blocking int do_vosd_test(void)
obj_offsets[1] = 2000;
obj_szs[0] = 100;
obj_szs[1] = 924;
- tret = vosd_write(1, 0, (version), buffer_offsets, buffer_szs, 3,
+ tret = vosd_write(oid, 0, (version), buffer_offsets, buffer_szs, 3,
obj_offsets, obj_szs, 2, 0);
if(tret != TRITON_SUCCESS)
{
@@ -169,7 +170,7 @@ static __blocking int do_vosd_test(void)
printf("DONE\n");
printf("closing txn...\n");
- tret = vosd_txn_close(1, 0, (version));
+ tret = vosd_txn_close(oid, 0, (version));
if(tret != TRITON_SUCCESS)
{
printf("Error closing txn 1: %d\n", ret);
@@ -194,7 +195,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
- tret = vosd_txn_open(1, 0, (version-1));
+ tret = vosd_txn_open(oid, 0, (version-1));
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1: %d\n", ret);
@@ -211,7 +212,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 4096;
obj_offsets[0] = 200;
obj_szs[0] = 4096;
- tret = vosd_write(1, 0, (version-1), buffer_offsets, buffer_szs, 1,
+ tret = vosd_write(oid, 0, (version-1), buffer_offsets, buffer_szs, 1,
obj_offsets, obj_szs, 1, 0);
if(tret != TRITON_SUCCESS)
{
@@ -225,7 +226,7 @@ static __blocking int do_vosd_test(void)
printf("DONE\n");
printf("closing txn...\n");
- tret = vosd_txn_close(1, 0, (version-1));
+ tret = vosd_txn_close(oid, 0, (version-1));
if(tret != TRITON_SUCCESS)
{
printf("Error closing txn 1: %d\n", ret);
@@ -254,7 +255,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 512;
obj_offsets[0] = 1024;
obj_szs[0] = 512;
- tret = vosd_read(1, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
+ tret = vosd_read(oid, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
obj_szs, 1, &out_size);
assert(out_size == 512);
if(tret != TRITON_SUCCESS)
@@ -274,7 +275,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 512;
obj_offsets[0] = 51200;
obj_szs[0] = 512;
- tret = vosd_read(1, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
+ tret = vosd_read(oid, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
obj_szs, 1, &out_size);
if(tret != TRITON_SUCCESS || out_size != 0)
{
@@ -295,7 +296,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[1] = 12;
obj_offsets[0] = 13;
obj_szs[0] = 1524;
- tret = vosd_read(1, 0, buffer_offsets, buffer_szs, 2, obj_offsets,
+ tret = vosd_read(oid, 0, buffer_offsets, buffer_szs, 2, obj_offsets,
obj_szs, 1, &out_size);
if(tret != TRITON_SUCCESS)
{
@@ -311,7 +312,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
- tret = vosd_txn_open(1, 0, (++version));
+ tret = vosd_txn_open(oid, 0, (++version));
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1: %d\n", ret);
@@ -329,7 +330,7 @@ static __blocking int do_vosd_test(void)
sprintf(buffer, "Hello world.");
obj_offsets[0] = 10024;
obj_szs[0] = 13;
- tret = vosd_write(1, 0, (version), buffer_offsets, buffer_szs, 1,
+ tret = vosd_write(oid, 0, (version), buffer_offsets, buffer_szs, 1,
obj_offsets, obj_szs, 1, 0);
if(tret != TRITON_SUCCESS)
{
@@ -343,7 +344,7 @@ static __blocking int do_vosd_test(void)
printf("DONE\n");
printf("closing txn...\n");
- tret = vosd_txn_close(1, 0, (version));
+ tret = vosd_txn_close(oid, 0, (version));
if(tret != TRITON_SUCCESS)
{
printf("Error closing txn: %d\n", ret);
@@ -364,7 +365,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 512;
obj_offsets[0] = 9525;
obj_szs[0] = 512;
- tret = vosd_read(1, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
+ tret = vosd_read(oid, 0, buffer_offsets, buffer_szs, 1, obj_offsets,
obj_szs, 1, &out_size);
if(tret != TRITON_SUCCESS)
{
@@ -386,7 +387,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("writing to two forks...\n");
- tret = vosd_txn_open(1, 1, (++version));
+ tret = vosd_txn_open(oid, 1, (++version));
assert(tret == TRITON_SUCCESS);
buffer_offsets[0] = buffer;
@@ -394,14 +395,14 @@ static __blocking int do_vosd_test(void)
sprintf(buffer, "fork1");
obj_offsets[0] = 0;
obj_szs[0] = 6;
- tret = vosd_write(1, 1, (version), buffer_offsets, buffer_szs, 1,
+ tret = vosd_write(oid, 1, (version), buffer_offsets, buffer_szs, 1,
obj_offsets, obj_szs, 1, 0);
assert(tret == TRITON_SUCCESS);
- tret = vosd_txn_close(1, 1, (version));
+ tret = vosd_txn_close(oid, 1, (version));
assert(tret == TRITON_SUCCESS);
- tret = vosd_txn_open(1, 2, (++version));
+ tret = vosd_txn_open(oid, 2, (++version));
assert(tret == TRITON_SUCCESS);
buffer_offsets[0] = buffer;
@@ -409,11 +410,11 @@ static __blocking int do_vosd_test(void)
sprintf(buffer, "fork2");
obj_offsets[0] = 0;
obj_szs[0] = 6;
- tret = vosd_write(1, 2, (version), buffer_offsets, buffer_szs, 1,
+ tret = vosd_write(oid, 2, (version), buffer_offsets, buffer_szs, 1,
obj_offsets, obj_szs, 1, 0);
assert(tret == TRITON_SUCCESS);
- tret = vosd_txn_close(1, 2, (version));
+ tret = vosd_txn_close(oid, 2, (version));
assert(tret == TRITON_SUCCESS);
printf("DONE\n");
@@ -423,7 +424,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 512;
obj_offsets[0] = 0;
obj_szs[0] = 512;
- tret = vosd_read(1, 1, buffer_offsets, buffer_szs, 1, obj_offsets,
+ tret = vosd_read(oid, 1, buffer_offsets, buffer_szs, 1, obj_offsets,
obj_szs, 1, &out_size);
assert(tret == TRITON_SUCCESS && out_size == 6);
@@ -434,7 +435,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 256;
obj_offsets[0] = 0;
obj_szs[0] = 256;
- tret = vosd_read(1, 2, buffer_offsets, buffer_szs, 1, obj_offsets,
+ tret = vosd_read(oid, 2, buffer_offsets, buffer_szs, 1, obj_offsets,
obj_szs, 1, &out_size);
assert(tret == TRITON_SUCCESS && out_size == 6);
@@ -448,7 +449,7 @@ static __blocking int do_vosd_test(void)
/********************************************************/
printf("opening txn...\n");
- tret = vosd_txn_open(1, 0, (++version));
+ tret = vosd_txn_open(oid, 0, (++version));
if(tret != TRITON_SUCCESS)
{
printf("Error opening txn 1: %d\n", ret);
@@ -465,7 +466,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 1024;
obj_offsets[0] = 0;
obj_szs[0] = 1024;
- tret = vosd_write(1, 0, (version), buffer_offsets, buffer_szs, 1,
+ tret = vosd_write(oid, 0, (version), buffer_offsets, buffer_szs, 1,
obj_offsets, obj_szs, 1, VOSD_FLAG_TRUNC_WRITE);
if(tret != TRITON_SUCCESS)
{
@@ -479,7 +480,7 @@ static __blocking int do_vosd_test(void)
printf("DONE\n");
printf("closing txn...\n");
- tret = vosd_txn_close(1, 0, (version));
+ tret = vosd_txn_close(oid, 0, (version));
if(tret != TRITON_SUCCESS)
{
printf("Error closing txn 1: %d\n", ret);
@@ -501,7 +502,7 @@ static __blocking int do_vosd_test(void)
buffer_szs[0] = 512;
obj_offsets[0] = 512;
obj_szs[0] = 512;
- tret = vosd_write(1, 0, (++version), buffer_offsets, buffer_szs, 1,
+ tret = vosd_write(oid, 0, (++version), buffer_offsets, buffer_szs, 1,
obj_offsets, obj_szs, 1, VOSD_FLAG_AUTO_TXN);
if(tret != TRITON_SUCCESS)
{
@@ -524,8 +525,8 @@ int main(int argc, char *argv[])
{
triton_ret_t ret;
ae_context_t ctx;
- ae_op_id_t op_id;
int pc = 0;
+ ae_op_id_t op_id;
ret = triton_debug_init();
if(ret != TRITON_SUCCESS)
diff --git a/code/src/versioned-osd/prototype/versioned-osd.ae b/code/src/versioned-osd/prototype/versioned-osd.ae
index 5af6886..6103f22 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.ae
+++ b/code/src/versioned-osd/prototype/versioned-osd.ae
@@ -60,7 +60,7 @@ static int global_flags = 0;
struct coalesce_obj
{
- uint64_t oid;
+ uint128_t oid;
int flags;
triton_sched_id_t sched_id;
triton_list_link_t link;
@@ -87,7 +87,7 @@ struct logical_map_entry
/* identifies entries in the mapping of logical offsets to log offsets */
struct logical_map_key
{
- uint64_t oid;
+ uint128_t oid;
uint64_t oid_fork;
int64_t logical_offset_end;
};
@@ -95,14 +95,14 @@ struct logical_map_key
/* represents a missing version number in a particular object */
struct missing_version
{
- uint64_t oid;
+ uint128_t oid;
uint64_t version;
};
/* uniquely identifies each active txn (in memory) */
struct txn_accumulator
{
- uint64_t oid;
+ uint128_t oid;
uint64_t oid_fork;
/* txn identifier */
uint64_t txn_number;
@@ -137,7 +137,7 @@ struct txn_accumulator
static int compare_log_map_key(DB * dbp, const DBT * a, const DBT * b);
static int compare_missing_version(DB * dbp, const DBT * a, const DBT * b);
-static int compare_uint64(DB * dbp, const DBT * a, const DBT * b);
+static int compare_uint128(DB * dbp, const DBT * a, const DBT * b);
static int txn_acc_compare(void *key, struct triton_hash_link *hash_link);
static int advance_listio_ptrs(
char** mem_offsets,
@@ -174,12 +174,13 @@ static __blocking triton_ret_t end_write(struct coalesce_obj *obj)
struct coalesce_obj *cop;
triton_ret_t tret = TRITON_SUCCESS;
double start, finish;
- uint64_t *oids_to_sync = NULL;
+ uint128_t *oids_to_sync = NULL;
int oids_to_sync_count = 0;
int db_sync_flag = 0;
int i;
struct fd_cache_entry* fd_entry;
int max_highwater = 0;
+ uint128_t zero = triton_uint128_from_uint64(0);
/* don't coalesce if coalescing is disabled */
if(global_db_coalesce_highwater == 0)
@@ -193,7 +194,7 @@ static __blocking triton_ret_t end_write(struct coalesce_obj *obj)
if(!(obj->flags & COALESCE_DATA || obj->flags & COALESCE_DB))
return TRITON_SUCCESS;
- oids_to_sync = (uint64_t*)malloc(global_data_coalesce_highwater * sizeof(*oids_to_sync));
+ oids_to_sync = (uint128_t*)malloc(global_data_coalesce_highwater * sizeof(*oids_to_sync));
if(!oids_to_sync)
{
return(TRITON_ERR_NOMEM);
@@ -241,11 +242,11 @@ static __blocking triton_ret_t end_write(struct coalesce_obj *obj)
/* record list of oids to sync */
for(i=0; i<global_data_coalesce_highwater; i++)
{
- if(oids_to_sync[i] == cop->oid)
+ if(triton_cmp_uint128(oids_to_sync[i], cop->oid) == 0)
{
break;
}
- if(oids_to_sync[i] == 0)
+ if(triton_cmp_uint128(oids_to_sync[i], zero) == 0)
{
oids_to_sync[i] = cop->oid;
oids_to_sync_count++;
@@ -324,10 +325,10 @@ static __blocking triton_ret_t end_write(struct coalesce_obj *obj)
* instead
*/
#if 0
-static __blocking triton_ret_t __vosd_create_retryable(uint64_t oid);
+static __blocking triton_ret_t __vosd_create_retryable(uint128_t oid);
#endif
-static __blocking triton_ret_t __vosd_create_retryable(uint64_t oid)
+static __blocking triton_ret_t __vosd_create_retryable(uint128_t oid)
{
triton_ret_t tret;
triton_ret_t tret_tmp;
@@ -364,7 +365,7 @@ static __blocking triton_ret_t __vosd_create_retryable(uint64_t oid)
/* TODO: this function is a temporary workaround for compile time error when
* clear_missing_vers() invokes two blocking functions in a for loop
*/
-static __blocking triton_ret_t cursor_get_and_del_missing_ver(uint64_t oid,
+static __blocking triton_ret_t cursor_get_and_del_missing_ver(uint128_t oid,
DBT* missing_ver_key, DBT* missing_ver_value, int c_get_flag,
DBC *missing_ver_dbcp)
{
@@ -373,7 +374,7 @@ static __blocking triton_ret_t cursor_get_and_del_missing_ver(uint64_t oid,
tret = bdb_cursor_get(missing_ver_dbcp,
missing_ver_key, missing_ver_value, c_get_flag);
- if(tret == TRITON_SUCCESS && mvk->oid != oid)
+ if(tret == TRITON_SUCCESS && (triton_cmp_uint128(mvk->oid, oid) != 0))
{
/* hit the next object */
tret = TRITON_ERR_NOENT;
@@ -389,12 +390,12 @@ static __blocking triton_ret_t cursor_get_and_del_missing_ver(uint64_t oid,
#if 0
static __blocking triton_ret_t clear_missing_vers(
- uint64_t oid,
+ uint128_t oid,
DB_TXN *txn,
DBC *missing_ver_dbcp);
#endif
static __blocking triton_ret_t clear_missing_vers(
- uint64_t oid,
+ uint128_t oid,
DB_TXN *txn,
DBC *missing_ver_dbcp)
{
@@ -434,7 +435,7 @@ static __blocking triton_ret_t clear_missing_vers(
/* TODO: this function is a temporary workaround for compile time error when
* clear_logical_map() invokes two blocking functions in a for loop
*/
-static __blocking triton_ret_t cursor_get_and_del_log_map(uint64_t oid,
+static __blocking triton_ret_t cursor_get_and_del_log_map(uint128_t oid,
DBT* log_map_key, DBT* log_map_value, int c_get_flag,
DBC *log_map_dbcp)
{
@@ -443,7 +444,7 @@ static __blocking triton_ret_t cursor_get_and_del_log_map(uint64_t oid,
tret = bdb_cursor_get(log_map_dbcp,
log_map_key, log_map_value, c_get_flag);
- if(tret == TRITON_SUCCESS && lmk->oid != oid)
+ if(tret == TRITON_SUCCESS && (triton_cmp_uint128(lmk->oid, oid) != 0))
{
/* hit the next object */
tret = TRITON_ERR_NOENT;
@@ -460,12 +461,12 @@ static __blocking triton_ret_t cursor_get_and_del_log_map(uint64_t oid,
#if 0
static __blocking triton_ret_t clear_logical_map(
- uint64_t oid,
+ uint128_t oid,
DB_TXN *txn,
DBC *log_map_dbcp);
#endif
static __blocking triton_ret_t clear_logical_map(
- uint64_t oid,
+ uint128_t oid,
DB_TXN *txn,
DBC *log_map_dbcp)
{
@@ -505,10 +506,10 @@ static __blocking triton_ret_t clear_logical_map(
}
#if 0
-static __blocking triton_ret_t __vosd_remove_retryable(uint64_t oid);
+static __blocking triton_ret_t __vosd_remove_retryable(uint128_t oid);
#endif
-static __blocking triton_ret_t __vosd_remove_retryable(uint64_t oid)
+static __blocking triton_ret_t __vosd_remove_retryable(uint128_t oid)
{
triton_ret_t tret;
triton_ret_t tret_tmp;
@@ -516,7 +517,7 @@ static __blocking triton_ret_t __vosd_remove_retryable(uint64_t oid)
DBC *log_map_dbcp, *missing_ver_dbcp;
DBT ver_key;
DBT ver_value;
- uint64_t vk;
+ uint128_t vk;
uint64_t vv;
tret = bdb_txn_begin(envp, NULL, &txn, 0);
@@ -626,9 +627,9 @@ static __blocking triton_ret_t __vosd_remove_retryable(uint64_t oid)
}
#if 0
-static __blocking triton_ret_t __vosd_get_version_retryable(uint64_t oid, uint64_t* version);
+static __blocking triton_ret_t __vosd_get_version_retryable(uint128_t oid, uint64_t* version);
#endif
-static __blocking triton_ret_t __vosd_get_version_retryable(uint64_t oid, uint64_t* version)
+static __blocking triton_ret_t __vosd_get_version_retryable(uint128_t oid, uint64_t* version)
{
DB_TXN *txn;
DBT key, value;
@@ -669,7 +670,7 @@ static __blocking triton_ret_t find_entries_on_disk(.......);
*/
static __blocking triton_ret_t find_entries_on_disk(
triton_list_t* on_disk_entries,
- uint64_t oid,
+ uint128_t oid,
uint64_t oid_fork,
struct logical_map_entry* update,
DBC *dbc_p)
@@ -696,7 +697,7 @@ static __blocking triton_ret_t find_entries_on_disk(
* flag is set to truncate the whole fork.
*/
while((tret == TRITON_SUCCESS) &&
- (lmk.oid == oid) &&
+ (triton_cmp_uint128(lmk.oid, oid) == 0) &&
(lmk.oid_fork == oid_fork) &&
((lme.logical_offset < update->logical_offset_end) ||
(update->flags & VOSD_FLAG_TRUNC_WRITE)))
@@ -955,7 +956,7 @@ static __blocking triton_ret_t __vosd_txn_close_retryable(
static __blocking triton_ret_t vosd_txn_close_internal(
- uint64_t oid,
+ uint128_t oid,
uint64_t oid_fork,
uint64_t txn_number)
{
@@ -974,7 +975,7 @@ static __blocking triton_ret_t vosd_txn_close_internal(
txn_acc = triton_hash_get_entry(hash_link, struct txn_accumulator,
hash_link);
- if(txn_acc->oid != oid ||
+ if(triton_cmp_uint128(txn_acc->oid, oid) != 0 ||
txn_acc->oid_fork != oid_fork)
{
triton_mutex_unlock(&txn_mutex);
@@ -1069,7 +1070,7 @@ static __blocking triton_ret_t get_read_region(
}
if(tret == TRITON_SUCCESS &&
- (lmk->oid != lmk_orig.oid || lmk->oid_fork != lmk_orig.oid_fork))
+ (triton_cmp_uint128(lmk->oid, lmk_orig.oid) != 0 || lmk->oid_fork != lmk_orig.oid_fork))
{
/* We overshot the object that we were looking for (EOF, in other
* words). Return NOENT to caller.
@@ -1082,7 +1083,7 @@ static __blocking triton_ret_t get_read_region(
#if 0
static __blocking triton_ret_t read_segment(
- uint64_t oid,
+ uint128_t oid,
uint64_t oid_fork,
char* mem_offset,
int64_t mem_size,
@@ -1092,7 +1093,7 @@ static __blocking triton_ret_t read_segment(
#endif
static __blocking triton_ret_t read_segment(
- uint64_t oid,
+ uint128_t oid,
uint64_t oid_fork,
char* mem_offset,
int64_t mem_size,
@@ -1434,7 +1435,7 @@ triton_ret_t vosd_init(const char* db_path,
tret = triton_ret_from_bdb(ret);
goto vosd_init_error;
}
- ver_dbp->set_bt_compare(ver_dbp, compare_uint64);
+ ver_dbp->set_bt_compare(ver_dbp, compare_uint128);
/* open dbs */
open_flags = DB_CREATE | /* Allow database creation */
@@ -1533,7 +1534,7 @@ void vosd_finalize(void)
}
-__blocking triton_ret_t vosd_get_version(uint64_t oid, uint64_t* version)
+__blocking triton_ret_t vosd_get_version(uint128_t oid, uint64_t* version)
{
triton_ret_t tret;
@@ -1552,7 +1553,7 @@ __blocking triton_ret_t vosd_get_version(uint64_t oid, uint64_t* version)
return(tret);
}
-__blocking triton_ret_t vosd_create(uint64_t oid)
+__blocking triton_ret_t vosd_create(uint128_t oid)
{
triton_ret_t tret;
triton_ret_t tret_tmp;
@@ -1596,10 +1597,11 @@ __blocking triton_ret_t vosd_dump(void)
DBT log_map_key, missing_ver_key, ver_key;
DBT log_map_value, missing_ver_value, ver_value;
int c_get_flag = DB_SET_RANGE;
+ char oid_str[TRITON_UINT128_STRLEN];
struct logical_map_key lmk;
struct missing_version mvk;
- uint64_t vk = 0;
+ uint128_t vk = triton_uint128_from_uint64(0);
struct logical_map_entry lmv;
uint64_t vv;
@@ -1674,7 +1676,8 @@ __blocking triton_ret_t vosd_dump(void)
tret = bdb_cursor_get(ver_dbcp, &ver_key, &ver_value, DB_NEXT);
while (tret == TRITON_SUCCESS)
{
- printf("OID: %llu\n", llu(vk));
+ triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, vk);
+ printf("OID: %s\n", oid_str);
printf("=============================================\n");
printf(" version: %llu\n", llu(vv));
@@ -1727,7 +1730,7 @@ __blocking triton_ret_t vosd_dump(void)
c_get_flag = DB_SET_RANGE;
tret = bdb_cursor_get(log_map_dbcp, &log_map_key,
&log_map_value, c_get_flag);
- while(tret == TRITON_SUCCESS && lmk.oid == vk)
+ while(tret == TRITON_SUCCESS && triton_cmp_uint128(lmk.oid, vk) == 0)
{
printf("fork: %llu, logical_off: %lld, logical_end: %lld, size: %lld, log_off: %lld, ver: %llu\n",
llu(lmk.oid_fork),
@@ -1811,7 +1814,7 @@ __blocking triton_ret_t vosd_dump(void)
}
triton_ret_t vosd_txn_open(
- uint64_t oid, /**< object to operate on */
+ uint128_t oid, /**< object to operate on */
uint64_t oid_fork, /**< fork to operate on */
uint64_t txn_number /**< caller-assigned txn identifier */
)
@@ -1839,7 +1842,7 @@ triton_ret_t vosd_txn_open(
}
static __blocking triton_ret_t vosd_write_internal(
- uint64_t oid,
+ uint128_t oid,
uint64_t oid_fork,
uint64_t txn_number,
char** mem_offsets,
@@ -2017,7 +2020,7 @@ static __blocking triton_ret_t vosd_write_internal(
txn_acc = triton_hash_get_entry(hash_link, struct txn_accumulator,
hash_link);
/* check that oid and fork match */
- if(txn_acc->oid != oid ||
+ if(triton_cmp_uint128(txn_acc->oid, oid) != 0 ||
txn_acc->oid_fork != oid_fork)
{
triton_mutex_unlock(&txn_mutex);
@@ -2048,7 +2051,7 @@ static __blocking triton_ret_t vosd_write_internal(
}
__blocking triton_ret_t vosd_write(
- uint64_t oid,
+ uint128_t oid,
uint64_t oid_fork,
uint64_t txn_number,
char** mem_offsets,
@@ -2083,7 +2086,7 @@ __blocking triton_ret_t vosd_write(
__blocking triton_ret_t vosd_txn_close(
- uint64_t oid,
+ uint128_t oid,
uint64_t oid_fork,
uint64_t txn_number)
{
@@ -2110,7 +2113,7 @@ __blocking triton_ret_t vosd_txn_close(
__blocking triton_ret_t vosd_read(
- uint64_t oid,
+ uint128_t oid,
uint64_t oid_fork,
char** mem_offsets,
int64_t* mem_sizes,
@@ -2194,7 +2197,7 @@ __blocking triton_ret_t vosd_read(
return(TRITON_SUCCESS);
}
-__blocking triton_ret_t vosd_remove(uint64_t oid)
+__blocking triton_ret_t vosd_remove(uint128_t oid)
{
triton_ret_t tret;
triton_ret_t tret_tmp;
@@ -2228,16 +2231,16 @@ static int compare_log_map_key(DB * dbp, const DBT * a, const DBT * b)
{
struct logical_map_key* lmk_a;
struct logical_map_key* lmk_b;
+ int tmp_cmp;
lmk_a = (struct logical_map_key *) a->data;
lmk_b = (struct logical_map_key *) b->data;
/* oid takes precedence */
- if(lmk_a->oid > lmk_b->oid)
- return(1);
- if(lmk_a->oid < lmk_b->oid)
- return(-1);
-
+ tmp_cmp = triton_cmp_uint128(lmk_a->oid, lmk_b->oid);
+ if(tmp_cmp != 0)
+ return(tmp_cmp);
+
/* then fork */
if(lmk_a->oid_fork > lmk_b->oid_fork)
return(1);
@@ -2257,15 +2260,15 @@ static int compare_missing_version(DB * dbp, const DBT * a, const DBT * b)
{
struct missing_version* ver_a;
struct missing_version* ver_b;
+ int tmp_cmp;
ver_a = (struct missing_version *) a->data;
ver_b = (struct missing_version *) b->data;
/* oid takes precendenc */
- if(ver_a->oid > ver_b->oid)
- return 1;
- if(ver_a->oid < ver_b->oid)
- return -1;
+ tmp_cmp = triton_cmp_uint128(ver_a->oid, ver_b->oid);
+ if(tmp_cmp != 0)
+ return(tmp_cmp);
/* then version within oid */
if(ver_a->version > ver_b->version)
@@ -2276,20 +2279,15 @@ static int compare_missing_version(DB * dbp, const DBT * a, const DBT * b)
return(0);
}
-static int compare_uint64(DB * dbp, const DBT * a, const DBT * b)
+static int compare_uint128(DB * dbp, const DBT * a, const DBT * b)
{
- uint64_t* int_a;
- uint64_t* int_b;
+ uint128_t* int_a;
+ uint128_t* int_b;
- int_a = (uint64_t *) a->data;
- int_b = (uint64_t *) b->data;
+ int_a = (uint128_t *) a->data;
+ int_b = (uint128_t *) b->data;
- if(*int_a > *int_b)
- return(1);
- if(*int_a < *int_b)
- return(-1);
-
- return(0);
+ return(triton_cmp_uint128(*int_a, *int_b));
}
static int txn_acc_compare(void *key, struct triton_hash_link *hash_link)
diff --git a/code/src/versioned-osd/prototype/versioned-osd.hae b/code/src/versioned-osd/prototype/versioned-osd.hae
index 2acb5a4..abe0b86 100644
--- a/code/src/versioned-osd/prototype/versioned-osd.hae
+++ b/code/src/versioned-osd/prototype/versioned-osd.hae
@@ -50,7 +50,7 @@ void vosd_finalize(void);
* Creates a new object
*/
__blocking triton_ret_t vosd_create(
- uint64_t oid /**< requested identifier */
+ uint128_t oid /**< requested identifier */
);
@@ -58,7 +58,7 @@ __blocking triton_ret_t vosd_create(
* Retrieves current version number of object
*/
__blocking triton_ret_t vosd_get_version(
- uint64_t oid, /**< object to operate on */
+ uint128_t oid, /**< object to operate on */
uint64_t* version /**< version number of object */
);
@@ -72,7 +72,7 @@ __blocking triton_ret_t vosd_dump(void);
* Opens a txn
*/
triton_ret_t vosd_txn_open(
- uint64_t oid, /**< object to operate on */
+ uint128_t oid, /**< object to operate on */
uint64_t fork, /**< fork to operate on */
uint64_t txn_number /**< caller-assigned txn identifier */
);
@@ -81,7 +81,7 @@ triton_ret_t vosd_txn_open(
* Writes data into an object
*/
__blocking triton_ret_t vosd_write(
- uint64_t oid, /**< object to operate on */
+ uint128_t oid, /**< object to operate on */
uint64_t fork, /**< fork identifier */
uint64_t txn_number, /**< txn identifier */
char** mem_offsets, /**< memory region pointers */
@@ -97,7 +97,7 @@ __blocking triton_ret_t vosd_write(
* Closes a txn
*/
__blocking triton_ret_t vosd_txn_close(
- uint64_t oid, /**< object to operate on */
+ uint128_t oid, /**< object to operate on */
uint64_t fork, /**< fork to operate on */
uint64_t txn_number /**< caller-assigned txn identifier */
);
@@ -106,7 +106,7 @@ __blocking triton_ret_t vosd_txn_close(
* Reads data from an object
*/
__blocking triton_ret_t vosd_read(
- uint64_t oid, /**< object to operate on */
+ uint128_t oid, /**< object to operate on */
uint64_t fork, /**< object fork to operate on */
char** mem_offsets, /**< memory region pointers */
int64_t* mem_sizes, /**< memory region sizes */
@@ -121,7 +121,7 @@ __blocking triton_ret_t vosd_read(
* Removes an existing object
*/
__blocking triton_ret_t vosd_remove(
- uint64_t oid /**< oid to remove */
+ uint128_t oid /**< oid to remove */
);
#endif /* __VERSIONED_OSD_HAE__ */
diff --git a/code/src/versioned-osd/prototype/vosd-fd-cache.ae b/code/src/versioned-osd/prototype/vosd-fd-cache.ae
index be1a9f5..d7511b5 100644
--- a/code/src/versioned-osd/prototype/vosd-fd-cache.ae
+++ b/code/src/versioned-osd/prototype/vosd-fd-cache.ae
@@ -90,12 +90,13 @@ void fd_cache_finalize(void)
return;
}
-__blocking void fd_cache_remove(uint64_t oid)
+__blocking void fd_cache_remove(uint128_t oid)
{
struct triton_hash_link* tmp_link;
struct fd_cache_entry* tmp_entry;
char log_name [PATH_MAX];
triton_ret_t tret;
+ char oid_str[TRITON_UINT128_STRLEN];
triton_mutex_lock(&fd_mutex);
@@ -126,8 +127,8 @@ __blocking void fd_cache_remove(uint64_t oid)
}
/* actually unlink the log file */
- sprintf(log_name, "%s/%llu.dat", fd_cache_cosd_log_path,
- llu(oid));
+ triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ sprintf(log_name, "%s/%s.dat", fd_cache_cosd_log_path, oid_str);
/* TODO: this should be a resource function */
unlink(log_name);
@@ -135,7 +136,7 @@ __blocking void fd_cache_remove(uint64_t oid)
return;
}
-__blocking triton_ret_t fd_cache_get(struct fd_cache_entry **entry, uint64_t oid, int alignment, int flags, int data_coalesce_highwater)
+__blocking triton_ret_t fd_cache_get(struct fd_cache_entry **entry, uint128_t oid, int alignment, int flags, int data_coalesce_highwater)
{
struct triton_hash_link* tmp_link;
struct fd_cache_entry* tmp_entry;
@@ -147,6 +148,7 @@ __blocking triton_ret_t fd_cache_get(struct fd_cache_entry **entry, uint64_t oid
triton_ret_t tret;
triton_ret_t tret_tmp;
int posix_open_flags = O_RDWR|O_CREAT|O_NOATIME;
+ char oid_str[TRITON_UINT128_STRLEN];
triton_mutex_lock(&fd_mutex);
assert(oid_table);
@@ -185,8 +187,8 @@ __blocking triton_ret_t fd_cache_get(struct fd_cache_entry **entry, uint64_t oid
posix_open_flags |= O_DSYNC;
/* actually open the file */
- sprintf(log_name, "%s/%llu.dat", fd_cache_cosd_log_path,
- llu(oid));
+ triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ sprintf(log_name, "%s/%s.dat", fd_cache_cosd_log_path, oid_str);
tret = file_open(&tmp_entry->fd, log_name, posix_open_flags,
S_IRUSR|S_IWUSR);
if(tret != TRITON_SUCCESS)
@@ -323,7 +325,10 @@ static int oid_compare(void *key, struct triton_hash_link *hash_link)
struct fd_cache_entry *entry;
entry = triton_hash_get_entry(hash_link, struct fd_cache_entry, hash_link);
- return(*((uint64_t*)key) == entry->oid);
+ if(triton_cmp_uint128(*((uint128_t*)key), entry->oid) == 0)
+ return(1);
+ else
+ return(0);
}
static void fd_cache_destructor(struct fd_cache_entry* entry)
diff --git a/code/src/versioned-osd/prototype/vosd-fd-cache.hae b/code/src/versioned-osd/prototype/vosd-fd-cache.hae
index 0137588..642c433 100644
--- a/code/src/versioned-osd/prototype/vosd-fd-cache.hae
+++ b/code/src/versioned-osd/prototype/vosd-fd-cache.hae
@@ -22,7 +22,7 @@
struct fd_cache_entry
{
- uint64_t oid; /* object id */
+ uint128_t oid; /* object id */
int fd; /* file descriptor */
int64_t log_offset; /* next available log offset */
triton_mutex_t log_offset_mutex; /* protects log_offset field */
@@ -46,7 +46,7 @@ void fd_cache_finalize(void);
*/
__blocking triton_ret_t fd_cache_get(
struct fd_cache_entry** entry,
- uint64_t oid, /**< object ID */
+ uint128_t oid, /**< object ID */
int alignment, /**< I/O alignment */
int flags, /**< flags to modify open() behavior */
int data_coalesce_highwater /**< what sort of data coalescing is enabled */
@@ -63,7 +63,7 @@ void fd_cache_put(
* Removes an object
*/
__blocking void fd_cache_remove(
- uint64_t oid /**< object ID */
+ uint128_t oid /**< object ID */
);
hooks/post-receive
--
Triton Repository
1
0