From 043b9a7a01bde05b74b878cd961d1935187a1529 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Wed, 20 Feb 2008 22:56:52 +0000 Subject: [PATCH] Regions are 1 offset;iterator was totally broken. --- src/stasis/operations/regions.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/stasis/operations/regions.c b/src/stasis/operations/regions.c index 997e70b..dcdf37c 100644 --- a/src/stasis/operations/regions.c +++ b/src/stasis/operations/regions.c @@ -105,7 +105,7 @@ int TregionReadBoundaryTag(int xid, pageid_t page, boundary_tag* tag) { pthread_mutex_lock(®ion_mutex); assert(0 == holding_mutex); holding_mutex = pthread_self(); - int ret = readBoundaryTag(xid,page,tag); + int ret = readBoundaryTag(xid,page-1,tag); holding_mutex = 0; pthread_mutex_unlock(®ion_mutex); return ret; @@ -173,16 +173,17 @@ int TregionNextBoundaryTag(int xid, pageid_t* pid, boundary_tag * tag, int type) holding_mutex = pthread_self(); - int ret = readBoundaryTag(xid, *pid, tag); + int ret = readBoundaryTag(xid, *pid-1, tag); if(ret) { while(1) { if(tag->size == UINT32_MAX) { ret = 0; break; } - *pid += tag->size; - ret = readBoundaryTag(xid,*pid, tag); - assert(ret); // detected boundary tag corruption. + *pid += tag->size+1; + int succ = readBoundaryTag(xid,*pid-1, tag); + assert(succ); // detect missing boundary tags + DEBUG("tag status = %d\n",tag->status); if(tag->status == REGION_ZONED && ((!type) || (tag->allocation_manager == type))) { break; }