IDZEBRA
2.2.7
|
#include <yaz/yconfig.h>
Go to the source code of this file.
Data Structures | |
struct | CFile_ph_bucket |
CFile hash structure on disc. More... | |
struct | CFile_hash_bucket |
CFile hash structure info in memory. More... | |
struct | CFile_head |
CFile file header. More... | |
struct | CFile_struct |
All in-memory information per CFile. More... | |
Macros | |
#define | HASH_BUCKET 15 |
number of blocks in hash bucket More... | |
#define | HASH_BSIZE sizeof(struct CFile_ph_bucket) |
#define | CFILE_STATE_HASH 1 |
state of CFile is a hash structure More... | |
#define | CFILE_STATE_FLAT 2 |
state of CFile is a flat file file More... | |
Typedefs | |
typedef struct CFile_struct * | CFile |
All in-memory information per CFile. More... | |
Functions | |
int | cf_close (CFile cf) |
CFile | cf_open (MFile mf, MFile_area area, const char *fname, int block_size, int wflag, int *firstp) |
int | cf_read (CFile cf, zint no, int offset, int nbytes, void *buf) |
reads block from commit area More... | |
int | cf_write (CFile cf, zint no, int offset, int nbytes, const void *buf) |
writes block to commit area More... | |
int | cf_commit (CFile cf) ZEBRA_GCC_ATTR((warn_unused_result)) |
#define CFILE_STATE_FLAT 2 |
#define CFILE_STATE_HASH 1 |
#define HASH_BSIZE sizeof(struct CFile_ph_bucket) |
typedef struct CFile_struct * CFile |
All in-memory information per CFile.
int cf_close | ( | CFile | cf | ) |
Definition at line 616 of file cfile.c.
References CFile_struct::array, CFile_struct::block_mf, CFile_struct::bucket_in_memory, CFile_struct::dirty, CFile_head::first_bucket, flush_bucket(), CFile_struct::hash_mf, CFile_struct::head, CFile_struct::iobuf, mf_close(), mf_write(), CFile_struct::mutex, CFile_head::next_bucket, CFile_struct::no_hits, CFile_struct::no_miss, CFile_struct::parray, write_head(), zebra_mutex_destroy(), and ZINT_FORMAT.
Referenced by bf_close2(), bf_commitExec(), and cf_open().
int cf_commit | ( | CFile | cf | ) |
Definition at line 257 of file commit.c.
References CFile_struct::bucket_in_memory, cf_commit_flat(), cf_commit_hash(), CFILE_STATE_FLAT, CFILE_STATE_HASH, CFile_struct::head, log_level, and CFile_head::state.
Referenced by bf_commitExec().
CFile cf_open | ( | MFile | mf, |
MFile_area | area, | ||
const char * | fname, | ||
int | block_size, | ||
int | wflag, | ||
int * | firstp | ||
) |
Definition at line 82 of file cfile.c.
References CFile_struct::array, CFile_struct::block_mf, CFile_head::block_size, CFile_struct::bucket_in_memory, CFile_struct::bucket_lru_back, CFile_struct::bucket_lru_front, cf_close(), CFILE_STATE_HASH, CFile_struct::dirty, CFile_head::first_bucket, CFile_head::flat_bucket, HASH_BSIZE, CFile_struct::hash_mf, CFile_head::hash_size, CFile_struct::head, CFile_struct::iobuf, CFile_struct::max_bucket_in_memory, mf_open(), mf_read(), mf_write(), CFile_struct::mutex, CFile_head::next_block, CFile_head::next_bucket, CFile_struct::no_hits, CFile_struct::no_miss, CFile_struct::parray, read_head(), CFile_struct::rmf, CFile_head::state, write_head(), and zebra_mutex_init().
Referenced by bf_commitExec(), and bf_open().
reads block from commit area
cf | commit file |
no | block number |
offset | offset in block |
nbytes | number of bytes to read |
buf | buffer for content (if read was succesful) |
0 | block could not be fully read |
1 | block could be read |
-1 | error |
Definition at line 542 of file cfile.c.
References CFile_struct::block_mf, cf_lookup(), mf_read(), CFile_struct::mutex, zebra_mutex_lock(), zebra_mutex_unlock(), and ZINT_FORMAT.
Referenced by bf_read2().
writes block to commit area
cf | commit file |
no | block number |
offset | offset in block |
nbytes | number of bytes to be written |
buf | buffer to be written |
0 | block written |
-1 | error |
Definition at line 579 of file cfile.c.
References CFile_struct::block_mf, cf_lookup(), cf_new(), CFile_struct::iobuf, mf_read(), mf_write(), CFile_struct::mutex, CFile_struct::rmf, zebra_mutex_lock(), and zebra_mutex_unlock().
Referenced by bf_write2().