Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "../include/db.h"
#include "hash.h"
#include "page.h"
#include "extern.h"
Go to the source code of this file.
Macros | |
#define | BYTE_MASK ((1 << INT_BYTE_SHIFT) -1) |
#define | OVMSG "HASH: Out of overflow pages. Increase page size\n" |
#define | PAGE_INIT(P) |
Functions | |
BUFHEAD * | __add_ovflpage (HTAB *hashp, BUFHEAD *bufp) |
int | __addel (HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) |
int | __delpair (HTAB *hashp, BUFHEAD *bufp, int ndx) |
void | __free_ovflpage (HTAB *hashp, BUFHEAD *obufp) |
int | __get_page (HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_disk, int is_bitmap) |
int | __ibitmap (HTAB *hashp, int pnum, int nbits, int ndx) |
static void putpair | __P ((char *, const DBT *, const DBT *)) |
static int open_temp | __P ((HTAB *)) |
static u_int32_t *fetch_bitmap | __P ((HTAB *, int)) |
static int ugly_split | __P ((HTAB *, u_int32_t, BUFHEAD *, BUFHEAD *, int, int)) |
static void squeeze_key | __P ((u_int16_t *, const DBT *, const DBT *)) |
static u_int32_t first_free | __P ((u_int32_t)) |
int | __put_page (HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_bitmap) |
int | __split_page (HTAB *hashp, u_int32_t obucket, u_int32_t nbucket) |
static u_int32_t * | fetch_bitmap (HTAB *hashp, int ndx) |
static u_int32_t | first_free (u_int32_t map) |
static int | open_temp (HTAB *hashp) |
static u_int16_t | overflow_page (HTAB *hashp) |
static void | putpair (char *p, const DBT *key, const DBT *val) |
static void | squeeze_key (u_int16_t *sp, const DBT *key, const DBT *val) |
static int | ugly_split (HTAB *hashp, u_int32_t obucket, BUFHEAD *old_bufp, BUFHEAD *new_bufp, int copyto, int moved) |
#define BYTE_MASK ((1 << INT_BYTE_SHIFT) -1) |
Definition at line 621 of file hash_page.c.
#define OVMSG "HASH: Out of overflow pages. Increase page size\n" |
#define PAGE_INIT | ( | P | ) |
Definition at line 84 of file hash_page.c.
Definition at line 465 of file hash_page.c.
References __get_buf(), _bufhead::addr, BUF_MOD, DEF_FFACTOR, _bufhead::flags, FREESPACE, if(), MIN_FFACTOR, NULL, OFFSET, overflow_page(), _bufhead::ovfl, OVFLPAGE, OVFLSIZE, and _bufhead::page.
Referenced by __addel(), __big_insert(), __big_split(), and ugly_split().
Definition at line 398 of file hash_page.c.
References __add_ovflpage(), __big_insert(), __expand_table(), __get_buf(), BUF_MOD, _bufhead::flags, FREESPACE, FULL_KEY_DATA, if(), OVFLPAGE, _bufhead::page, PAIRFITS, PAIRSIZE, putpair(), REAL_KEY, squeeze_key(), and while().
Referenced by hash_access().
Definition at line 128 of file hash_page.c.
References __big_delete(), BUF_MOD, _bufhead::flags, if(), OFFSET, OVFLPAGE, _bufhead::page, and REAL_KEY.
Referenced by hash_access().
Definition at line 815 of file hash_page.c.
References __reclaim_buf(), _bufhead::addr, BYTE_SHIFT, CLRBIT, fetch_bitmap(), LAST_FREED, htab::mapp, SPLITMASK, and SPLITSHIFT.
Referenced by __big_delete(), and ugly_split().
int __get_page | ( | HTAB * | hashp, |
char * | p, | ||
u_int32_t | bucket, | ||
int | is_bucket, | ||
int | is_disk, | ||
int | is_bitmap | ||
) |
Definition at line 518 of file hash_page.c.
References BUCKET_TO_PAGE, BYTE_ORDER, EFTYPE, errno, htab::fp, max, OADDR_TO_PAGE, and PAGE_INIT.
Referenced by __get_buf(), and fetch_bitmap().
int __ibitmap | ( | HTAB * | hashp, |
int | pnum, | ||
int | nbits, | ||
int | ndx | ||
) |
Definition at line 627 of file hash_page.c.
References ALL_SET, BYTE_MASK, INT_BYTE_SHIFT, INT_TO_BYTE, malloc(), htab::mapp, htab::nmaps, NULL, and SETBIT.
Referenced by init_htab(), and overflow_page().
|
static |
|
static |
|
static |
|
static |
Definition at line 578 of file hash_page.c.
References BUCKET_TO_PAGE, BYTE_ORDER, EFTYPE, errno, htab::fp, max, OADDR_TO_PAGE, and open_temp().
Referenced by __buf_free(), flush_meta(), and newbuf().
Definition at line 181 of file hash_page.c.
References __call_hash(), __get_buf(), BUF_MOD, BUF_PIN, DBT::data, _bufhead::flags, FREESPACE, NULL, OFFSET, _bufhead::page, putpair(), REAL_KEY, retval, DBT::size, and ugly_split().
Referenced by __expand_table().
Definition at line 910 of file hash_page.c.
References __get_page(), free(), malloc(), htab::mapp, htab::nmaps, and NULL.
Referenced by __free_ovflpage(), and overflow_page().
Definition at line 650 of file hash_page.c.
References BITS_PER_MAP.
Referenced by overflow_page().
|
static |
Definition at line 861 of file hash_page.c.
References htab::fp, NULL, and set().
Referenced by __put_page().
Definition at line 665 of file hash_page.c.
References __ibitmap(), ALL_SET, BITS_PER_MAP, BYTE_SHIFT, fetch_bitmap(), first_free(), htab::mapp, NCACHED, OADDR_OF, OVMSG, SETBIT, and SPLITMASK.
Referenced by __add_ovflpage().
Definition at line 96 of file hash_page.c.
References DBT::data, OFFSET, and DBT::size.
Referenced by __addel(), __split_page(), and ugly_split().
Definition at line 883 of file hash_page.c.
References DBT::data, FREESPACE, OFFSET, OVFLPAGE, PAIRSIZE, and DBT::size.
Referenced by __addel().
|
static |
Definition at line 277 of file hash_page.c.
References __add_ovflpage(), __big_split(), __call_hash(), __free_ovflpage(), __get_buf(), _bufhead::addr, BUF_MOD, DBT::data, _bufhead::flags, FREESPACE, if(), SPLIT_RETURN::newp, SPLIT_RETURN::nextp, NULL, OFFSET, SPLIT_RETURN::oldp, OVFLPAGE, _bufhead::page, PAIRFITS, putpair(), REAL_KEY, and DBT::size.
Referenced by __split_page().