nfs-ganesha 1.4
Defines | Functions

nfs_tools.h File Reference

Prototypes for miscellaneous service routines. More...

#include "fsal.h"
#include "nfs23.h"
#include "nfs4.h"
#include "mount.h"
#include "nfs_exports.h"
#include "config_parsing.h"

Go to the source code of this file.

Defines

#define ATTRVALS_BUFFLEN   1024

Functions

int nfs_ParseConfLine (char *Argv[], int nbArgv, char *line, int(*separator_function)(char), int(*endLine_func)(char))
int ReadExports (config_file_t in_config, exportlist_t **pEx)
exportlist_tBuildDefaultExport ()
int nfs_Add_MountList_Entry (char *hostname, char *path)
int nfs_Remove_MountList_Entry (char *hostname, char *path)
int nfs_Init_MountList (void)
int nfs_Purge_MountList (void)
mountlist nfs_Get_MountList (void)
void nfs_Print_MountList (void)
char * nfsstat2_to_str (nfsstat2 code)
char * nfsstat3_to_str (nfsstat3 code)
char * nfsstat4_to_str (nfsstat4 code)
char * nfstype2_to_str (ftype2 code)
char * nfstype3_to_str (ftype3 code)
void nfs4_sprint_fhandle (nfs_fh4 *fh4p, char *outstr)
unsigned long decimal_simple_hash_func (hash_parameter_t *p_hparam, hash_buffer_t *buffclef)
unsigned long decimal_rbt_hash_func (hash_parameter_t *p_hparam, hash_buffer_t *buffclef)
int display_cache (hash_buffer_t *pbuff, char *str)
int compare_cache (hash_buffer_t *buff1, hash_buffer_t *buff2)
int print_cache (LRU_data_t data, char *str)
int clean_cache (LRU_entry_t *pentry, void *addparam)
int lru_data_entry_to_str (LRU_data_t data, char *str)
int lru_inode_clean_entry (LRU_entry_t *entry, void *adddata)
int lru_data_clean_entry (LRU_entry_t *entry, void *adddata)
int lru_inode_entry_to_str (LRU_data_t data, char *str)

Detailed Description

Prototypes for miscellaneous service routines.

Author:
Author:
deniel
Date:
Date:
2005/12/20 10:53:08
Version:
Revision:
1.21

nfs_tools.h : Prototypes for miscellaneous service routines.

Definition in file nfs_tools.h.


Define Documentation

#define ATTRVALS_BUFFLEN   1024

Definition at line 48 of file nfs_tools.h.


Function Documentation

exportlist_t* BuildDefaultExport ( )

Todo:
set default values here

Grant root access to all clients

Definition at line 2130 of file exports.c.

int clean_cache ( LRU_entry_t pentry,
void *  addparam 
)

Definition at line 114 of file nfs_tools.c.

int compare_cache ( hash_buffer_t buff1,
hash_buffer_t buff2 
)

Definition at line 104 of file nfs_tools.c.

unsigned long decimal_rbt_hash_func ( hash_parameter_t p_hparam,
hash_buffer_t buffclef 
)

Definition at line 92 of file nfs_tools.c.

unsigned long decimal_simple_hash_func ( hash_parameter_t p_hparam,
hash_buffer_t buffclef 
)

Definition at line 85 of file nfs_tools.c.

int display_cache ( hash_buffer_t pbuff,
char *  str 
)

Definition at line 98 of file nfs_tools.c.

int lru_data_clean_entry ( LRU_entry_t entry,
void *  adddata 
)

lru_data_clean_entry: a function used to clean up a LRU entry during cache inode gc.

a function used to clean up a LRU entry during cache inode gc.

Parameters:
entry[INOUT] the entry to be cleaned up.
adddata[IN] a buffer with additional input parameters.
Returns:
0 if successful, other values show an error.

Definition at line 182 of file nfs_tools.c.

int lru_data_entry_to_str ( LRU_data_t  data,
char *  str 
)

lru_data_entry_to_str: printing function for internal worker's LRU.

printing function for internal worker's LRU.

Parameters:
data[IN] the LRU data to be printed.
str[OUT] the string result.
Returns:
the length of the computed string of -1 if failed.

Definition at line 148 of file nfs_tools.c.

int lru_inode_clean_entry ( LRU_entry_t entry,
void *  adddata 
)

lru_inode_clean_entry: a function used to clean up a LRU entry during cache inode gc.

a function used to clean up a LRU entry during cache inode gc.

Parameters:
entry[INOUT] the entry to be cleaned up.
adddata[IN] a buffer with additional input parameters.
Returns:
0 if successful, other values show an error.

Definition at line 165 of file nfs_tools.c.

int lru_inode_entry_to_str ( LRU_data_t  data,
char *  str 
)

lru_inode_entry_to_str: printing function for internal worker's LRU.

printing function for internal worker's LRU.

Parameters:
data[IN] the LRU data to be printed.
str[OUT] the string result.
Returns:
the length of the computed string of -1 if failed.

Definition at line 131 of file nfs_tools.c.

void nfs4_sprint_fhandle ( nfs_fh4 fh4p,
char *  outstr 
)

nfs4_sprint_fhandle : converts a file handle v4 to a string.

Converts a file handle v4 to a string. This will be used mostly for debugging purpose.

Parameters:
fh4p[OUT] pointer to the file handle to be converted to a string.
data[INOUT] pointer to the char * resulting from the operation.
Returns:
nothing (void function).

Definition at line 941 of file nfs_filehandle_mgmt.c.

int nfs_Add_MountList_Entry ( char *  hostname,
char *  dirpath 
)

nfs_Add_MountList_Entry: Adds a client to the mount list.

Adds a client to the mount list.

Parameters:
hostname[IN] the hostname for the client
dirpath[IN] the mounted path
Returns:
1 if successful, 0 otherwise

Definition at line 112 of file nfs_mnt_list.c.

mountlist nfs_Get_MountList ( void  )

nfs_Get_MountList: Returns the mount list.

Returns the mount list.

Parameters:
none(take no argument)
Returns:
the mount list (NULL if mount list is empty)

Definition at line 314 of file nfs_mnt_list.c.

int nfs_Init_MountList ( void  )

nfs_Init_MountList: Initializes the mount list.

Initializes the mount list.

Parameters:
none(take no argument)
Returns:
1 if successful, 0 otherwise

Definition at line 292 of file nfs_mnt_list.c.

int nfs_ParseConfLine ( char *  Argv[],
int  nbArgv,
char *  line,
int(*)(char)  separator_function,
int(*)(char)  endLine_func 
)

nfs_ParseConfLine: parse a line with a settable separator and end of line

parse a line with a settable separator and end of line .

Parameters:
Argv[OUT] result array
nbArgv[IN] allocated number of entries in the Argv
line[IN] input line
separator_function[IN] function used to identify a separator
endLine_func[IN] function used to identify an end of line
Returns:
the number of object found

Definition at line 175 of file exports.c.

void nfs_Print_MountList ( void  )

nfs_Print_MountList: Prints the mount list (for debugging purpose).

Prints the mount list (for debugging purpose).

Parameters:
none(take no argument)
Returns:
nothing (void function)

Definition at line 333 of file nfs_mnt_list.c.

int nfs_Purge_MountList ( void  )

nfs_Purge_MountList: Purges the whole mount list.

Purges the whole mount list.

Parameters:
none(take no argument)
Returns:
1 if successful, 0 otherwise

Definition at line 251 of file nfs_mnt_list.c.

int nfs_Remove_MountList_Entry ( char *  hostname,
char *  dirpath 
)

nfs_Remove_MountList_Entry: Removes a client to the mount list.

Removes a client to the mount list.

Parameters:
hostname[IN] the hostname for the client
path[IN] the mounted path
Returns:
1 if successful, 0 otherwise

Definition at line 184 of file nfs_mnt_list.c.

char* nfsstat2_to_str ( nfsstat2  code)

Definition at line 59 of file nfs_convert.c.

char* nfsstat3_to_str ( nfsstat3  code)

Definition at line 88 of file nfs_convert.c.

char* nfsstat4_to_str ( nfsstat4  code)

Definition at line 128 of file nfs_convert.c.

char* nfstype2_to_str ( ftype2  code)

Definition at line 242 of file nfs_convert.c.

char* nfstype3_to_str ( ftype3  code)

Definition at line 262 of file nfs_convert.c.

int print_cache ( LRU_data_t  data,
char *  str 
)

Definition at line 109 of file nfs_tools.c.

int ReadExports ( config_file_t  in_config,
exportlist_t **  ppexportlist 
)

ReadExports: Read the export entries from the parsed configuration file.

Returns:
A negative value on error, the number of export entries else.

Definition at line 2214 of file exports.c.