filehash/ffdb_page.c
int ffdb_add_pair (ffdb_htab_t* hashp,
		   FFDB_DBT* key, const FFDB_DBT* val,
		   ffdb_hent_t* item, int replace)
{
  int status;
  if (!replace)
    status = _ffdb_add_item_on_page (hashp, item->pagep, item->pgno,
				     key, val, item->data_chksum);
  else
    status = _ffdb_replace_item_on_page (hashp, key, val, item);

  if (status != 0) 
    /* Now I do not need this page */
    ffdb_put_page (hashp, item->pagep, HASH_BUCKET_PAGE, 0);
  else
    ffdb_put_page (hashp, item->pagep, HASH_BUCKET_PAGE, 1);

  return status;
}
/**
 * Add a pair of key and data into the hash database
 *
 * The page associated with this pair should be cached
 *
 */
Add a pair of key and data into the hash database
The page associated with this pair should be cached
Add a pair of key and data into the hash database The page associated with this pair should be cached
int ffdb_add_pair (ffdb_htab_t* hashp,
		   FFDB_DBT* key, const FFDB_DBT* val,
		   ffdb_hent_t* item, int replace)
{
  int status;
  if (!replace)
    status = _ffdb_add_item_on_page (hashp, item->pagep, item->pgno,
				     key, val, item->data_chksum);
  else
    status = _ffdb_replace_item_on_page (hashp, key, val, item);
  if (status != 0) 
    ffdb_put_page (hashp, item->pagep, HASH_BUCKET_PAGE, 0);
  else
    ffdb_put_page (hashp, item->pagep, HASH_BUCKET_PAGE, 1);
  return status;
}
int ffdb_add_pair ( ffdb_htab_t * hashp , FFDB_DBT * key , const FFDB_DBT * val , ffdb_hent_t * item , int replace ) { int status ; if ( ! replace ) status = _ffdb_add_item_on_page ( hashp , item -> pagep , item -> pgno , key , val , item -> data_chksum ) ; else status = _ffdb_replace_item_on_page ( hashp , key , val , item ) ; if ( status != 0 ) ffdb_put_page ( hashp , item -> pagep , HASH_BUCKET_PAGE , 0 ) ; else ffdb_put_page ( hashp , item -> pagep , HASH_BUCKET_PAGE , 1 ) ; return status ; }
Add a pair of key and data into the hash database
 The page associated with this pair should be cached
Add a pair of key and data into the hash database The page associated with this pair should be cached
/* Now I do not need this page */