nfs-ganesha 1.4
|
#include <strings.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#include <time.h>
#include <ctype.h>
#include <string.h>
#include <pwd.h>
#include "fsal.h"
#include "log.h"
#include "err_ghost_fs.h"
#include "config_parsing.h"
#include "cmd_tools.h"
#include "commands.h"
#include "Getopt.h"
#include "abstract_mem.h"
Go to the source code of this file.
Classes | |
struct | cmdfsal_thr_info__ |
Defines | |
#define | READDIR_SIZE 10 |
#define | MAX_GRPS 128 |
#define | MAX_CAT_SIZE (1024*1024) |
Typedefs | |
typedef struct cmdfsal_thr_info__ | cmdfsal_thr_info_t |
Functions | |
int | nfs_get_fsalpathlib_conf (char *configPath, char *PathLib) |
cmdfsal_thr_info_t * | GetFSALCmdContext () |
int | Init_Thread_Context (FILE *output, cmdfsal_thr_info_t *context, int flag_v) |
void | fsal_layer_SetLogLevel (int log_lvl) |
int | fsal_init (char *filename, int flag_v, FILE *output) |
int | fn_fsal_init_fs (int argc, char **argv, FILE *output) |
int | fn_fsal_pwd (int argc, char **argv, FILE *output) |
int | solvepath (char *io_global_path, int size_global_path, char *i_spec_path, fsal_handle_t i_current_handle, fsal_handle_t *new_handle, FILE *output) |
int | fn_fsal_cd (int argc, char **argv, FILE *output) |
int | fn_fsal_stat (int argc, char **argv, FILE *output) |
int | fn_fsal_lsxattrs (int argc, char **argv, FILE *output) |
int | fn_fsal_getxattr (int argc, char **argv, FILE *output) |
int | fn_fsal_ls (int argc, char **argv, FILE *output) |
int | fn_fsal_callstat (int argc, char **argv, FILE *output) |
int | fn_fsal_su (int argc, char **argv, FILE *output) |
int | fn_fsal_unlink (int argc, char **argv, FILE *output) |
int | fn_fsal_mkdir (int argc, char **argv, FILE *output) |
int | fn_fsal_rename (int argc, char **argv, FILE *output) |
int | fn_fsal_ln (int argc, char **argv, FILE *output) |
int | fn_fsal_hardlink (int argc, char **argv, FILE *output) |
int | fn_fsal_create (int argc, char **argv, FILE *output) |
int | fn_fsal_setattr (int argc, char **argv, FILE *output) |
int | fn_fsal_access (int argc, char **argv, FILE *output) |
int | fn_fsal_truncate (int argc, char **argv, FILE *output) |
int | fn_fsal_open_byname (int argc, char **argv, FILE *output) |
int | fn_fsal_open (int argc, char **argv, FILE *output) |
int | fn_fsal_open_byfileid (int argc, char **argv, FILE *output) |
int | fn_fsal_read (int argc, char **argv, FILE *output) |
int | fn_fsal_write (int argc, char **argv, FILE *output) |
int | fn_fsal_close (int argc, char **argv, FILE *output) |
int | fn_fsal_close_byfileid (int argc, char **argv, FILE *output) |
int | fn_fsal_cat (int argc, char **argv, FILE *output) |
int | fn_fsal_rcp (int argc, char **argv, FILE *output) |
int | fn_fsal_cross (int argc, char **argv, FILE *output) |
int | fn_fsal_handle (int argc, char **argv, FILE *output) |
int | fn_fsal_handlecmp (int argc, char **argv, FILE *output) |
#define MAX_CAT_SIZE (1024*1024) |
#define MAX_GRPS 128 |
#define READDIR_SIZE 10 |
typedef struct cmdfsal_thr_info__ cmdfsal_thr_info_t |
int fn_fsal_access | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
perform an access command. syntax: access [-A] [F][R][W][X] <file> example: access toto FRX
Definition at line 3223 of file commands_FSAL.c.
int fn_fsal_callstat | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
display statistics about FSAL calls.
Definition at line 1856 of file commands_FSAL.c.
int fn_fsal_cat | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that prints a file to screen. cat [-f] <path>
Definition at line 5264 of file commands_FSAL.c.
int fn_fsal_cd | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
change current path
Definition at line 908 of file commands_FSAL.c.
int fn_fsal_close | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that closes a file. close
Definition at line 5134 of file commands_FSAL.c.
int fn_fsal_close_byfileid | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that closes a file. close
Definition at line 5199 of file commands_FSAL.c.
int fn_fsal_create | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed an create command.
Definition at line 2828 of file commands_FSAL.c.
int fn_fsal_cross | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
change current path
Definition at line 5642 of file commands_FSAL.c.
int fn_fsal_getxattr | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
display an extended attribute.
Definition at line 1287 of file commands_FSAL.c.
int fn_fsal_handle | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Digest/expand a FSAL HANDLE
Definition at line 5727 of file commands_FSAL.c.
int fn_fsal_handlecmp | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
compare 2 handles.
Definition at line 5875 of file commands_FSAL.c.
int fn_fsal_hardlink | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed a hardlink command.
Definition at line 2667 of file commands_FSAL.c.
int fn_fsal_init_fs | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed an init_fs command.
Definition at line 621 of file commands_FSAL.c.
int fn_fsal_ln | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed an ln command.
Definition at line 2499 of file commands_FSAL.c.
int fn_fsal_ls | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed an ls command.
Definition at line 1537 of file commands_FSAL.c.
int fn_fsal_lsxattrs | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
list extended attributes.
Definition at line 1142 of file commands_FSAL.c.
int fn_fsal_mkdir | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed an mkdir command.
Definition at line 2137 of file commands_FSAL.c.
int fn_fsal_open | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that opens a file using specific flags. open <path> [ rwat ]
Definition at line 3827 of file commands_FSAL.c.
int fn_fsal_open_byfileid | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that opens a file using specific flags. open <path> [ rwat ]
Definition at line 4032 of file commands_FSAL.c.
int fn_fsal_open_byname | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that opens a file using specific flags, but using FSAL_open_by_name. open <path> [ rwat ]
Definition at line 3621 of file commands_FSAL.c.
int fn_fsal_pwd | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
prints current path
Definition at line 697 of file commands_FSAL.c.
int fn_fsal_rcp | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that copy a file from/to the local filesystem. rcp [-h] -r|-w <fsal_path> <local_path>
Definition at line 5437 of file commands_FSAL.c.
int fn_fsal_read | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that reads data from an opened file.
Definition at line 4241 of file commands_FSAL.c.
int fn_fsal_rename | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed a rename command.
Definition at line 2321 of file commands_FSAL.c.
int fn_fsal_setattr | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
change file attributes.
Definition at line 3026 of file commands_FSAL.c.
int fn_fsal_stat | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed a stat command.
Definition at line 1004 of file commands_FSAL.c.
int fn_fsal_su | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
change thread contexte.
Definition at line 1901 of file commands_FSAL.c.
int fn_fsal_truncate | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed a truncate command.
Definition at line 3484 of file commands_FSAL.c.
int fn_fsal_unlink | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
proceed an unlink command.
Definition at line 2007 of file commands_FSAL.c.
int fn_fsal_write | ( | int | argc, |
char ** | argv, | ||
FILE * | output | ||
) |
Command that writes data to an opened file.
Usage: write [-h][-v] [ -s <seek_type>,<offset> ] [-N <nb_times>] -A <ascii_string> write [-h][-v] [ -s <seek_type>,<offset> ] [-N <nb_times>] -X <hexa_data> Where: <seek_type> can be: SET, CUR, END <offset> is a signed number of bytes. <nb_times> is the number of times we write the expression into the file.
<ascii_string> is a string to be written to file. Note that the null terminating character of is also written to file. or <hexa_data> is a data represented in hexadecimal format, that is to be written to file.
Examples:
For writing 10 times the null terminated string "hello world" at the end of the file: write -s END,0 -N 10 -A "hello world"
For overwriting the beginning of the file with the pattern 0xA1267AEF31254ADE repeated twice: write -s SET,0 -N 2 -X "A1267AEF31254ADE"
Definition at line 4689 of file commands_FSAL.c.
int fsal_init | ( | char * | filename, |
int | flag_v, | ||
FILE * | output | ||
) |
Definition at line 471 of file commands_FSAL.c.
void fsal_layer_SetLogLevel | ( | int | log_lvl | ) |
Definition at line 433 of file commands_FSAL.c.
cmdfsal_thr_info_t* GetFSALCmdContext | ( | ) |
GetFSALCmdContext : manages pthread_keys.
Definition at line 292 of file commands_FSAL.c.
int Init_Thread_Context | ( | FILE * | output, |
cmdfsal_thr_info_t * | context, | ||
int | flag_v | ||
) |
Initialize thread specific FSAL environment.
Definition at line 341 of file commands_FSAL.c.
int nfs_get_fsalpathlib_conf | ( | char * | configPath, |
char * | PathLib | ||
) |
int solvepath | ( | char * | io_global_path, |
int | size_global_path, | ||
char * | i_spec_path, | ||
fsal_handle_t | i_current_handle, | ||
fsal_handle_t * | new_handle, | ||
FILE * | output | ||
) |
Definition at line 738 of file commands_FSAL.c.