filehash/ffdb_page.c
static int
_ffdb_update_data_info (ffdb_htab_t* hashp, ffdb_datap_t* datap,
			pgno_t kpage, unsigned int kpgindx)
{
  void* dpagep;
  pgno_t dpage;
  ffdb_data_header_t* data_header;

  /* Get data page given from datap */
  dpagep = ffdb_get_page (hashp, datap->first, HASH_DATA_PAGE, 0, &dpage);
  if (!dpagep) {
    fprintf (stderr, "Cannot retrieve data page at %u\n", datap->first);
    return -1;
  }

  /* Access this data item and update header information */
  data_header = BIG_DATA_HEADER (dpagep, datap->offset);
  data_header->key_page = kpage;
  data_header->key_idx = kpgindx;

  /* Commit change */
  ffdb_put_page (hashp, dpagep, HASH_DATA_PAGE, 1);

  return 0;
}
/* When a page split, the hash items on the page will be split into
 * the old page and a new page. The data items pointed by the hash items
 * have to be updated to reflect data header information about key page
 * and key index inside the key page
 */
When a page split, the hash items on the page will be split into
the old page and a new page. The data items pointed by the hash items
have to be updated to reflect data header information about key page
and key index inside the key page
When a page split the hash items on the page will be split into the old page and a new page . The data items pointed by the hash items have to be updated to reflect data header information about key page and key index inside the key page
static int
_ffdb_update_data_info (ffdb_htab_t* hashp, ffdb_datap_t* datap,
			pgno_t kpage, unsigned int kpgindx)
{
  void* dpagep;
  pgno_t dpage;
  ffdb_data_header_t* data_header;
  dpagep = ffdb_get_page (hashp, datap->first, HASH_DATA_PAGE, 0, &dpage);
  if (!dpagep) {
    fprintf (stderr, "Cannot retrieve data page at %u\n", datap->first);
    return -1;
  }
  data_header = BIG_DATA_HEADER (dpagep, datap->offset);
  data_header->key_page = kpage;
  data_header->key_idx = kpgindx;
  ffdb_put_page (hashp, dpagep, HASH_DATA_PAGE, 1);
  return 0;
}
static int _ffdb_update_data_info ( ffdb_htab_t * hashp , ffdb_datap_t * datap , pgno_t kpage , unsigned int kpgindx ) { void * dpagep ; pgno_t dpage ; ffdb_data_header_t * data_header ; dpagep = ffdb_get_page ( hashp , datap -> first , HASH_DATA_PAGE , 0 , & dpage ) ; if ( ! dpagep ) { fprintf ( stderr , " \n " , datap -> first ) ; return -1 ; } data_header = BIG_DATA_HEADER ( dpagep , datap -> offset ) ; data_header -> key_page = kpage ; data_header -> key_idx = kpgindx ; ffdb_put_page ( hashp , dpagep , HASH_DATA_PAGE , 1 ) ; return 0 ; }
When a page split, the hash items on the page will be split into
 the old page and a new page.
When a page split the hash items on the page will be split into the old page and a new page .
/* Get data page given from datap */ /* Access this data item and update header information */ /* Commit change */