nfs-ganesha 1.4

fsal_types.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Copyright CEA/DAM/DIF  (2008)
00005  * contributeur : Philippe DENIEL   philippe.deniel@cea.fr
00006  *                Thomas LEIBOVICI  thomas.leibovici@cea.fr
00007  *
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 3 of the License, or (at your option) any later version.
00013  * 
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  * 
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  * 
00023  * ---------------------------------------
00024  */
00025 
00035 #ifndef _FSAL_TYPES_SPECIFIC_H
00036 #define _FSAL_TYPES_SPECIFIC_H
00037 
00038 /* >> write here the includes your need for your filesystem << */
00039 
00040   /* Change bellow the label of your filesystem configuration
00041    * section in the GANESHA's configuration file.
00042    */
00043 # define CONF_LABEL_FS_SPECIFIC   "TEMPLATE"
00044 
00045 #include <sys/types.h>
00046 #include <sys/param.h>
00047 #include "config_parsing.h"
00048 #include "err_fsal.h"
00049 
00050   /* In this section, you must define your own FSAL internal types.
00051    */
00052 
00055 typedef struct fsal_name__
00056 {
00057   char name[FSAL_MAX_NAME_LEN];
00058   unsigned int len;
00059 } fsal_name_t;
00060 
00063 typedef struct fsal_path__
00064 {
00065   char path[FSAL_MAX_PATH_LEN];
00066   unsigned int len;
00067 } fsal_path_t;
00068 
00069 static fsal_name_t FSAL_DOT = { ".", 1 };
00070 static fsal_name_t FSAL_DOT_DOT = { "..", 2 };
00071 
00072   /* some void types for this template... */
00073 
00074 typedef struct fsal_handle__
00075 {
00076   int object_identifier;
00077   fsal_nodetype_t object_type_reminder;
00078 
00079 } fsal_handle_t;
00080 
00081 typedef struct fsal_export_context__
00082 {
00083   fsal_staticfsinfo_t * fe_static_fs_info;     /* Must be the first entry in this structure */
00084 
00085   int filesystem_id;
00086   fsal_handle_t root_handle;
00087   char server_name[256];
00088   int default_cos;
00089 
00090 } fsal_export_context_t;
00091 
00092 #define FSAL_EXPORT_CONTEXT_SPECIFIC( pexport_context ) (uint64_t)(FSAL_Handle_to_RBTIndex( &(pexport_context->root_handle), 0 ) )
00093 
00094 typedef struct fsal_op_context__
00095 {
00096   fsal_export_context_t *export_context;        /* Must be the first entry in this structure */
00097 
00098   struct user_credentials credential;
00099   int thread_connect_array[32];
00100 
00101 } fsal_op_context_t;
00102 
00103 #define FSAL_OP_CONTEXT_TO_UID( pcontext ) ( pcontext->credential.user )
00104 #define FSAL_OP_CONTEXT_TO_GID( pcontext ) ( pcontext->credential.group )
00105 
00106 typedef int fsal_dir_t;
00107 typedef int fsal_file_t;
00108 
00109 //# define FSAL_FILENO(_f) fileno(_f)
00110 
00111 typedef int fsal_cookie_t;
00112 
00113 #define FSAL_READDIR_FROM_BEGINNING 0
00114 
00115 typedef struct fs_specific_initinfo__
00116 {
00117   int parameter1;
00118   char parameter2[256];
00119   int parameter3;
00120 
00121 } fs_specific_initinfo_t;
00122 
00123 #endif                          /* _FSAL_TYPES_SPECIFIC_H */