nfs-ganesha 1.4
Functions

Name handling functions.

Functions

fsal_status_t FSAL_str2name (const char *string, fsal_mdsize_t in_str_maxlen, fsal_name_t *name)
fsal_status_t FSAL_str2path (char *string, fsal_mdsize_t in_str_maxlen, fsal_path_t *p_path)
fsal_status_t FSAL_name2str (fsal_name_t *p_name, char *string, fsal_mdsize_t out_str_maxlen)
fsal_status_t FSAL_path2str (fsal_path_t *p_path, char *string, fsal_mdsize_t out_str_maxlen)
int FSAL_namecmp (const fsal_name_t *p_name1, const fsal_name_t *p_name2)
int FSAL_pathcmp (fsal_path_t *p_path1, fsal_path_t *p_path2)
fsal_status_t FSAL_namecpy (fsal_name_t *p_tgt_name, fsal_name_t *p_src_name)
fsal_status_t FSAL_pathcpy (fsal_path_t *p_tgt_path, fsal_path_t *p_src_path)
fsal_status_t FSAL_buffdesc2name (fsal_buffdesc_t *in_buf, fsal_name_t *out_name)
fsal_status_t FSAL_buffdesc2path (fsal_buffdesc_t *in_buf, fsal_path_t *out_path)
fsal_status_t FSAL_path2buffdesc (fsal_path_t *in_path, fsal_buffdesc_t *out_buff)
fsal_status_t FSAL_name2buffdesc (fsal_name_t *in_name, fsal_buffdesc_t *out_buff)
int FSAL_namecmp (fsal_name_t *p_name1, fsal_name_t *p_name2)

Detailed Description

Those functions handle FS object names.


Function Documentation

fsal_status_t FSAL_buffdesc2name ( fsal_buffdesc_t in_buf,
fsal_name_t out_name 
)

FSAL_buffdesc2name: Convert a buffer descriptor to an fsal name.

Definition at line 313 of file fsal_strings.c.

fsal_status_t FSAL_buffdesc2path ( fsal_buffdesc_t in_buf,
fsal_path_t out_path 
)

FSAL_buffdesc2path: Convert a buffer descriptor to an fsal path.

Definition at line 327 of file fsal_strings.c.

fsal_status_t FSAL_name2buffdesc ( fsal_name_t in_name,
fsal_buffdesc_t out_buff 
)

FSAL_name2buffdesc: Convert an fsal name to a buffer descriptor (utf8 like).

Parameters:
in_name(input): The fsal name to be converted.
out_buff(output): Pointer to the buffer descriptor to be filled.
Warning:
The buffer descriptor only contains pointers to the in_name structure. Thus, if the in_name structure is modified or destroyed, the out_buff will be affected.

Definition at line 378 of file fsal_strings.c.

fsal_status_t FSAL_name2str ( fsal_name_t p_name,
char *  string,
fsal_mdsize_t  out_str_maxlen 
)

FSAL_name2str : converts an fsal_name_t to a char * .

Parameters:
p_name(in, fsal_name_t * ) Pointer to the structure to be converted.
string(out, char *) Address of the string to be filled.
out_str_maxlen(in, fsal_mdsize_t) Maximum size for the string to be filled.
Returns:
major codes :
  • ERR_FSAL_FAULT
  • ERR_FSAL_TOOSMALL

Definition at line 152 of file fsal_strings.c.

int FSAL_namecmp ( const fsal_name_t p_name1,
const fsal_name_t p_name2 
)

FSAL_namecmp : compares two FSAL_name_t.

Returns:
The same value as strcmp.

Definition at line 232 of file fsal_strings.c.

int FSAL_namecmp ( fsal_name_t p_name1,
fsal_name_t p_name2 
)

FSAL_namecmp : compares two FSAL_name_t.

Returns:
The same value as strcmp.

Definition at line 233 of file FSAL_TEMPLATE/fsal_strings.c.

fsal_status_t FSAL_namecpy ( fsal_name_t p_tgt_name,
fsal_name_t p_src_name 
)

FSAL_namecpy. copies a name to another.

Parameters:
p_tgt_namepointer to target name.
p_src_namepointer to source name.
Returns:
major code ERR_FSAL_FAULT, if tgt_name is NULL.

Definition at line 261 of file fsal_strings.c.

fsal_status_t FSAL_path2buffdesc ( fsal_path_t in_path,
fsal_buffdesc_t out_buff 
)

FSAL_path2buffdesc: Convert an fsal path to a buffer descriptor (utf8 like).

Parameters:
in_path(input): The fsal path to be converted.
out_buff(output): Pointer to the buffer descriptor to be filled.
Warning:
The buffer descriptor only contains pointers to the in_path structure. Thus, if the in_path structure is modified or destroyed, the out_buff will be affected.

Definition at line 351 of file fsal_strings.c.

fsal_status_t FSAL_path2str ( fsal_path_t p_path,
char *  string,
fsal_mdsize_t  out_str_maxlen 
)

FSAL_path2str : converts an fsal_path_t to a char * .

Parameters:
p_path(in, fsal_path_t * ) The structure to be converted.
string(out, char *) Address of the string to be filled.
out_str_maxlen(in, fsal_mdsize_t) Maximum size for the string to be filled.
Returns:
major codes :
  • ERR_FSAL_FAULT
  • ERR_FSAL_TOOSMALL

Definition at line 197 of file fsal_strings.c.

int FSAL_pathcmp ( fsal_path_t p_path1,
fsal_path_t p_path2 
)

FSAL_pathcmp : compares two FSAL_path_t.

Returns:
The same value as strcmp.

Definition at line 246 of file fsal_strings.c.

fsal_status_t FSAL_pathcpy ( fsal_path_t p_tgt_path,
fsal_path_t p_src_path 
)

FSAL_pathcpy. copies a path to another.

Parameters:
p_tgt_namepointer to the target name.
p_src_namepointer to the source name.
Returns:
major code ERR_FSAL_FAULT, if tgt_name is NULL.

Definition at line 289 of file fsal_strings.c.

fsal_status_t FSAL_str2name ( const char *  string,
fsal_mdsize_t  in_str_maxlen,
fsal_name_t name 
)

FSAL_str2name : converts a char * to an fsal_name_t.

Parameters:
string(in, char *) Address of the string to be converted.
in_str_maxlen(in, fsal_mdsize_t) Maximum size for the string to be converted.
name(out, fsal_name_t *) The structure to be filled with the name.
Returns:
major codes :
  • ERR_FSAL_FAULT
  • ERR_FSAL_NAMETOOLONG

Definition at line 44 of file fsal_strings.c.

fsal_status_t FSAL_str2path ( char *  string,
fsal_mdsize_t  in_str_maxlen,
fsal_path_t p_path 
)

FSAL_str2path : converts a char * to an fsal_path_t.

Parameters:
string(in, char *) Address of the string to be converted.
in_str_maxlen(in, fsal_mdsize_t) Maximum size for the string to be converted.
p_path(out, fsal_path_t *) The structure to be filled with the name.
Returns:
major codes :
  • ERR_FSAL_FAULT
  • ERR_FSAL_NAMETOOLONG

Definition at line 98 of file fsal_strings.c.