filehash/ffdb_page.c
void
ffdb_disp_all_page_info (ffdb_htab_t* hashp)
{
  unsigned int k;
  void *pagep;
  pgno_t page, tp;
  unsigned int numpages = hashp->mp->npages;

  fprintf (stderr, "There are total of %d pages \n", numpages);

  /**
   * Dump header page first
   */
  (void)fprintf(stderr,
		"%s\n%s%p\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%x\n%s%x\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n",
		"init_htab:",
		"TABLE POINTER   ", (void *)hashp,
		"BUCKET SIZE     ", hashp->hdr.bsize,
		"BUCKET SHIFT    ", hashp->hdr.bshift,
		"FILL FACTOR     ", hashp->hdr.ffactor,
		"MAX BUCKET      ", hashp->hdr.max_bucket,
		"OVFL POINT      ", hashp->hdr.ovfl_point,
		"HIGH MASK       ", hashp->hdr.high_mask,
		"LOW  MASK       ", hashp->hdr.low_mask,
		"NKEYS           ", hashp->hdr.nkeys,
		"Num moved pages ", hashp->hdr.num_moved_pages,
		"Header Pages    ", hashp->hdr.hdrpages,
		"Uinfo start page ", hashp->hdr.uinfo_page,
		"Uinfo Num pages ",  hashp->hdr.uinfo_npages,
		"Config start at ",  hashp->hdr.cfig_page,
		"Config Num pages ", hashp->hdr.cfig_npages,
		"Number of configs ", hashp->hdr.num_cfigs,
		"Data Page Start ", hashp->curr_dpage);
  {
    unsigned int i;
    for (i = 0; i < NCACHED; i++)
      fprintf(stderr,
		    "spares[%d] = %d\n", i, hashp->hdr.spares[i]);

    for (i = 0; i < NCACHED; i++)
      fprintf(stderr,
		    "freepages[%d] = %d\n", i, hashp->hdr.free_pages[i]);
  } 

  for (k = 1; k < numpages; k++) {
    page = k;
    pagep = ffdb_get_page (hashp, page,
			   HASH_RAW_PAGE, 0, &tp);
    if (pagep) {
      fprintf (stderr, "Page Information: PGNO %d PREV PGNO %d NEXT PGNO %d PAGE SIGN 0x%x ",
	       CURR_PGNO(pagep), PREV_PGNO(pagep),NEXT_PGNO(pagep), PAGE_SIGN(pagep));
      fprintf (stderr, "Page TYPE 0x%x OFFSET %d\n", TYPE(pagep), OFFSET(pagep));   
      ffdb_put_page (hashp, pagep, TYPE(pagep), 0);
    }
    else
      fprintf (stderr, "cannot get page %d\n", page);
  }
}
/**
 * Dump out all page information for debug purpose
 */
Dump out all page information for debug purpose
Dump out all page information for debug purpose
void
ffdb_disp_all_page_info (ffdb_htab_t* hashp)
{
  unsigned int k;
  void *pagep;
  pgno_t page, tp;
  unsigned int numpages = hashp->mp->npages;
  fprintf (stderr, "There are total of %d pages \n", numpages);
  (void)fprintf(stderr,
		"%s\n%s%p\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%x\n%s%x\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n",
		"init_htab:",
		"TABLE POINTER   ", (void *)hashp,
		"BUCKET SIZE     ", hashp->hdr.bsize,
		"BUCKET SHIFT    ", hashp->hdr.bshift,
		"FILL FACTOR     ", hashp->hdr.ffactor,
		"MAX BUCKET      ", hashp->hdr.max_bucket,
		"OVFL POINT      ", hashp->hdr.ovfl_point,
		"HIGH MASK       ", hashp->hdr.high_mask,
		"LOW  MASK       ", hashp->hdr.low_mask,
		"NKEYS           ", hashp->hdr.nkeys,
		"Num moved pages ", hashp->hdr.num_moved_pages,
		"Header Pages    ", hashp->hdr.hdrpages,
		"Uinfo start page ", hashp->hdr.uinfo_page,
		"Uinfo Num pages ",  hashp->hdr.uinfo_npages,
		"Config start at ",  hashp->hdr.cfig_page,
		"Config Num pages ", hashp->hdr.cfig_npages,
		"Number of configs ", hashp->hdr.num_cfigs,
		"Data Page Start ", hashp->curr_dpage);
  {
    unsigned int i;
    for (i = 0; i < NCACHED; i++)
      fprintf(stderr,
		    "spares[%d] = %d\n", i, hashp->hdr.spares[i]);
    for (i = 0; i < NCACHED; i++)
      fprintf(stderr,
		    "freepages[%d] = %d\n", i, hashp->hdr.free_pages[i]);
  } 
  for (k = 1; k < numpages; k++) {
    page = k;
    pagep = ffdb_get_page (hashp, page,
			   HASH_RAW_PAGE, 0, &tp);
    if (pagep) {
      fprintf (stderr, "Page Information: PGNO %d PREV PGNO %d NEXT PGNO %d PAGE SIGN 0x%x ",
	       CURR_PGNO(pagep), PREV_PGNO(pagep),NEXT_PGNO(pagep), PAGE_SIGN(pagep));
      fprintf (stderr, "Page TYPE 0x%x OFFSET %d\n", TYPE(pagep), OFFSET(pagep));   
      ffdb_put_page (hashp, pagep, TYPE(pagep), 0);
    }
    else
      fprintf (stderr, "cannot get page %d\n", page);
  }
}
void ffdb_disp_all_page_info ( ffdb_htab_t * hashp ) { unsigned int k ; void * pagep ; pgno_t page , tp ; unsigned int numpages = hashp -> mp -> npages ; fprintf ( stderr , " \n " , numpages ) ; ( void ) fprintf ( stderr , " \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n " , " " , " " , ( void * ) hashp , " " , hashp -> hdr . bsize , " " , hashp -> hdr . bshift , " " , hashp -> hdr . ffactor , " " , hashp -> hdr . max_bucket , " " , hashp -> hdr . ovfl_point , " " , hashp -> hdr . high_mask , " " , hashp -> hdr . low_mask , " " , hashp -> hdr . nkeys , " " , hashp -> hdr . num_moved_pages , " " , hashp -> hdr . hdrpages , " " , hashp -> hdr . uinfo_page , " " , hashp -> hdr . uinfo_npages , " " , hashp -> hdr . cfig_page , " " , hashp -> hdr . cfig_npages , " " , hashp -> hdr . num_cfigs , " " , hashp -> curr_dpage ) ; { unsigned int i ; for ( i = 0 ; i < NCACHED ; i ++ ) fprintf ( stderr , " \n " , i , hashp -> hdr . spares [ i ] ) ; for ( i = 0 ; i < NCACHED ; i ++ ) fprintf ( stderr , " \n " , i , hashp -> hdr . free_pages [ i ] ) ; } for ( k = 1 ; k < numpages ; k ++ ) { page = k ; pagep = ffdb_get_page ( hashp , page , HASH_RAW_PAGE , 0 , & tp ) ; if ( pagep ) { fprintf ( stderr , " " , CURR_PGNO ( pagep ) , PREV_PGNO ( pagep ) , NEXT_PGNO ( pagep ) , PAGE_SIGN ( pagep ) ) ; fprintf ( stderr , " \n " , TYPE ( pagep ) , OFFSET ( pagep ) ) ; ffdb_put_page ( hashp , pagep , TYPE ( pagep ) , 0 ) ; } else fprintf ( stderr , " \n " , page ) ; } }
Dump out all page information for debug purpose
Dump out all page information for debug purpose
/**
   * Dump header page first
   */