src/directory.cc
/*
 * intermediate state
 * in transition from dirty(ownership transfer) to dirty
 * WRITE Case 4 (dirty to dirty)
 * NOTE: shared/unshared to dirty (WRITE Case 3) doesn't need this state
 * as we cannot update to_dirty to dirty in this cases.
 * we use cache check to avoid races
 */
intermediate state
in transition from dirty(ownership transfer) to dirty
WRITE Case 4 (dirty to dirty)
NOTE: shared/unshared to dirty (WRITE Case 3) doesn't need this state
as we cannot update to_dirty to dirty in this cases.
we use cache check to avoid races
intermediate state in transition from dirty ( ownership transfer ) to dirty WRITE Case 4 ( dirty to dirty ) NOTE : shared / unshared to dirty ( WRITE Case 3 ) doesn ' t need this state as we cannot update to_dirty to dirty in this cases . we use cache check to avoid races
DirEntry* Directory::ToToDirty(void* ptr, GAddr addr) {
  epicAssert((ptr_t)ptr == TOBLOCK(ptr));
  ptr_t block = TOBLOCK(ptr);
  DirEntry* entry = GetEntry(block);
  if (!entry) {  
    entry = new DirEntry();
    entry->state = DIR_TO_DIRTY;
    entry->addr = block;
    dir[block] = entry;
  } else {
    ToToDirty(entry);
  }
  return entry;
}
DirEntry * Directory :: ToToDirty ( void * ptr , GAddr addr ) { epicAssert ( ( ptr_t ) ptr == TOBLOCK ( ptr ) ) ; ptr_t block = TOBLOCK ( ptr ) ; DirEntry * entry = GetEntry ( block ) ; if ( ! entry ) { entry = new DirEntry ( ) ; entry -> state = DIR_TO_DIRTY ; entry -> addr = block ; dir [ block ] = entry ; } else { ToToDirty ( entry ) ; } return entry ; }
intermediate state
 in transition from dirty(ownership transfer) to dirty
 WRITE Case 4 (dirty to dirty)
 NOTE: shared/unshared to dirty (WRITE Case 3) doesn't need this state
 as we cannot update to_dirty to dirty in this cases.
intermediate state in transition from dirty ( ownership transfer ) to dirty WRITE Case 4 ( dirty to dirty ) NOTE : shared / unshared to dirty ( WRITE Case 3 ) doesn ' t need this state as we cannot update to_dirty to dirty in this cases .
//unshared to dirty