Download A Secure File System Based on

Transcript
mentioned in the previous section. They usually invoke some functions (API) that can
actually manipulate various metadata in a database. These functions are called internal
functions and implement the external functions in GDBM. These functions are organized
into some source files according to the type of the data structures they handle. These
internal functions are presented briefly below:
Function:
( From bucket.c )
void _gdbm_new_bucket ( gdbm_file_info * dbf, hash_bucket * bucket, int bits )
void _gdbm_get_bucket ( gdbm_file_info * dbf, int dir_index )
void _gdbm_split_bucket ( gdbm_file_info * dbf, int next_insert )
void _gdbm_write_bucket ( gdbm_file_info * dbf, cache_elem * ca_entry )
These functions are specially used to process hash buckets in a database. The first
function is used to initialize a new hash bucket and set hash values of all bucket elements
in the new hash bucket to –1 to indicate that these bucket elements are not yet used and
could be used by any key /data pair in the future. The second function is used to find a
hash bucket in a database that is pointed by the hash directory from the location dir_index.
The third function is used to split the current hash bucket into two new hash buckets. The
last function is used to actually write the hash bucket pointed by the given cache element
in system memory to the data file. This is the only place where a hash bucket is written to
a data file on disk.
Function:
( From falloc.c )
55