nfs-ganesha 1.4
Classes | Defines | Typedefs | Functions

posixdb_internal.c File Reference

#include "posixdb_internal.h"
#include "posixdb_consistency.h"
#include <string.h>
#include "RW_Lock.h"

Go to the source code of this file.

Classes

struct  cache_path_entry__

Defines

#define CACHE_PATH_SIZE   509

Typedefs

typedef struct cache_path_entry__ cache_path_entry_t

Functions

int fsal_posixdb_cache_init ()
void fsal_posixdb_CachePath (posixfsal_handle_t *p_handle, fsal_path_t *p_path)
int fsal_posixdb_UpdateInodeCache (posixfsal_handle_t *p_handle)
int fsal_posixdb_GetInodeCache (posixfsal_handle_t *p_handle)
void fsal_posixdb_InvalidateCache ()
int fsal_posixdb_GetPathCache (posixfsal_handle_t *p_handle, fsal_path_t *p_path)
fsal_posixdb_status_t fsal_posixdb_buildOnePath (fsal_posixdb_conn *p_conn, posixfsal_handle_t *p_handle, fsal_path_t *p_path)
fsal_posixdb_status_t fsal_posixdb_recursiveDelete (fsal_posixdb_conn *p_conn, char *handleid_str, char *handlets_str, fsal_nodetype_t ftype)
fsal_posixdb_status_t fsal_posixdb_deleteParent (fsal_posixdb_conn *p_conn, char *handleid_str, char *handlets_str, char *handleidparent_str, char *handletsparent_str, char *filename, int nlink)
fsal_posixdb_status_t fsal_posixdb_internal_delete (fsal_posixdb_conn *p_conn, char *handleidparent_str, char *handletsparent_str, char *filename, fsal_posixdb_fileinfo_t *p_object_info)
fsal_posixdb_status_t posixdb_internal_fillFileinfoFromStrValues (fsal_posixdb_fileinfo_t *p_info, char *devid_str, char *inode_str, char *nlink_str, char *ctime_str, char *ftype_str)
 Fill a fsal_posixdb_fileinfo_t struct from char* values.

Define Documentation

#define CACHE_PATH_SIZE   509

Definition at line 23 of file PGSQL/posixdb_internal.c.


Typedef Documentation


Function Documentation

fsal_posixdb_status_t fsal_posixdb_buildOnePath ( fsal_posixdb_conn *  p_conn,
posixfsal_handle_t p_handle,
fsal_path_t p_path 
)

fsal_posixdb_buildOnePath: Build the path of an object with only one Path in the parent table (usually a directory).

Parameters:
p_conn(input) Connection to the database
p_handle(input) Handle of the object we want the path
path(output) Path of the object
Returns:
- FSAL_POSIXDB_NOERR, if no error. Another error code else.

Definition at line 221 of file PGSQL/posixdb_internal.c.

int fsal_posixdb_cache_init ( )

Definition at line 25 of file PGSQL/posixdb_internal.c.

void fsal_posixdb_CachePath ( posixfsal_handle_t p_handle,
fsal_path_t p_path 
)

Definition at line 51 of file PGSQL/posixdb_internal.c.

fsal_posixdb_status_t fsal_posixdb_deleteParent ( fsal_posixdb_conn *  p_conn,
char *  handleid_str,
char *  handlets_str,
char *  handleidparent_str,
char *  handletsparent_str,
char *  filename,
int  nlink 
)

fsal_posixdb_deleteParent: Delete a parent entry. If the handle has no more links, then it is also deleted. Notice : do not use with a directory

Parameters:
p_conn(input) Connection to the database
handleid_str(input) ID part of the handle of the object
handlets_str(input) Timestamp part of the handle of the parent directory
handleidparent_str(input) ID part of the handle of the object
handletsparent_str(input) Timestamp part of the handle of the parent directory
filename(input) Filename of the entry to delete
nlink(input) Number of hardlink on the object
Returns:
- FSAL_POSIXDB_NOERR, if no error. Another error code else.

Definition at line 397 of file PGSQL/posixdb_internal.c.

int fsal_posixdb_GetInodeCache ( posixfsal_handle_t p_handle)

Definition at line 138 of file PGSQL/posixdb_internal.c.

int fsal_posixdb_GetPathCache ( posixfsal_handle_t p_handle,
fsal_path_t p_path 
)

Definition at line 189 of file PGSQL/posixdb_internal.c.

fsal_posixdb_status_t fsal_posixdb_internal_delete ( fsal_posixdb_conn *  p_conn,
char *  handleidparent_str,
char *  handletsparent_str,
char *  filename,
fsal_posixdb_fileinfo_t p_object_info 
)

fsal_posixdb_internal_delete: Delete a Parent entry knowing its parent handle and its name

See also:
fsal_posixdb_delete

Definition at line 458 of file PGSQL/posixdb_internal.c.

void fsal_posixdb_InvalidateCache ( )

Definition at line 168 of file PGSQL/posixdb_internal.c.

fsal_posixdb_status_t fsal_posixdb_recursiveDelete ( fsal_posixdb_conn *  p_conn,
char *  handleid_str,
char *  handlets_str,
fsal_nodetype_t  ftype 
)

fsal_posixdb_recursiveDelete: Delete a handle and all its entries in the Parent table. If the object is a directory, then all its entries will be recursively deleted.

Parameters:
p_conn(input) Connection to the database
handleid_str(input) ID part of the handle
handlets_str(input) Timestamp part of the handle
ftype(input) Type of the object (regular file, directory, ...)
Returns:
- FSAL_POSIXDB_NOERR, if no error. Another error code else.

Definition at line 333 of file PGSQL/posixdb_internal.c.

int fsal_posixdb_UpdateInodeCache ( posixfsal_handle_t p_handle)

Definition at line 93 of file PGSQL/posixdb_internal.c.

fsal_posixdb_status_t posixdb_internal_fillFileinfoFromStrValues ( fsal_posixdb_fileinfo_t p_info,
char *  devid_str,
char *  inode_str,
char *  nlink_str,
char *  ctime_str,
char *  ftype_str 
)

Fill a fsal_posixdb_fileinfo_t struct from char* values.

Parameters:
p_info
devid_str
inode_str
nlink_str
ctime_str
ftype_str
Returns:
ERR_FSAL_POSIXDB_NOERR, if no error ERR_FSAL_POSIXDB_FAULT if p_info is NULL

Definition at line 524 of file PGSQL/posixdb_internal.c.