nfs-ganesha 1.4
Defines | Functions | Variables

fsal_internal.c File Reference

#include <sys/ioctl.h>
#include "fsal.h"
#include "fsal_internal.h"
#include "SemN.h"
#include "fsal_convert.h"
#include <libgen.h>
#include "abstract_mem.h"
#include <pthread.h>
#include <string.h>
#include <sys/fsuid.h>
#include "gpfs.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, fs_specific_initinfo_t *fs_specific_info)
fsal_status_t fsal_internal_handle2fd (fsal_op_context_t *p_context, fsal_handle_t *phandle, int *pfd, int oflags)
fsal_status_t fsal_internal_handle2fd_at (int dirfd, fsal_handle_t *phandle, int *pfd, int oflags)
fsal_status_t fsal_internal_get_handle (fsal_op_context_t *p_context, fsal_path_t *p_fsalpath, fsal_handle_t *p_handle)
fsal_status_t fsal_internal_get_handle_at (int dfd, fsal_name_t *p_fsalname, fsal_handle_t *p_handle)
fsal_status_t fsal_internal_get_fh (fsal_op_context_t *p_context, fsal_handle_t *p_dir_fh, fsal_name_t *p_fsalname, fsal_handle_t *p_out_fh)
fsal_status_t fsal_internal_fd2handle (int fd, fsal_handle_t *handle)
fsal_status_t fsal_internal_link_at (int srcfd, int dirfd, char *name)
fsal_status_t fsal_internal_link_fh (fsal_op_context_t *p_context, fsal_handle_t *p_target_handle, fsal_handle_t *p_dir_handle, fsal_name_t *p_link_name)
fsal_status_t fsal_internal_stat_name (fsal_op_context_t *p_context, fsal_handle_t *p_dir_handle, fsal_name_t *p_stat_name, struct stat *buf)
fsal_status_t fsal_internal_unlink (fsal_op_context_t *p_context, fsal_handle_t *p_dir_handle, fsal_name_t *p_stat_name, struct stat *buf)
fsal_status_t fsal_internal_create (fsal_op_context_t *p_context, fsal_handle_t *p_dir_handle, fsal_name_t *p_stat_name, mode_t mode, dev_t dev, fsal_handle_t *p_new_handle, struct stat *buf)
fsal_status_t fsal_internal_rename_fh (fsal_op_context_t *p_context, fsal_handle_t *p_old_handle, fsal_handle_t *p_new_handle, fsal_name_t *p_old_name, fsal_name_t *p_new_name)
fsal_status_t fsal_readlink_by_handle (fsal_op_context_t *p_context, fsal_handle_t *p_handle, char *__buf, int maxlen)
fsal_status_t fsal_internal_testAccess (fsal_op_context_t *p_context, fsal_accessflags_t access_type, struct stat *p_buffstat, fsal_attrib_list_t *p_object_attributes)
fsal_status_t fsal_internal_access (fsal_op_context_t *p_context, fsal_handle_t *p_handle, fsal_accessflags_t access_type, fsal_attrib_list_t *p_object_attributes)
fsal_status_t fsal_stat_by_handle (fsal_op_context_t *p_context, fsal_handle_t *p_handle, struct stat *buf)
fsal_status_t fsal_get_xstat_by_handle (fsal_op_context_t *p_context, fsal_handle_t *p_handle, gpfsfsal_xstat_t *p_buffxstat)
fsal_status_t fsal_set_xstat_by_handle (fsal_op_context_t *p_context, fsal_handle_t *p_handle, int attr_valid, int attr_changed, gpfsfsal_xstat_t *p_buffxstat)
fsal_status_t fsal_trucate_by_handle (fsal_op_context_t *p_context, fsal_handle_t *p_handle, u_int64_t size)
fsal_status_t fsal_check_access_by_mode (fsal_op_context_t *p_context, fsal_accessflags_t access_type, struct stat *p_buffstat)

Variables

fsal_uint_t CredentialLifetime = 3600
fsal_staticfsinfo_t global_fs_info
semaphore_t sem_fs_calls

Define Documentation

#define FSAL_INTERNAL_C

Definition at line 36 of file FSAL_GPFS/fsal_internal.c.


Function Documentation

fsal_status_t fsal_check_access_by_mode ( fsal_op_context_t p_context,
fsal_accessflags_t  access_type,
struct stat *  p_buffstat 
)

Definition at line 1244 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_get_xstat_by_handle ( fsal_op_context_t p_context,
fsal_handle_t p_handle,
gpfsfsal_xstat_t p_buffxstat 
)

Definition at line 1115 of file FSAL_GPFS/fsal_internal.c.

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 162 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_access ( fsal_op_context_t p_context,
fsal_handle_t p_handle,
fsal_accessflags_t  access_type,
fsal_attrib_list_t p_object_attributes 
)

Definition at line 1032 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_create ( fsal_op_context_t p_context,
fsal_handle_t p_dir_handle,
fsal_name_t p_stat_name,
mode_t  mode,
dev_t  dev,
fsal_handle_t p_new_handle,
struct stat *  buf 
)

fsal_internal_create: Create a file/directory by name

Parameters:
p_context(input): Pointer to current context. Used to get export root fd.
p_dir_handle(input): file handle of directory
name(input): name to create
mode& dev (input): file type and dev for mknode
fh& stat (outut): file handle of new file and attributes
Returns:
status of operation

Definition at line 871 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_fd2handle ( int  fd,
fsal_handle_t handle 
)

fsal_internal_fd2handle: convert an fd to a handle

Parameters:
fd(input): Open file descriptor for target file
p_handle(output): The handle that is found and returned
Returns:
status of operation

Definition at line 663 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_get_fh ( fsal_op_context_t p_context,
fsal_handle_t p_dir_fh,
fsal_name_t p_fsalname,
fsal_handle_t p_out_fh 
)

fsal_internal_get_handle: Create a handle from a directory handle and filename

Parameters:
pcontext(input): A context pointer for the root of the current export
p_dir_handle(input): The handle for the parent directory
p_fsalname(input): Name of the file
p_handle(output): The handle that is found and returned
Returns:
status of operation

Definition at line 616 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_get_handle ( fsal_op_context_t p_context,
fsal_path_t p_fsalpath,
fsal_handle_t p_handle 
)

fsal_internal_get_handle: Create a handle from a file path

Parameters:
pcontext(input): A context pointer for the root of the current export
p_fsalpath(input): Full path to the file
p_handle(output): The handle that is found and returned
Returns:
status of operation

Definition at line 524 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_get_handle_at ( int  dfd,
fsal_name_t p_fsalname,
fsal_handle_t p_handle 
)

fsal_internal_get_handle_at: Create a handle from a directory pointer and filename

Parameters:
dfd(input): Open directory handle
p_fsalname(input): Name of the file
p_handle(output): The handle that is found and returned
Returns:
status of operation

Definition at line 569 of file FSAL_GPFS/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 245 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_handle2fd ( fsal_op_context_t p_context,
fsal_handle_t phandle,
int *  pfd,
int  oflags 
)

fsal_internal_handle2fd: Open a file by handle within an export.

Parameters:
p_context(input): Pointer to current context. Used to get export root fd.
phandle(input): Opaque filehandle
pfd(output): File descriptor openned by the function
oflags(input): Flags to open the file with
Returns:
status of operation

Definition at line 451 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_handle2fd_at ( int  dirfd,
fsal_handle_t phandle,
int *  pfd,
int  oflags 
)

fsal_internal_handle2fd_at: Open a file by handle from in an open directory

Parameters:
dirfd(input): Open file descriptor of parent directory
phandle(input): Opaque filehandle
pfd(output): File descriptor openned by the function
oflags(input): Flags to open the file with
Returns:
status of operation

Definition at line 486 of file FSAL_GPFS/fsal_internal.c.

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

This function initializes shared variables of the FSAL.

Definition at line 340 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_link_at ( int  srcfd,
int  dirfd,
char *  name 
)

fsal_internal_link_at: Create a link based on a file descriptor, dirfd, and new name

Parameters:
srcfd(input): file descriptor of source file
dirfd(input): file descriptor of target directory
name(input): name for the new file
Returns:
status of operation

Definition at line 705 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_link_fh ( fsal_op_context_t p_context,
fsal_handle_t p_target_handle,
fsal_handle_t p_dir_handle,
fsal_name_t p_link_name 
)

fsal_internal_link_fh: Create a link based on a file fh, dir fh, and new name

Parameters:
p_context(input): Pointer to current context. Used to get export root fd.
p_target_handle(input): file handle of target file
p_dir_handle(input): file handle of source directory
name(input): name for the new file
Returns:
status of operation

Definition at line 741 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_rename_fh ( fsal_op_context_t p_context,
fsal_handle_t p_old_handle,
fsal_handle_t p_new_handle,
fsal_name_t p_old_name,
fsal_name_t p_new_name 
)

fsal_internal_rename_fh: Rename old file name to new name

Parameters:
p_context(input): Pointer to current context. Used to get export root fd.
p_old_handle(input): file handle of old file
p_new_handle(input): file handle of new directory
name(input): name for the old file
name(input): name for the new file
Returns:
status of operation

Definition at line 924 of file FSAL_GPFS/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 307 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_stat_name ( fsal_op_context_t p_context,
fsal_handle_t p_dir_handle,
fsal_name_t p_stat_name,
struct stat *  buf 
)

fsal_internal_stat_name: Stat a file by name

Parameters:
p_context(input): Pointer to current context. Used to get export root fd.
p_dir_handle(input): file handle of directory
name(input): name to stat
Returns:
status of operation

Definition at line 783 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_testAccess ( fsal_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 from its POSIX attributes (struct stat) OR its FSAL attributes (fsal_attrib_list_t).

Definition at line 994 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_internal_unlink ( fsal_op_context_t p_context,
fsal_handle_t p_dir_handle,
fsal_name_t p_stat_name,
struct stat *  buf 
)

fsal_internal_unlink: Unlink a file/directory by name

Parameters:
p_context(input): Pointer to current context. Used to get export root fd.
p_dir_handle(input): file handle of directory
name(input): name to unlink
Returns:
status of operation

Definition at line 825 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_readlink_by_handle ( fsal_op_context_t p_context,
fsal_handle_t p_handle,
char *  __buf,
int  maxlen 
)

fsal_readlink_by_handle: Reads the contents of the link

Returns:
status of operation

Definition at line 967 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_set_xstat_by_handle ( fsal_op_context_t p_context,
fsal_handle_t p_handle,
int  attr_valid,
int  attr_changed,
gpfsfsal_xstat_t p_buffxstat 
)

Definition at line 1187 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_stat_by_handle ( fsal_op_context_t p_context,
fsal_handle_t p_handle,
struct stat *  buf 
)

fsal_stat_by_handle: get the stat value

Returns:
status of operation

Definition at line 1088 of file FSAL_GPFS/fsal_internal.c.

fsal_status_t fsal_trucate_by_handle ( fsal_op_context_t p_context,
fsal_handle_t p_handle,
u_int64_t  size 
)

Definition at line 1224 of file FSAL_GPFS/fsal_internal.c.

void ReleaseTokenFSCall ( )

Definition at line 326 of file FSAL_GPFS/fsal_internal.c.

void TakeTokenFSCall ( )

Used to limit the number of simultaneous calls to Filesystem.

Definition at line 315 of file FSAL_GPFS/fsal_internal.c.


Variable Documentation

Definition at line 61 of file FSAL_GPFS/fsal_internal.c.

Definition at line 67 of file FSAL_GPFS/fsal_internal.c.

Definition at line 104 of file FSAL_GPFS/fsal_internal.c.