nfs-ganesha 1.4
Defines | Functions | Variables

fsal_internal.c File Reference

#include "fsal.h"
#include "fsal_internal.h"
#include "posixdb_consistency.h"
#include "abstract_mem.h"
#include "SemN.h"
#include "fsal_convert.h"
#include <libgen.h>
#include <pthread.h>
#include <string.h>
#include <mntent.h>

Go to the source code of this file.

Defines

#define FSAL_INTERNAL_C

Functions

void fsal_increment_nbcall (int function_index, fsal_status_t status)
void fsal_internal_getstats (fsal_statistics_t *output_stats)
void fsal_internal_SetCredentialLifetime (fsal_uint_t lifetime_in)
void TakeTokenFSCall ()
void ReleaseTokenFSCall ()
fsal_status_t fsal_internal_init_global (fsal_init_info_t *fsal_info, fs_common_initinfo_t *fs_common_info, posixfs_specific_initinfo_t *fs_specific_info)
fsal_status_t fsal_internal_posix2posixdb_fileinfo (struct stat *buffstat, fsal_posixdb_fileinfo_t *info)
 convert 'struct stat' to 'fsal_posixdb_fileinfo_t'
fsal_status_t fsal_internal_posixdb_add_entry (fsal_posixdb_conn *p_conn, fsal_name_t *p_filename, fsal_posixdb_fileinfo_t *p_info, posixfsal_handle_t *p_dir_handle, posixfsal_handle_t *p_new_handle)
fsal_status_t fsal_internal_appendFSALNameToFSALPath (fsal_path_t *p_path, fsal_name_t *p_name)
 p_path <- p_path + '/' + p_name
fsal_status_t fsal_internal_getPathFromHandle (posixfsal_op_context_t *p_context, posixfsal_handle_t *p_handle, int is_dir, fsal_path_t *p_fsalpath, struct stat *p_buffstat)
fsal_status_t fsal_internal_getInfoFromName (posixfsal_op_context_t *p_context, posixfsal_handle_t *p_parent_dir_handle, fsal_name_t *p_fsalname, fsal_posixdb_fileinfo_t *p_infofs, posixfsal_handle_t *p_object_handle)
 Get the handle of a file, knowing its name and its parent dir.
fsal_status_t fsal_internal_getInfoFromChildrenList (posixfsal_op_context_t *p_context, posixfsal_handle_t *p_parent_dir_handle, fsal_name_t *p_fsalname, fsal_posixdb_fileinfo_t *p_infofs, fsal_posixdb_child *p_children, unsigned int children_count, posixfsal_handle_t *p_object_handle)
 Get the handle of a file from a fsal_posixdb_child array, knowing its name.
fsal_status_t fsal_internal_testAccess (posixfsal_op_context_t *p_context, fsal_accessflags_t access_type, struct stat *p_buffstat, fsal_attrib_list_t *p_object_attributes)
int fsal_internal_path2fsname (char *rpath, char *fs_spec)

Variables

fsal_uint_t CredentialLifetime = 3600
fsal_staticfsinfo_t global_fs_info
fsal_posixdb_conn_params_t global_posixdb_params
semaphore_t sem_fs_calls

Define Documentation

#define FSAL_INTERNAL_C

Definition at line 15 of file FSAL_POSIX/fsal_internal.c.


Function Documentation

void fsal_increment_nbcall ( int  function_index,
fsal_status_t  status 
)

fsal_increment_nbcall: Updates fonction call statistics.

Parameters:
function_index(input): Index of the function whom number of call is to be incremented.
status(input): Status the function returned.
Returns:
Nothing.

Definition at line 103 of file FSAL_POSIX/fsal_internal.c.

fsal_status_t fsal_internal_appendFSALNameToFSALPath ( fsal_path_t p_path,
fsal_name_t p_name 
)

p_path <- p_path + '/' + p_name

Parameters:
p_path
p_name
Returns:

Definition at line 471 of file FSAL_POSIX/fsal_internal.c.

fsal_status_t fsal_internal_getInfoFromChildrenList ( posixfsal_op_context_t p_context,
posixfsal_handle_t p_parent_dir_handle,
fsal_name_t p_fsalname,
fsal_posixdb_fileinfo_t p_infofs,
fsal_posixdb_child p_children,
unsigned int  children_count,
posixfsal_handle_t p_object_handle 
)

Get the handle of a file from a fsal_posixdb_child array, knowing its name.

Parameters:
p_context
p_parent_dir_handleHandle of the parent directory
p_fsalnameName of the object
p_infofsInformation about the file (taken from the filesystem) to be compared to information stored in database
p_childrenfsal_posixdb_child array (that contains the entries of the directory stored in the db)
p_object_handleHandle of the file.
Returns:
ERR_FSAL_NOERR, if no error Anothere error code else.

Definition at line 695 of file FSAL_POSIX/fsal_internal.c.

fsal_status_t fsal_internal_getInfoFromName ( posixfsal_op_context_t p_context,
posixfsal_handle_t p_parent_dir_handle,
fsal_name_t p_fsalname,
fsal_posixdb_fileinfo_t p_infofs,
posixfsal_handle_t p_object_handle 
)

Get the handle of a file, knowing its name and its parent dir.

Parameters:
p_context
p_parent_dir_handleHandle of the parent directory
p_fsalnameName of the object
p_infofsInformation about the file (taken from the filesystem) to be compared to information stored in database
p_object_handleHandle of the file.
Returns:
ERR_FSAL_NOERR, if no error Anothere error code else.

Definition at line 628 of file FSAL_POSIX/fsal_internal.c.

fsal_status_t fsal_internal_getPathFromHandle ( posixfsal_op_context_t p_context,
posixfsal_handle_t p_handle,
int  is_dir,
fsal_path_t p_fsalpath,
struct stat *  p_buffstat 
)

Get a valid path associated to an handle. The function selects many paths from the DB and return the first valid one. If is_dir is set, then only 1 path will be constructed from the database.

Definition at line 505 of file FSAL_POSIX/fsal_internal.c.

void fsal_internal_getstats ( fsal_statistics_t output_stats)

fsal_internal_getstats: (For internal use in the FSAL). Retrieve call statistics for current thread.

Parameters:
output_stats(output): Pointer to the call statistics structure.
Returns:
Nothing.

Definition at line 181 of file FSAL_POSIX/fsal_internal.c.

fsal_status_t fsal_internal_init_global ( fsal_init_info_t fsal_info,
fs_common_initinfo_t fs_common_info,
posixfs_specific_initinfo_t fs_specific_info 
)

This function initializes shared variables of the FSAL.

Definition at line 272 of file FSAL_POSIX/fsal_internal.c.

int fsal_internal_path2fsname ( char *  rpath,
char *  fs_spec 
)

Definition at line 902 of file FSAL_POSIX/fsal_internal.c.

fsal_status_t fsal_internal_posix2posixdb_fileinfo ( struct stat *  buffstat,
fsal_posixdb_fileinfo_t info 
)

convert 'struct stat' to 'fsal_posixdb_fileinfo_t'

Parameters:
buffstat
info
Returns:

Definition at line 415 of file FSAL_POSIX/fsal_internal.c.

fsal_status_t fsal_internal_posixdb_add_entry ( fsal_posixdb_conn *  p_conn,
fsal_name_t p_filename,
fsal_posixdb_fileinfo_t p_info,
posixfsal_handle_t p_dir_handle,
posixfsal_handle_t p_new_handle 
)

Add a new entry to the database. Remove an already existing handle if it's not consistent

Definition at line 434 of file FSAL_POSIX/fsal_internal.c.

void fsal_internal_SetCredentialLifetime ( fsal_uint_t  lifetime_in)

Set credential lifetime. (For internal use in the FSAL). Set the period for thread's credential renewal.

Parameters:
lifetime_in(input): The period for thread's credential renewal.
Returns:
Nothing.

Definition at line 239 of file FSAL_POSIX/fsal_internal.c.

fsal_status_t fsal_internal_testAccess ( posixfsal_op_context_t p_context,
fsal_accessflags_t  access_type,
struct stat *  p_buffstat,
fsal_attrib_list_t p_object_attributes 
)

test the access to a file knowing its POSIX attributes (struct stat) OR its FSAL attributes (fsal_attrib_list_t).

Definition at line 764 of file FSAL_POSIX/fsal_internal.c.

void ReleaseTokenFSCall ( )

Definition at line 258 of file FSAL_POSIX/fsal_internal.c.

void TakeTokenFSCall ( )

Used to limit the number of simultaneous calls to Filesystem.

Definition at line 247 of file FSAL_POSIX/fsal_internal.c.


Variable Documentation

Definition at line 33 of file FSAL_POSIX/fsal_internal.c.

Definition at line 39 of file FSAL_POSIX/fsal_internal.c.

Definition at line 40 of file FSAL_POSIX/fsal_internal.c.

Definition at line 77 of file FSAL_POSIX/fsal_internal.c.