nfs-ganesha 1.4
Defines | Functions

handle_mapping_db.h File Reference

#include "handle_mapping.h"
#include "HashTable.h"

Go to the source code of this file.

Defines

#define DB_FILE_PREFIX   "handlemap.sqlite"
#define MAP_TABLE   "HandleMap"
#define OBJID_FIELD   "ObjectId"
#define HASH_FIELD   "HandleHash"
#define HANDLE_FIELD   "FSALHandle"
#define MAX_DB   32

Functions

int handlemap_db_count (const char *dir)
int handlemap_db_init (const char *db_dir, const char *tmp_dir, unsigned int db_count, unsigned int nb_dbop_prealloc, int synchronous_insert)
int handlemap_db_reaload_all (hash_table_t *target_hash)
int handlemap_db_insert (nfs23_map_handle_t *p_in_nfs23_digest, fsal_handle_t *p_in_handle)
int handlemap_db_delete (nfs23_map_handle_t *p_in_nfs23_digest)
int handlemap_db_flush ()

Define Documentation

#define DB_FILE_PREFIX   "handlemap.sqlite"

Definition at line 7 of file handle_mapping_db.h.

#define HANDLE_FIELD   "FSALHandle"

Definition at line 13 of file handle_mapping_db.h.

#define HASH_FIELD   "HandleHash"

Definition at line 12 of file handle_mapping_db.h.

#define MAP_TABLE   "HandleMap"

Definition at line 10 of file handle_mapping_db.h.

#define MAX_DB   32

Definition at line 15 of file handle_mapping_db.h.

#define OBJID_FIELD   "ObjectId"

Definition at line 11 of file handle_mapping_db.h.


Function Documentation

int handlemap_db_count ( const char *  dir)

count the number of database instances in a given directory (this is used for checking that the number of db matches the number of threads)

Definition at line 609 of file handle_mapping_db.c.

int handlemap_db_delete ( nfs23_map_handle_t p_in_nfs23_digest)

Submit a db 'delete' request. The request is inserted in the appropriate db queue. (always asynchronous)

Definition at line 848 of file handle_mapping_db.c.

int handlemap_db_flush ( )

Wait for all queues to be empty and all current DB request to be done.

Definition at line 885 of file handle_mapping_db.c.

int handlemap_db_init ( const char *  db_dir,
const char *  tmp_dir,
unsigned int  db_count,
unsigned int  nb_dbop_prealloc,
int  synchronous_insert 
)

Initialize databases access (init DB queues, start threads, establish DB connections, and create db schema if it was empty).

Initialize databases access

  • init DB queues
  • start threads
  • establish DB connections
  • create db schema if it was empty

Todo:
ici coller out_parameter->fs_specific_info.hdlmap_nb_db_op_prealloc

Definition at line 692 of file handle_mapping_db.c.

int handlemap_db_insert ( nfs23_map_handle_t p_in_nfs23_digest,
fsal_handle_t p_in_handle 
)

Submit a db 'insert' request. The request is inserted in the appropriate db queue.

Definition at line 804 of file handle_mapping_db.c.

int handlemap_db_reaload_all ( hash_table_t target_hash)

Gives the order to each DB thread to reload the content of its database and insert it to the hash table. The function blocks until all threads have loaded their data.

Definition at line 760 of file handle_mapping_db.c.