nfs-ganesha 1.4
Defines | Functions

fsal_tools.c File Reference

#include "fsal.h"
#include "fsal_internal.h"
#include "fsal_common.h"
#include "fsal_convert.h"
#include "config_parsing.h"
#include <string.h>

Go to the source code of this file.

Defines

#define STRCMP   strcasecmp
#define TYPE_UUIDT   hpss_uuid_t
#define INTMACRO_TO_STR(_x)   _DEREF(_x)
#define _DEREF(_x)   #_x
#define SMALL_PRIME_MULT   3
#define SMALL_PRIME_ADD   1999
#define HASH_INCR(_h_, _i_)   ( _h_ = (_h_ * SMALL_PRIME_MULT + SMALL_PRIME_ADD) % _i_ )

Functions

char * HPSSFSAL_GetFSName ()
int HPSSFSAL_handlecmp (hpssfsal_handle_t *handle1, hpssfsal_handle_t *handle2, fsal_status_t *status)
unsigned int HPSSFSAL_Handle_to_HashIndex (hpssfsal_handle_t *p_handle, unsigned int cookie, unsigned int alphabet_len, unsigned int index_size)
unsigned int HPSSFSAL_Handle_to_RBTIndex (hpssfsal_handle_t *p_handle, unsigned int cookie)
fsal_status_t HPSSFSAL_DigestHandle (hpssfsal_export_context_t *p_expcontext, fsal_digesttype_t output_type, hpssfsal_handle_t *in_fsal_handle, caddr_t out_buff)
fsal_status_t HPSSFSAL_ExpandHandle (hpssfsal_export_context_t *p_expcontext, fsal_digesttype_t in_type, caddr_t in_buff, hpssfsal_handle_t *out_fsal_handle)
fsal_status_t HPSSFSAL_SetDefault_FSAL_parameter (fsal_parameter_t *out_parameter)
fsal_status_t HPSSFSAL_SetDefault_FS_common_parameter (fsal_parameter_t *out_parameter)
fsal_status_t HPSSFSAL_SetDefault_FS_specific_parameter (fsal_parameter_t *out_parameter)
fsal_status_t HPSSFSAL_load_FSAL_parameter_from_conf (config_file_t in_config, fsal_parameter_t *out_parameter)
fsal_status_t HPSSFSAL_load_FS_common_parameter_from_conf (config_file_t in_config, fsal_parameter_t *out_parameter)
fsal_status_t HPSSFSAL_load_FS_specific_parameter_from_conf (config_file_t in_config, fsal_parameter_t *out_parameter)

Define Documentation

#define _DEREF (   _x)    #_x

Definition at line 35 of file FSAL_HPSS/fsal_tools.c.

#define HASH_INCR (   _h_,
  _i_ 
)    ( _h_ = (_h_ * SMALL_PRIME_MULT + SMALL_PRIME_ADD) % _i_ )
#define INTMACRO_TO_STR (   _x)    _DEREF(_x)

Definition at line 34 of file FSAL_HPSS/fsal_tools.c.

#define SMALL_PRIME_ADD   1999
#define SMALL_PRIME_MULT   3
#define STRCMP   strcasecmp

Definition at line 26 of file FSAL_HPSS/fsal_tools.c.

#define TYPE_UUIDT   hpss_uuid_t

Definition at line 31 of file FSAL_HPSS/fsal_tools.c.


Function Documentation

fsal_status_t HPSSFSAL_DigestHandle ( hpssfsal_export_context_t p_expcontext,
fsal_digesttype_t  output_type,
hpssfsal_handle_t in_fsal_handle,
caddr_t  out_buff 
)

FSAL_DigestHandle : Convert an hpssfsal_handle_t to a buffer to be included into NFS handles, or another digest.

Parameters:
output_type(input): Indicates the type of digest to do.
in_fsal_handle(input): The handle to be converted to digest.
out_buff(output): The buffer where the digest is to be stored.
Returns:
The major code is ERR_FSAL_NO_ERROR is no error occured. Else, it is a non null value.

Definition at line 201 of file FSAL_HPSS/fsal_tools.c.

fsal_status_t HPSSFSAL_ExpandHandle ( hpssfsal_export_context_t p_expcontext,
fsal_digesttype_t  in_type,
caddr_t  in_buff,
hpssfsal_handle_t out_fsal_handle 
)

FSAL_ExpandHandle : Convert a buffer extracted from NFS handles to an FSAL handle.

Parameters:
in_type(input): Indicates the type of digest to be expanded.
in_buff(input): Pointer to the digest to be expanded.
out_fsal_handle(output): The handle built from digest.
Returns:
The major code is ERR_FSAL_NO_ERROR is no error occured. Else, it is a non null value.

Definition at line 433 of file FSAL_HPSS/fsal_tools.c.

char* HPSSFSAL_GetFSName ( )

Definition at line 37 of file FSAL_HPSS/fsal_tools.c.

unsigned int HPSSFSAL_Handle_to_HashIndex ( hpssfsal_handle_t p_handle,
unsigned int  cookie,
unsigned int  alphabet_len,
unsigned int  index_size 
)

FSAL_Handle_to_HashIndex This function is used for hashing a FSAL handle in order to dispatch entries into the hash table array.

Parameters:
p_handleThe handle to be hashed
cookieMakes it possible to have different hash value for the same handle, when cookie changes.
alphabet_lenParameter for polynomial hashing algorithm
index_sizeThe range of hash value will be [0..index_size-1]
Returns:
The hash value

Definition at line 104 of file FSAL_HPSS/fsal_tools.c.

unsigned int HPSSFSAL_Handle_to_RBTIndex ( hpssfsal_handle_t p_handle,
unsigned int  cookie 
)

Definition at line 159 of file FSAL_HPSS/fsal_tools.c.

int HPSSFSAL_handlecmp ( hpssfsal_handle_t handle1,
hpssfsal_handle_t handle2,
fsal_status_t status 
)

FSAL_handlecmp: Compare 2 handles.

Parameters:
handle1(input): The first handle to be compared.
handle2(input): The second handle to be compared.
status(output): The status of the compare operation.
Returns:
- 0 if handles are the same.
  • A non null value else.
  • Segfault if status is a NULL pointer.

Definition at line 59 of file FSAL_HPSS/fsal_tools.c.

fsal_status_t HPSSFSAL_load_FS_common_parameter_from_conf ( config_file_t  in_config,
fsal_parameter_t out_parameter 
)

Definition at line 733 of file FSAL_HPSS/fsal_tools.c.

fsal_status_t HPSSFSAL_load_FS_specific_parameter_from_conf ( config_file_t  in_config,
fsal_parameter_t out_parameter 
)

Definition at line 941 of file FSAL_HPSS/fsal_tools.c.

fsal_status_t HPSSFSAL_load_FSAL_parameter_from_conf ( config_file_t  in_config,
fsal_parameter_t out_parameter 
)

FSAL_load_FSAL_parameter_from_conf, FSAL_load_FS_common_parameter_from_conf, FSAL_load_FS_specific_parameter_from_conf:

Those functions initialize the FSAL init parameter structure from a configuration structure.

Parameters:
in_config(input): Structure that represents the parsed configuration file.
out_parameter(ouput) FSAL initialization structure filled according to the configuration file given as parameter.
Returns:
ERR_FSAL_NO_ERROR (no error) , ERR_FSAL_NOENT (missing a mandatory stanza in config file), ERR_FSAL_INVAL (invalid parameter), ERR_FSAL_SERVERFAULT (unexpected error) ERR_FSAL_FAULT (null pointer given as parameter),

Definition at line 628 of file FSAL_HPSS/fsal_tools.c.

fsal_status_t HPSSFSAL_SetDefault_FS_common_parameter ( fsal_parameter_t out_parameter)

Definition at line 534 of file FSAL_HPSS/fsal_tools.c.

fsal_status_t HPSSFSAL_SetDefault_FS_specific_parameter ( fsal_parameter_t out_parameter)

Definition at line 570 of file FSAL_HPSS/fsal_tools.c.

fsal_status_t HPSSFSAL_SetDefault_FSAL_parameter ( fsal_parameter_t out_parameter)

Those routines set the default parameters for FSAL init structure.

Returns:
ERR_FSAL_NO_ERROR (no error) , ERR_FSAL_FAULT (null pointer given as parameter), ERR_FSAL_SERVERFAULT (unexpected error)

Definition at line 519 of file FSAL_HPSS/fsal_tools.c.