Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include <sys/param.h>
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include "../include/db.h"
#include "hash.h"
#include "page.h"
#include "extern.h"
Go to the source code of this file.
Macros | |
#define | BUF_INSERT(B, P) |
#define | BUF_REMOVE(B) |
#define | LRU hashp->bufhead.prev |
#define | LRU_INSERT(B) BUF_INSERT((B), LRU) |
#define | MRU hashp->bufhead.next |
#define | MRU_INSERT(B) BUF_INSERT((B), &hashp->bufhead) |
Functions | |
int | __buf_free (HTAB *hashp, int do_free, int to_disk) |
void | __buf_init (HTAB *hashp, int nbytes) |
BUFHEAD * | __get_buf (HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp, int newpage) |
static BUFHEAD *newbuf | __P ((HTAB *, u_int32_t, BUFHEAD *)) |
void | __reclaim_buf (HTAB *hashp, BUFHEAD *bp) |
static BUFHEAD * | newbuf (HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp) |
#define BUF_INSERT | ( | B, | |
P | |||
) |
Definition at line 82 of file hash_buf.c.
#define BUF_REMOVE | ( | B | ) |
Definition at line 76 of file hash_buf.c.
#define LRU hashp->bufhead.prev |
Definition at line 90 of file hash_buf.c.
#define LRU_INSERT | ( | B | ) | BUF_INSERT((B), LRU) |
Definition at line 93 of file hash_buf.c.
#define MRU hashp->bufhead.next |
Definition at line 89 of file hash_buf.c.
#define MRU_INSERT | ( | B | ) | BUF_INSERT((B), &hashp->bufhead) |
Definition at line 92 of file hash_buf.c.
int __buf_free | ( | HTAB * | hashp, |
int | do_free, | ||
int | to_disk | ||
) |
Definition at line 315 of file hash_buf.c.
References __put_page(), _bufhead::addr, BUF_MOD, BUF_REMOVE, htab::bufhead, _bufhead::flags, free(), IS_BUCKET, LRU, _bufhead::page, and _bufhead::prev.
Referenced by hash_sync(), and hdestroy().
void __buf_init | ( | HTAB * | hashp, |
int | nbytes | ||
) |
Definition at line 290 of file hash_buf.c.
References htab::bufhead, MAX, MIN_BUFFERS, htab::nbufs, _bufhead::next, and _bufhead::prev.
Referenced by __hash_open().
Definition at line 105 of file hash_buf.c.
References __get_page(), _bufhead::addr, BUF_DISK, BUF_REMOVE, htab::dir, ISDISK, MRU_INSERT, htab::new_file, newbuf(), NULL, _bufhead::ovfl, _bufhead::page, and PTROF.
Referenced by __add_ovflpage(), __addel(), __big_delete(), __big_return(), __big_split(), __find_bigpair(), __find_last_page(), __split_page(), collect_data(), collect_key(), hash_access(), hash_seq(), and ugly_split().
Definition at line 346 of file hash_buf.c.
References _bufhead::addr, BUF_REMOVE, _bufhead::flags, LRU_INSERT, and _bufhead::ovfl.
Referenced by __free_ovflpage().
Definition at line 160 of file hash_buf.c.
References __put_page(), _bufhead::addr, BUF_BUCKET, BUF_DISK, BUF_MOD, BUF_PIN, BUF_REMOVE, htab::dir, _bufhead::flags, free(), if(), IS_BUCKET, ISDISK, LRU, LRU_INSERT, malloc(), MRU_INSERT, htab::nbufs, htab::new_file, NULL, _bufhead::ovfl, and _bufhead::page.
Referenced by __get_buf(), and xmpp_client_receive().