From e35d078dde2ac75b09ca0685e3c9aa93c2764c3c Mon Sep 17 00:00:00 2001 From: Rusty Sears Date: Wed, 30 Jan 2013 17:00:11 -0800 Subject: [PATCH] add casts to buffer manager implementations --- src/stasis/bufferManager/bufferHash.c | 50 +++++++++---------- .../bufferManager/concurrentBufferManager.c | 42 ++++++++-------- .../legacy/legacyBufferManager.c | 18 +++---- src/stasis/bufferManager/pageArray.c | 8 +-- 4 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/stasis/bufferManager/bufferHash.c b/src/stasis/bufferManager/bufferHash.c index f3e1e87..bd216a7 100644 --- a/src/stasis/bufferManager/bufferHash.c +++ b/src/stasis/bufferManager/bufferHash.c @@ -48,7 +48,7 @@ typedef struct { } stasis_buffer_hash_t; static inline int needFlush(stasis_buffer_manager_t * bm) { - stasis_buffer_hash_t *bh = bm->impl; + stasis_buffer_hash_t *bh = (stasis_buffer_hash_t *)bm->impl; pageid_t count = stasis_dirty_page_table_dirty_count(bh->dpt); const pageid_t needed = 1000; //MAX_BUFFER_SIZE / 5; if(count > needed) { @@ -92,9 +92,9 @@ inline static void checkPageState(Page * p) { } #endif static int bhTryToWriteBackPage(stasis_buffer_manager_t *bm, pageid_t page) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; pthread_mutex_lock(&bh->mut); - Page * p = LH_ENTRY(find)(bh->cachedPages, &page, sizeof(page)); + Page * p = (Page*)LH_ENTRY(find)(bh->cachedPages, &page, sizeof(page)); if(!p) { pthread_mutex_unlock(&bh->mut); @@ -117,7 +117,7 @@ static int bhTryToWriteBackPage(stasis_buffer_manager_t *bm, pageid_t page) { /** Returns a free page. The page will not be in freeList, cachedPages or lru. */ inline static Page * getFreePage(stasis_buffer_manager_t *bm) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; Page * ret; if(bh->pageCount < stasis_buffer_manager_size) { ret = stasis_buffer_pool_malloc_page(bh->buffer_pool); @@ -144,7 +144,7 @@ inline static Page * getFreePage(stasis_buffer_manager_t *bm) { } bh->lru->remove(bh->lru, ret); - Page * check = LH_ENTRY(remove)(bh->cachedPages, &ret->id, sizeof(ret->id)); + Page * check = (Page*)LH_ENTRY(remove)(bh->cachedPages, &ret->id, sizeof(ret->id)); assert(check == ret); } assert(!ret->pending); @@ -155,8 +155,8 @@ inline static Page * getFreePage(stasis_buffer_manager_t *bm) { } static void * writeBackWorker(void * bmp) { - stasis_buffer_manager_t* bm = bmp; - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_manager_t* bm = (stasis_buffer_manager_t*)bmp; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; pthread_mutex_lock(&bh->mut); while(1) { while(bh->running && (!needFlush(bm))) { @@ -178,10 +178,10 @@ static void * writeBackWorker(void * bmp) { } static Page * bhGetCachedPage(stasis_buffer_manager_t* bm, int xid, const pageid_t pageid) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; pthread_mutex_lock(&bh->mut); // Is the page in cache? - Page * ret = LH_ENTRY(find)(bh->cachedPages, &pageid, sizeof(pageid)); + Page * ret = (Page*)LH_ENTRY(find)(bh->cachedPages, &pageid, sizeof(pageid)); if(ret) { checkPageState(ret); #ifdef LATCH_SANITY_CHECKING @@ -203,7 +203,7 @@ static Page * bhGetCachedPage(stasis_buffer_manager_t* bm, int xid, const pageid static Page * bhLoadPageImpl_helper(stasis_buffer_manager_t* bm, stasis_buffer_manager_handle_t* handle, int xid, const pageid_t pageid, int uninitialized, pagetype_t type) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; DEBUG("loadPage(%lld) (uninitialized = %d)\n", pageid, uninitialized); @@ -216,7 +216,7 @@ static Page * bhLoadPageImpl_helper(stasis_buffer_manager_t* bm, stasis_buffer_m pthread_mutex_lock(&bh->mut); // Is the page in cache? - Page * ret = LH_ENTRY(find)(bh->cachedPages, &pageid,sizeof(pageid)); + Page * ret = (Page*)LH_ENTRY(find)(bh->cachedPages, &pageid,sizeof(pageid)); do { @@ -227,7 +227,7 @@ static Page * bhLoadPageImpl_helper(stasis_buffer_manager_t* bm, stasis_buffer_m if(ret->pending) { pthread_cond_wait(&bh->readComplete, &bh->mut); if(ret->id != pageid) { - ret = LH_ENTRY(find)(bh->cachedPages, &pageid, sizeof(pageid)); + ret = (Page*)LH_ENTRY(find)(bh->cachedPages, &pageid, sizeof(pageid)); } } else { #ifdef LATCH_SANITY_CHECKING @@ -250,7 +250,7 @@ static Page * bhLoadPageImpl_helper(stasis_buffer_manager_t* bm, stasis_buffer_m Page * ret2 = getFreePage(bm); // Did some other thread put the page in cache for us? - ret = LH_ENTRY(find)(bh->cachedPages, &pageid,sizeof(pageid)); + ret = (Page*)LH_ENTRY(find)(bh->cachedPages, &pageid,sizeof(pageid)); if(!ret) { @@ -327,7 +327,7 @@ static Page * bhLoadUninitPageImpl(stasis_buffer_manager_t *bm, int xid, const p } static void* prefetch_worker(void * arg) { - stasis_buffer_hash_t * bh = arg; //bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)arg; //bm->impl; pthread_mutex_lock(&bh->prefetch_mut); int done = 0; while(1) { @@ -352,7 +352,7 @@ static void* prefetch_worker(void * arg) { } void bhPrefetchPagesImpl(stasis_buffer_manager_t *bm, pageid_t pageid, pageid_t count) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; if(bh->prefetch_thread_count > 0) { pthread_mutex_lock(&bh->prefetch_mut); while(bh->prefetch_next_count != 0) { @@ -371,14 +371,14 @@ void bhPrefetchPagesImpl(stasis_buffer_manager_t *bm, pageid_t pageid, pageid_t } static int bhPreallocatePages(stasis_buffer_manager_t * bm, pageid_t start, pageid_t count) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; return bh->page_handle->preallocate_range(bh->page_handle, start, count); } static void bhReleasePage(stasis_buffer_manager_t * bm, Page * p) { DEBUG("releasePage(%lld) (rwlatch = %llx)\n", p->id, (long long)p->rwlatch); - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; pthread_mutex_lock(&bh->mut); checkPageState(p); bh->lru->insert(bh->lru,p); @@ -400,20 +400,20 @@ static int bhWriteBackPage(stasis_buffer_manager_t* bm, pageid_t pageid) { return ret; } static void bhForcePages(stasis_buffer_manager_t* bm, stasis_buffer_manager_handle_t *h) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; bh->page_handle->force_file(bh->page_handle); } static void bhAsyncForcePages(stasis_buffer_manager_t* bm, stasis_buffer_manager_handle_t *h) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; bh->page_handle->async_force_file(bh->page_handle); } static void bhForcePageRange(stasis_buffer_manager_t *bm, stasis_buffer_manager_handle_t *h, pageid_t start, pageid_t stop) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; bh->page_handle->force_range(bh->page_handle, start, stop); } static void bhBufDeinit(stasis_buffer_manager_t * bm) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; pthread_mutex_lock(&bh->mut); bh->running = 0; pthread_mutex_unlock(&bh->mut); @@ -435,7 +435,7 @@ static void bhBufDeinit(stasis_buffer_manager_t * bm) { const struct LH_ENTRY(pair_t) * next; LH_ENTRY(openlist)(bh->cachedPages, &iter); while((next = LH_ENTRY(readlist)(&iter))) { - Page * p = next->value; + Page * p = (Page*)next->value; assertunlocked(p->rwlatch); assert(0 == p->pinCount); readlock(p->rwlatch,0); @@ -459,7 +459,7 @@ static void bhBufDeinit(stasis_buffer_manager_t * bm) { free(bh); } static void bhSimulateBufferManagerCrash(stasis_buffer_manager_t *bm) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; pthread_mutex_lock(&bh->mut); bh->running = 0; pthread_mutex_unlock(&bh->mut); @@ -477,7 +477,7 @@ static void bhSimulateBufferManagerCrash(stasis_buffer_manager_t *bm) { const struct LH_ENTRY(pair_t) * next; LH_ENTRY(openlist)(bh->cachedPages, &iter); while((next = LH_ENTRY(readlist)(&iter))) { - Page * p = next->value; + Page * p = (Page*)next->value; writelock(p->rwlatch,0); stasis_page_flushed(p); // normally, pageWrite() would call this... stasis_page_cleanup(p); // normally called by writeBackOnePage() @@ -497,7 +497,7 @@ static void bhSimulateBufferManagerCrash(stasis_buffer_manager_t *bm) { } static stasis_buffer_manager_handle_t * bhOpenHandleImpl(stasis_buffer_manager_t *bm, int is_sequential) { - stasis_buffer_hash_t * bh = bm->impl; + stasis_buffer_hash_t * bh = (stasis_buffer_hash_t *)bm->impl; return (stasis_buffer_manager_handle_t*)bh->page_handle->dup(bh->page_handle, is_sequential); } static int bhCloseHandleImpl(stasis_buffer_manager_t *bm, stasis_buffer_manager_handle_t* h) { diff --git a/src/stasis/bufferManager/concurrentBufferManager.c b/src/stasis/bufferManager/concurrentBufferManager.c index a8b3e8a..d0dc39d 100644 --- a/src/stasis/bufferManager/concurrentBufferManager.c +++ b/src/stasis/bufferManager/concurrentBufferManager.c @@ -33,7 +33,7 @@ typedef struct { } stasis_buffer_concurrent_hash_t; static inline int needFlush(stasis_buffer_manager_t * bm) { - stasis_buffer_concurrent_hash_t *bh = bm->impl; + stasis_buffer_concurrent_hash_t *bh = (stasis_buffer_concurrent_hash_t *)bm->impl; pageid_t count = stasis_dirty_page_table_dirty_count(bh->dpt); pageid_t needed = stasis_dirty_page_count_soft_limit; if(count > needed) { @@ -47,8 +47,8 @@ static inline int needFlush(stasis_buffer_manager_t * bm) { } static int chWriteBackPage_helper(stasis_buffer_manager_t* bm, pageid_t pageid, int is_hint) { - stasis_buffer_concurrent_hash_t *ch = bm->impl; - Page * p = hashtable_lookup(ch->ht, pageid/*, &h*/); + stasis_buffer_concurrent_hash_t *ch = (stasis_buffer_concurrent_hash_t *)bm->impl; + Page * p = (Page*)hashtable_lookup(ch->ht, pageid/*, &h*/); int ret = 0; if(!p) { ret = ENOENT; @@ -121,8 +121,8 @@ static int chTryToWriteBackPage(stasis_buffer_manager_t* bm, pageid_t pageid) { return chWriteBackPage_helper(bm,pageid,1); // just a hint. Return EBUSY on contention. } static void * writeBackWorker(void * bmp) { - stasis_buffer_manager_t* bm = bmp; - stasis_buffer_concurrent_hash_t * ch = bm->impl; + stasis_buffer_manager_t* bm = (stasis_buffer_manager_t *)bmp; + stasis_buffer_concurrent_hash_t * ch = (stasis_buffer_concurrent_hash_t *)bm->impl; pthread_mutex_t mut; pthread_mutex_init(&mut,0); while(1) { @@ -145,9 +145,9 @@ static void * writeBackWorker(void * bmp) { } static Page * chGetCachedPage(stasis_buffer_manager_t* bm, int xid, const pageid_t pageid) { - stasis_buffer_concurrent_hash_t * ch = bm->impl; + stasis_buffer_concurrent_hash_t * ch = (stasis_buffer_concurrent_hash_t *)bm->impl; hashtable_bucket_handle_t h; - Page * p = hashtable_lookup_lock(ch->ht, pageid, &h); + Page * p = (Page*)hashtable_lookup_lock(ch->ht, pageid, &h); if(p) { int succ = tryreadlock(p->loadlatch, 0); if(!succ) { @@ -162,8 +162,8 @@ static Page * chGetCachedPage(stasis_buffer_manager_t* bm, int xid, const pageid return p; } static void deinitTLS(void *tlsp) { - stasis_buffer_concurrent_hash_tls_t * tls = tlsp; - stasis_buffer_concurrent_hash_t *ch = tls->bm->impl; + stasis_buffer_concurrent_hash_tls_t * tls = (stasis_buffer_concurrent_hash_tls_t *)tlsp; + stasis_buffer_concurrent_hash_t *ch = (stasis_buffer_concurrent_hash_t *)tls->bm->impl; Page * p = tls->p; p->id = -2; @@ -174,8 +174,8 @@ static void deinitTLS(void *tlsp) { free(tls); } static inline stasis_buffer_concurrent_hash_tls_t * populateTLS(stasis_buffer_manager_t* bm) { - stasis_buffer_concurrent_hash_t *ch = bm->impl; - stasis_buffer_concurrent_hash_tls_t *tls = pthread_getspecific(ch->key); + stasis_buffer_concurrent_hash_t *ch = (stasis_buffer_concurrent_hash_t *)bm->impl; + stasis_buffer_concurrent_hash_tls_t *tls = (stasis_buffer_concurrent_hash_tls_t *)pthread_getspecific(ch->key); if(tls == NULL) { tls = stasis_alloc(stasis_buffer_concurrent_hash_tls_t); tls->p = NULL; @@ -209,7 +209,7 @@ static inline stasis_buffer_concurrent_hash_tls_t * populateTLS(stasis_buffer_ma } } hashtable_bucket_handle_t h; - tls->p = hashtable_remove_begin(ch->ht, tmp->id, &h); + tls->p = (Page*)hashtable_remove_begin(ch->ht, tmp->id, &h); if(tls->p) { // It used to be the case that we could get in trouble because page->id could change concurrently with us. However, this is no longer a problem, // since getStaleAndRemove is atomic, and the only code that changes page->id does so with pages that are in TLS (and therefore went through getStaleAndRemove) @@ -283,7 +283,7 @@ static void chReleasePage(stasis_buffer_manager_t * bm, Page * p); static Page * chLoadPageImpl_helper(stasis_buffer_manager_t* bm, int xid, stasis_page_handle_t *ph, const pageid_t pageid, int uninitialized, pagetype_t type) { if(uninitialized) assert(!bm->in_redo); - stasis_buffer_concurrent_hash_t *ch = bm->impl; + stasis_buffer_concurrent_hash_t *ch = (stasis_buffer_concurrent_hash_t *)bm->impl; stasis_buffer_concurrent_hash_tls_t *tls = populateTLS(bm); hashtable_bucket_handle_t h; Page * p = 0; @@ -296,7 +296,7 @@ static Page * chLoadPageImpl_helper(stasis_buffer_manager_t* bm, int xid, stasis // ch->lru->insert(ch->lru, p); // unlock(p->loadlatch); } - while(NULL == (p = hashtable_test_and_set_lock(ch->ht, pageid, tls->p, &h))) { + while(NULL == (p = (Page*)hashtable_test_and_set_lock(ch->ht, pageid, tls->p, &h))) { // The page was not in the hash. Now it is up to us. p = tls->p; @@ -349,7 +349,7 @@ static Page * chLoadUninitPageImpl(stasis_buffer_manager_t *bm, int xid, const p return chLoadPageImpl_helper(bm, xid, 0, pageid,1,UNKNOWN_TYPE_PAGE); // 1 means dont care about preimage of page. } static void chReleasePage(stasis_buffer_manager_t * bm, Page * p) { - stasis_buffer_concurrent_hash_t * ch = bm->impl; + stasis_buffer_concurrent_hash_t * ch = (stasis_buffer_concurrent_hash_t *)bm->impl; ch->lru->insert(ch->lru, p); int doFlush = p->needsFlush; pageid_t pid = p->id; @@ -360,23 +360,23 @@ static void chReleasePage(stasis_buffer_manager_t * bm, Page * p) { } } static void chForcePages(stasis_buffer_manager_t* bm, stasis_buffer_manager_handle_t *h) { - stasis_buffer_concurrent_hash_t * ch = bm->impl; + stasis_buffer_concurrent_hash_t * ch = (stasis_buffer_concurrent_hash_t *)bm->impl; ch->page_handle->force_file(ch->page_handle); } static void chAsyncForcePages(stasis_buffer_manager_t* bm, stasis_buffer_manager_handle_t *h) { - stasis_buffer_concurrent_hash_t * ch = bm->impl; + stasis_buffer_concurrent_hash_t * ch = (stasis_buffer_concurrent_hash_t *)bm->impl; ch->page_handle->async_force_file(ch->page_handle); } static void chForcePageRange(stasis_buffer_manager_t *bm, stasis_buffer_manager_handle_t *h, pageid_t start, pageid_t stop) { - stasis_buffer_concurrent_hash_t * ch = bm->impl; + stasis_buffer_concurrent_hash_t * ch = (stasis_buffer_concurrent_hash_t *)bm->impl; ch->page_handle->force_range(ch->page_handle, start, stop); } static int chPreallocatePages(stasis_buffer_manager_t * bm, pageid_t start, pageid_t count) { - stasis_buffer_concurrent_hash_t * ch = bm->impl; + stasis_buffer_concurrent_hash_t * ch = (stasis_buffer_concurrent_hash_t *)bm->impl; return ch->page_handle->preallocate_range(ch->page_handle, start, count); } static void chBufDeinitHelper(stasis_buffer_manager_t * bm, int crash) { - stasis_buffer_concurrent_hash_t *ch = bm->impl; + stasis_buffer_concurrent_hash_t *ch = (stasis_buffer_concurrent_hash_t *)bm->impl; ch->running = 0; pthread_key_delete(ch->key); pthread_cond_signal(&ch->needFree); @@ -400,7 +400,7 @@ static void chBufDeinit(stasis_buffer_manager_t * bm) { chBufDeinitHelper(bm, 0); } static stasis_buffer_manager_handle_t * chOpenHandle(stasis_buffer_manager_t *bm, int is_sequential) { - stasis_buffer_concurrent_hash_t * bh = bm->impl; + stasis_buffer_concurrent_hash_t * bh = (stasis_buffer_concurrent_hash_t *)bm->impl; return (stasis_buffer_manager_handle_t*)bh->page_handle->dup(bh->page_handle, is_sequential); } static int chCloseHandle(stasis_buffer_manager_t *bm, stasis_buffer_manager_handle_t* h) { diff --git a/src/stasis/bufferManager/legacy/legacyBufferManager.c b/src/stasis/bufferManager/legacy/legacyBufferManager.c index 6fa79d7..55fbb20 100644 --- a/src/stasis/bufferManager/legacy/legacyBufferManager.c +++ b/src/stasis/bufferManager/legacy/legacyBufferManager.c @@ -19,12 +19,12 @@ static pthread_key_t lastPage; #define RO 0 #define RW 1 -static void bufManBufDeinit(); +static void bufManBufDeinit(stasis_buffer_manager_t*); static Page *bufManLoadPage(stasis_buffer_manager_t *ignored, stasis_buffer_manager_handle_t* h, int xid, pageid_t pageid, pagetype_t type); static Page *bufManGetCachedPage(stasis_buffer_manager_t *ignored, int xid, pageid_t pageid); static Page *bufManLoadUninitPage(stasis_buffer_manager_t *ignored, int xid, pageid_t pageid); static void bufManReleasePage (stasis_buffer_manager_t *ignored, Page * p); -static void bufManSimulateBufferManagerCrash(); +static void bufManSimulateBufferManagerCrash(stasis_buffer_manager_t*); static stasis_page_handle_t * page_handle; @@ -46,7 +46,7 @@ static void forceRangePageFile_legacyWrapper(stasis_buffer_manager_t *ignored, s static stasis_buffer_manager_handle_t * bufManOpenHandle(stasis_buffer_manager_t *bm, int is_sequential) { // no-op - return (void*)1; + return (stasis_buffer_manager_handle_t*)1; } static int bufManCloseHandle(stasis_buffer_manager_t *bm, stasis_buffer_manager_handle_t* h) { return 0; // no error. @@ -96,7 +96,7 @@ stasis_buffer_manager_t* stasis_buffer_manager_deprecated_open(stasis_page_handl return bm; } -static void bufManBufDeinit(void) { +static void bufManBufDeinit(stasis_buffer_manager_t* ignored) { DEBUG("pageCacheDeinit()"); @@ -130,7 +130,7 @@ static void bufManBufDeinit(void) { Just close file descriptors, don't do any other clean up. (For testing.) */ -static void bufManSimulateBufferManagerCrash(void) { +static void bufManSimulateBufferManagerCrash(stasis_buffer_manager_t * ignored) { page_handle->close(page_handle); #ifdef PIN_COUNT pinCount = 0; @@ -152,7 +152,7 @@ static Page* bufManGetPage(int xid, pageid_t pageid, int locktype, int uninitial int spin = 0; pthread_mutex_lock(&loadPagePtr_mutex); - ret = LH_ENTRY(find)(activePages, &pageid, sizeof(pageid)); + ret = (Page*)LH_ENTRY(find)(activePages, &pageid, sizeof(pageid)); if(ret) { #ifdef PROFILE_LATCHES_WRITE_ONLY @@ -186,7 +186,7 @@ static Page* bufManGetPage(int xid, pageid_t pageid, int locktype, int uninitial pthread_mutex_unlock(&loadPagePtr_mutex); sched_yield(); pthread_mutex_lock(&loadPagePtr_mutex); - ret = LH_ENTRY(find)(activePages, &pageid, sizeof(pageid)); + ret = (Page*)LH_ENTRY(find)(activePages, &pageid, sizeof(pageid)); if(ret) { #ifdef PROFILE_LATCHES_WRITE_ONLY @@ -350,7 +350,7 @@ static Page* bufManGetPage(int xid, pageid_t pageid, int locktype, int uninitial static Page *bufManLoadPage(stasis_buffer_manager_t *ignored, stasis_buffer_manager_handle_t * hignored, int xid, const pageid_t pageid, pagetype_t type) { - Page * ret = pthread_getspecific(lastPage); + Page * ret = (Page*)pthread_getspecific(lastPage); if(ret && ret->id == pageid) { pthread_mutex_lock(&loadPagePtr_mutex); @@ -386,7 +386,7 @@ static Page* bufManGetCachedPage(stasis_buffer_manager_t *ignored, int xid, cons static Page *bufManLoadUninitPage(stasis_buffer_manager_t *ignored, int xid, pageid_t pageid) { - Page * ret = pthread_getspecific(lastPage); + Page * ret = (Page*)pthread_getspecific(lastPage); if(ret && ret->id == pageid) { pthread_mutex_lock(&loadPagePtr_mutex); diff --git a/src/stasis/bufferManager/pageArray.c b/src/stasis/bufferManager/pageArray.c index 8b00637..7e0a4e1 100644 --- a/src/stasis/bufferManager/pageArray.c +++ b/src/stasis/bufferManager/pageArray.c @@ -12,7 +12,7 @@ typedef struct { } stasis_buffer_manager_page_array_t; static Page * paLoadPage(stasis_buffer_manager_t *bm, stasis_buffer_manager_handle_t * h, int xid, pageid_t pageid, pagetype_t type) { - stasis_buffer_manager_page_array_t *pa = bm->impl; + stasis_buffer_manager_page_array_t *pa = (stasis_buffer_manager_page_array_t *)bm->impl; pthread_mutex_lock(&pa->mut); if(pageid >= pa->pageCount) { pa->pageMap = stasis_realloc(pa->pageMap, 1+pageid, Page*); @@ -49,7 +49,7 @@ static Page* paGetCachedPage(stasis_buffer_manager_t *bm, int xid, pageid_t page } static void paReleasePage(stasis_buffer_manager_t *bm, Page * p) { writelock(p->rwlatch,0); - stasis_dirty_page_table_set_clean(stasis_runtime_dirty_page_table(), p); + stasis_dirty_page_table_set_clean((stasis_dirty_page_table_t*)stasis_runtime_dirty_page_table(), p); unlock(p->rwlatch); } @@ -59,7 +59,7 @@ static void paAsyncForcePages(stasis_buffer_manager_t * bm, stasis_buffer_manage static void paForcePageRange(stasis_buffer_manager_t *bm, stasis_buffer_manager_handle_t *h, pageid_t start, pageid_t stop) { /* no-op */ } static void paBufDeinit(stasis_buffer_manager_t * bm) { - stasis_buffer_manager_page_array_t *pa = bm->impl; + stasis_buffer_manager_page_array_t *pa = (stasis_buffer_manager_page_array_t *)bm->impl; for(pageid_t i =0; i < pa->pageCount; i++) { if(pa->pageMap[i]) { @@ -74,7 +74,7 @@ static void paBufDeinit(stasis_buffer_manager_t * bm) { static stasis_buffer_manager_handle_t * paOpenHandle(stasis_buffer_manager_t *bm, int is_sequential) { // no-op - return (void*)1; + return (stasis_buffer_manager_handle_t*)1; } static int paCloseHandle(stasis_buffer_manager_t *bm, stasis_buffer_manager_handle_t* h) { return 0; // no error.