nfs-ganesha 1.4

fsal.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  *
00005  * Copyright CEA/DAM/DIF  (2008)
00006  * contributeur : Philippe DENIEL   philippe.deniel@cea.fr
00007  *                Thomas LEIBOVICI  thomas.leibovici@cea.fr
00008  *
00009  *
00010  * This program is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 3 of the License, or (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  * ---------------------------------------
00025  */
00026 
00037 #ifndef _FSAL_H
00038 #define _FSAL_H
00039 
00040 #include <stddef.h>
00041 
00059 #ifndef __OPTIMIZE__
00060 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
00061 #else
00062 extern int __build_bug_on_failed;
00063 #define BUILD_BUG_ON(condition)                                 \
00064         do {                                                    \
00065                 ((void)sizeof(char[1 - 2*!!(condition)]));      \
00066                 if (condition) __build_bug_on_failed = 1;       \
00067         } while(0)
00068 #endif
00069 
00070 #include "nlm_list.h"
00071 /* fsal_types contains constants and type definitions for FSAL */
00072 #include "fsal_types.h"
00073 #include "common_utils.h"
00074 
00075 #ifndef _USE_SWIG
00076 
00077 /******************************************************
00078  *            Attribute mask management.
00079  ******************************************************/
00080 
00085 #define FSAL_TEST_MASK( _attrib_mask_ , _attr_const_ ) \
00086                       ( (_attrib_mask_) & (_attr_const_) )
00087 
00092 #define FSAL_SET_MASK( _attrib_mask_ , _attr_const_ ) \
00093                     ( (_attrib_mask_) |= (_attr_const_) )
00094 
00099 #define FSAL_CLEAR_MASK( _attrib_mask_ ) \
00100                     ( (_attrib_mask_) = 0LL )
00101 
00102 /******************************************************
00103  *              Initialization tools.
00104  ******************************************************/
00105 
00120 #define FSAL_SET_INIT_INFO( _common_info_struct_ , _field_name_ ,   \
00121                                     _field_behavior_ , _value_ ) do \
00122            {                                                        \
00123              _common_info_struct_.behaviors._field_name_ = _field_behavior_ ;\
00124              if ( _field_behavior_ != FSAL_INIT_FS_DEFAULT )        \
00125                _common_info_struct_.values._field_name_ = _value_ ; \
00126            } while (0)
00127 
00133 #define FSAL_SET_INIT_DEFAULT( _common_info_struct_ , _field_name_ ) \
00134         do {                                                         \
00135              _common_info_struct_.behaviors._field_name_             \
00136                 = FSAL_INIT_FS_DEFAULT ;                             \
00137            } while (0)
00138 
00141 #define FSAL_SET_COOKIE_BEGINNING( cookie ) memset( (char *)&cookie, 0, sizeof( fsal_cookie_t ) )
00142 
00146 #define FSAL_SET_COOKIE_BY_OFFSET( __cookie, __offset )  \
00147    memcpy( (char *)&(__cookie.data), (char *)&__offset, sizeof( uint64_t ) ) 
00148 
00149 #define FSAL_SET_POFFSET_BY_COOKIE( __cookie, __poffset )  \
00150     memcpy( (char *)__poffset, (char *)&(__cookie.data), sizeof( uint64_t ) ) 
00151 
00152 #define FSAL_GET_EXP_CTX( popctx ) (fsal_export_context_t *)(popctx->export_context)
00153 
00161 fsal_status_t FSAL_SetDefault_FSAL_parameter(fsal_parameter_t * out_parameter);
00162 
00163 fsal_status_t FSAL_SetDefault_FS_common_parameter(fsal_parameter_t * out_parameter);
00164 
00165 fsal_status_t FSAL_SetDefault_FS_specific_parameter(fsal_parameter_t * out_parameter);
00166 
00187 fsal_status_t FSAL_load_FSAL_parameter_from_conf(config_file_t in_config,
00188                                                  fsal_parameter_t * out_parameter);
00189 
00190 fsal_status_t FSAL_load_FS_common_parameter_from_conf(config_file_t in_config,
00191                                                       fsal_parameter_t * out_parameter);
00192 fsal_status_t FSAL_load_FS_specific_parameter_from_conf(config_file_t in_config,
00193                                                         fsal_parameter_t * out_parameter);
00194 
00199 fsal_status_t FSAL_Init(fsal_parameter_t * init_info    /* IN */
00200     );
00201 
00202 /******************************************************
00203  *              FSAL Returns macros
00204  ******************************************************/
00205 
00212 #define Return( _code_, _minor_ , _f_ ) do {                                   \
00213                fsal_status_t _struct_status_ = FSAL_STATUS_NO_ERROR ;          \
00214                (_struct_status_).major = (_code_) ;                            \
00215                (_struct_status_).minor = (_minor_) ;                           \
00216                fsal_increment_nbcall( _f_,_struct_status_ );                   \
00217                if(isDebug(COMPONENT_FSAL))                                     \
00218                  {                                                             \
00219                    if((_struct_status_).major != ERR_FSAL_NO_ERROR)            \
00220                      LogDebug(COMPONENT_FSAL,                                  \
00221                        "%s returns (%s, %s, %d)",fsal_function_names[_f_],     \
00222                        label_fsal_err(_code_), msg_fsal_err(_code_), _minor_); \
00223                    else                                                        \
00224                      LogFullDebug(COMPONENT_FSAL,                              \
00225                        "%s returns (%s, %s, %d)",fsal_function_names[_f_],     \
00226                        label_fsal_err(_code_), msg_fsal_err(_code_), _minor_); \
00227                  }                                                             \
00228                return (_struct_status_);                                       \
00229               } while(0)
00230 
00231 #define ReturnStatus( _st_, _f_ )       Return( (_st_).major, (_st_).minor, _f_ )
00232 
00237 #define ReturnCode( _code_, _minor_ ) do {                               \
00238                fsal_status_t _struct_status_ = FSAL_STATUS_NO_ERROR ;\
00239                (_struct_status_).major = (_code_) ;          \
00240                (_struct_status_).minor = (_minor_) ;         \
00241                return (_struct_status_);                     \
00242               } while(0)
00243 
00244 /******************************************************
00245  *              FSAL Errors handling.
00246  ******************************************************/
00247 
00254 #define FSAL_IS_ERROR( _status_ ) \
00255         ( ! ( ( _status_ ).major == ERR_FSAL_NO_ERROR ) )
00256 
00260 fsal_boolean_t fsal_is_retryable(fsal_status_t status);
00261 
00262 #endif                          /* ! _USE_SWIG */
00263 
00264 /******************************************************
00265  *              FSAL Strings handling.
00266  ******************************************************/
00267 
00268 fsal_status_t FSAL_str2name(const char *string, /* IN */
00269                             fsal_mdsize_t in_str_maxlen,        /* IN */
00270                             fsal_name_t * name  /* OUT */
00271     );
00272 
00273 fsal_status_t FSAL_name2str(fsal_name_t * p_name,       /* IN */
00274                             char *string,       /* OUT */
00275                             fsal_mdsize_t out_str_maxlen        /* IN */
00276     );
00277 
00278 int FSAL_namecmp(const fsal_name_t *p_name1,
00279                  const fsal_name_t *p_name2);
00280 
00281 fsal_status_t FSAL_namecpy(fsal_name_t * p_tgt_name, fsal_name_t * p_src_name);
00282 
00283 fsal_status_t FSAL_str2path(char *string,       /* IN */
00284                             fsal_mdsize_t in_str_maxlen,        /* IN */
00285                             fsal_path_t * p_path        /* OUT */
00286     );
00287 
00288 fsal_status_t FSAL_path2str(fsal_path_t * p_path,       /* IN */
00289                             char *string,       /* OUT */
00290                             fsal_mdsize_t out_str_maxlen        /* IN */
00291     );
00292 
00293 int FSAL_pathcmp(fsal_path_t * p_path1, fsal_path_t * p_path2);
00294 
00295 fsal_status_t FSAL_pathcpy(fsal_path_t * p_tgt_path, fsal_path_t * p_src_path);
00296 
00297 #ifndef _USE_SWIG
00298 
00300 fsal_status_t FSAL_buffdesc2name(fsal_buffdesc_t * in_buf, fsal_name_t * out_name);
00301 
00302 fsal_status_t FSAL_buffdesc2path(fsal_buffdesc_t * in_buf, fsal_path_t * out_path);
00303 
00304 fsal_status_t FSAL_path2buffdesc(fsal_path_t * in_path, fsal_buffdesc_t * out_buff);
00305 
00306 fsal_status_t FSAL_name2buffdesc(fsal_name_t * in_name, fsal_buffdesc_t * out_buff);
00307 
00308 #endif                          /* ! _USE_SWIG */
00309 
00310 /* snprintmem and sscanmem are defined into common_utils */
00311 
00312 #define snprintHandle(target, tgt_size, p_handle) \
00313   do {                                                           \
00314         struct fsal_handle_desc fd = {                           \
00315                 .start = (char *)p_handle                        \
00316         };                                                       \
00317         FSAL_ExpandHandle(NULL, FSAL_DIGEST_SIZEOF, &fd);        \
00318         snprintmem(target,tgt_size,(caddr_t)p_handle,fd.len);    \
00319   } while(0)
00320 
00321 #define snprintCookie(target, tgt_size, p_cookie) \
00322   snprintmem(target,tgt_size,(caddr_t)p_cookie,sizeof(fsal_cookie_t))
00323 
00324 #define snprintAttrs(target, tgt_size, p_attrs) \
00325   snprintmem(target,tgt_size,(caddr_t)p_attrs,sizeof(fsal_attrib_list_t))
00326 
00327 #define sscanHandle(p_handle,str_source) \
00328   sscanmem( (caddr_t)p_handle,sizeof(fsal_handle_t),str_source )
00329 
00330 #define sscanCookie(p_cookie,str_source) \
00331   sscanmem( (caddr_t)p_cookie,sizeof(fsal_cookie_t),str_source )
00332 
00333 #define sscanAttrs(p_attrs,str_source) \
00334   sscanmem( (caddr_t)p_attrs,sizeof(fsal_attrib_list_t),str_source )
00335 
00336 /******************************************************
00337  *              FSAL handles management.
00338  ******************************************************/
00339 
00344 int FSAL_handlecmp(fsal_handle_t * handle1, fsal_handle_t * handle2,
00345                    fsal_status_t * status);
00346 
00347 #ifndef _USE_SWIG
00348 
00363 unsigned int FSAL_Handle_to_HashIndex(fsal_handle_t * p_handle,
00364                                       unsigned int cookie,
00365                                       unsigned int alphabet_len, unsigned int index_size);
00366 
00379 unsigned int FSAL_Handle_to_RBTIndex(fsal_handle_t * p_handle, unsigned int cookie);
00380 
00398 unsigned int FSAL_Handle_to_Hash_both(fsal_handle_t * p_handle, unsigned int cookie, unsigned int alphabet_len, 
00399                                       unsigned int index_size, unsigned int * phashval, unsigned int *prbtval ) ;
00400 
00406 fsal_status_t FSAL_DigestHandle(fsal_export_context_t * p_expcontext,   /* IN */
00407                                 fsal_digesttype_t output_type,  /* IN */
00408                                 fsal_handle_t * in_fsal_handle, /* IN */
00409                                 struct fsal_handle_desc *fh_desc        /* IN/OUT */
00410     );
00411 
00416 fsal_status_t FSAL_ExpandHandle(fsal_export_context_t * p_expcontext,   /* IN */
00417                                 fsal_digesttype_t in_type,      /* IN */
00418                                 struct fsal_handle_desc *fh_desc /* IN/OUT */
00419     );
00420 
00425 fsal_status_t FSAL_CleanObjectResources(fsal_handle_t * in_fsal_handle);        /* IN */
00426 
00427 /******************************************************
00428  *              FSAL directory cookies
00429  ******************************************************/
00430 
00445 fsal_status_t FSAL_cookie_to_uint64(fsal_handle_t * handle,
00446                                     fsal_op_context_t * context,
00447                                     fsal_cookie_t * cookie,
00448                                     uint64_t *data);
00463 fsal_status_t FSAL_uint64_to_cookie(fsal_handle_t * handle,
00464                                     fsal_op_context_t * context,
00465                                     uint64_t * uint64,
00466                                     fsal_cookie_t * cookie);
00467 
00480 fsal_status_t FSAL_get_cookieverf(fsal_handle_t * handle,
00481                                   fsal_op_context_t * context,
00482                                   uint64_t * verf);
00483 
00484 /******************************************************
00485  *              FSAL context management.
00486  ******************************************************/
00487 
00488 fsal_status_t FSAL_BuildExportContext(fsal_export_context_t * p_export_context, /* OUT */
00489                                       fsal_path_t * p_export_path,      /* IN */
00490                                       char *fs_specific_options /* IN */
00491     );
00492 
00493 
00494 fsal_status_t FSAL_CleanUpExportContext(fsal_export_context_t * p_export_context);
00495 
00496 fsal_status_t FSAL_InitClientContext(fsal_op_context_t * p_thr_context  /* OUT  */
00497     );
00498 
00499 fsal_status_t FSAL_GetClientContext(fsal_op_context_t * p_thr_context,  /* IN/OUT  */
00500                                     fsal_export_context_t * p_export_context,   /* IN */
00501                                     fsal_uid_t uid,     /* IN */
00502                                     fsal_gid_t gid,     /* IN */
00503                                     fsal_gid_t * alt_groups,    /* IN */
00504                                     fsal_count_t nb_alt_groups  /* IN */
00505     );
00506 
00507 #endif                          /* ! _USE_SWIG */
00508 
00509 /******************************************************
00510  *              Common Filesystem calls.
00511  ******************************************************/
00512 
00513 fsal_status_t FSAL_lookup(fsal_handle_t * parent_directory_handle,      /* IN */
00514                           fsal_name_t * p_filename,     /* IN */
00515                           fsal_op_context_t * p_context,        /* IN */
00516                           fsal_handle_t * object_handle,        /* OUT */
00517                           fsal_attrib_list_t * object_attributes        /* [ IN/OUT ] */
00518     );
00519 
00520 fsal_status_t FSAL_lookupPath(fsal_path_t * p_path,     /* IN */
00521                               fsal_op_context_t * p_context,    /* IN */
00522                               fsal_handle_t * object_handle,    /* OUT */
00523                               fsal_attrib_list_t * object_attributes    /* [ IN/OUT ] */
00524     );
00525 
00526 fsal_status_t FSAL_lookupJunction(fsal_handle_t * p_junction_handle,    /* IN */
00527                                   fsal_op_context_t * p_context,        /* IN */
00528                                   fsal_handle_t * p_fsoot_handle,       /* OUT */
00529                                   fsal_attrib_list_t * p_fsroot_attributes      /* [ IN/OUT ] */
00530     );
00531 
00532 fsal_status_t FSAL_access(fsal_handle_t * object_handle,        /* IN */
00533                           fsal_op_context_t * p_context,        /* IN */
00534                           fsal_accessflags_t access_type,       /* IN */
00535                           fsal_attrib_list_t * object_attributes        /* [ IN/OUT ] */
00536     );
00537 
00550 fsal_status_t FSAL_test_access(fsal_op_context_t * p_context,   /* IN */
00551                                fsal_accessflags_t access_type,  /* IN */
00552                                fsal_attrib_list_t * object_attributes   /* IN */
00553     );
00554 
00555 fsal_status_t FSAL_create(fsal_handle_t * parent_directory_handle,      /* IN */
00556                           fsal_name_t * p_filename,     /* IN */
00557                           fsal_op_context_t * p_context,        /* IN */
00558                           fsal_accessmode_t accessmode, /* IN */
00559                           fsal_handle_t * object_handle,        /* OUT */
00560                           fsal_attrib_list_t * object_attributes        /* [ IN/OUT ] */
00561     );
00562 
00563 fsal_status_t FSAL_mkdir(fsal_handle_t * parent_directory_handle,       /* IN */
00564                          fsal_name_t * p_dirname,       /* IN */
00565                          fsal_op_context_t * p_context, /* IN */
00566                          fsal_accessmode_t accessmode,  /* IN */
00567                          fsal_handle_t * object_handle, /* OUT */
00568                          fsal_attrib_list_t * object_attributes /* [ IN/OUT ] */
00569     );
00570 
00571 fsal_status_t FSAL_truncate(fsal_handle_t * filehandle, /* IN */
00572                             fsal_op_context_t * p_context,      /* IN */
00573                             fsal_size_t length, /* IN */
00574                             fsal_file_t * file_descriptor,      /* INOUT */
00575                             fsal_attrib_list_t * object_attributes      /* [ IN/OUT ] */
00576     );
00577 
00578 fsal_status_t FSAL_getattrs(fsal_handle_t * filehandle, /* IN */
00579                             fsal_op_context_t * p_context,      /* IN */
00580                             fsal_attrib_list_t * object_attributes      /* IN/OUT */
00581     );
00582 
00583 fsal_status_t FSAL_getattrs_descriptor(fsal_file_t * p_file_descriptor,         /* IN */
00584                                        fsal_handle_t * p_filehandle,            /* IN */
00585                                        fsal_op_context_t * p_context,           /* IN */
00586                                        fsal_attrib_list_t * p_object_attributes /* IN/OUT */
00587     );
00588 
00589 fsal_status_t FSAL_setattrs(fsal_handle_t * filehandle, /* IN */
00590                             fsal_op_context_t * p_context,      /* IN */
00591                             fsal_attrib_list_t * attrib_set,    /* IN */
00592                             fsal_attrib_list_t * object_attributes      /* [ IN/OUT ] */
00593     );
00594 
00595 fsal_status_t FSAL_getextattrs(fsal_handle_t * filehandle, /* IN */
00596                                fsal_op_context_t * p_context,      /* IN */
00597                                fsal_extattrib_list_t * object_attributes      /* IN/OUT */
00598     );
00599 
00600 fsal_status_t FSAL_link(fsal_handle_t * target_handle,  /* IN */
00601                         fsal_handle_t * dir_handle,     /* IN */
00602                         fsal_name_t * p_link_name,      /* IN */
00603                         fsal_op_context_t * p_context,  /* IN */
00604                         fsal_attrib_list_t * attributes /* [ IN/OUT ] */
00605     );
00606 
00607 fsal_status_t FSAL_opendir(fsal_handle_t * dir_handle,  /* IN */
00608                            fsal_op_context_t * p_context,       /* IN */
00609                            fsal_dir_t * dir_descriptor, /* OUT */
00610                            fsal_attrib_list_t * dir_attributes  /* [ IN/OUT ] */
00611     );
00612 
00613 fsal_status_t FSAL_readdir(fsal_dir_t * dir_descriptor, /* IN */
00614                            fsal_cookie_t start_position,        /* IN */
00615                            fsal_attrib_mask_t get_attr_mask,    /* IN */
00616                            fsal_mdsize_t buffersize,    /* IN */
00617                            fsal_dirent_t * pdirent,     /* OUT */
00618                            fsal_cookie_t * end_position,        /* OUT */
00619                            fsal_count_t * nb_entries,   /* OUT */
00620                            fsal_boolean_t * end_of_dir  /* OUT */
00621     );
00622 
00623 fsal_status_t FSAL_closedir(fsal_dir_t * dir_descriptor /* IN */
00624     );
00625 
00626 fsal_status_t FSAL_open(fsal_handle_t * filehandle,     /* IN */
00627                         fsal_op_context_t * p_context,  /* IN */
00628                         fsal_openflags_t openflags,     /* IN */
00629                         fsal_file_t * file_descriptor,  /* OUT */
00630                         fsal_attrib_list_t * file_attributes    /* [ IN/OUT ] */
00631     );
00632 
00633 fsal_status_t FSAL_open_by_name(fsal_handle_t * dirhandle,      /* IN */
00634                                 fsal_name_t * filename, /* IN */
00635                                 fsal_op_context_t * p_context,  /* IN */
00636                                 fsal_openflags_t openflags,     /* IN */
00637                                 fsal_file_t * file_descriptor,  /* OUT */
00638                                 fsal_attrib_list_t * file_attributes /* [ IN/OUT ] */ );
00639 
00640 fsal_status_t FSAL_open_by_fileid(fsal_handle_t * filehandle,   /* IN */
00641                                   fsal_u64_t fileid,    /* IN */
00642                                   fsal_op_context_t * p_context,        /* IN */
00643                                   fsal_openflags_t openflags,   /* IN */
00644                                   fsal_file_t * file_descriptor,        /* OUT */
00645                                   fsal_attrib_list_t * file_attributes /* [ IN/OUT ] */ );
00646 
00647 fsal_status_t FSAL_read(fsal_file_t * file_descriptor,  /*  IN  */
00648                         fsal_seek_t * seek_descriptor,  /* [IN] */
00649                         fsal_size_t buffer_size,        /*  IN  */
00650                         caddr_t buffer, /* OUT  */
00651                         fsal_size_t * read_amount,      /* OUT  */
00652                         fsal_boolean_t * end_of_file    /* OUT  */
00653     );
00654 
00655 fsal_status_t FSAL_write(fsal_file_t * file_descriptor, /* IN */
00656                          fsal_op_context_t * p_context,  /* IN */
00657                          fsal_seek_t * seek_descriptor, /* IN */
00658                          fsal_size_t buffer_size,       /* IN */
00659                          caddr_t buffer,        /* IN */
00660                          fsal_size_t * write_amount     /* OUT */
00661     );
00662 
00663 fsal_status_t FSAL_commit( fsal_file_t * file_descriptor, /* INOUT */
00664                          fsal_off_t    offset,  /* IN */
00665                          fsal_size_t   size );
00666 
00667 fsal_status_t FSAL_close(fsal_file_t * file_descriptor  /* IN */
00668     );
00669 
00670 fsal_status_t FSAL_close_by_fileid(fsal_file_t * file_descriptor /* IN */ ,
00671                                    fsal_u64_t fileid);
00672 
00673 fsal_status_t FSAL_readlink(fsal_handle_t * linkhandle, /* IN */
00674                             fsal_op_context_t * p_context,      /* IN */
00675                             fsal_path_t * p_link_content,       /* OUT */
00676                             fsal_attrib_list_t * link_attributes        /* [ IN/OUT ] */
00677     );
00678 
00679 fsal_status_t FSAL_symlink(fsal_handle_t * parent_directory_handle,     /* IN */
00680                            fsal_name_t * p_linkname,    /* IN */
00681                            fsal_path_t * p_linkcontent, /* IN */
00682                            fsal_op_context_t * p_context,       /* IN */
00683                            fsal_accessmode_t accessmode,        /* IN (ignored); */
00684                            fsal_handle_t * link_handle, /* OUT */
00685                            fsal_attrib_list_t * link_attributes /* [ IN/OUT ] */
00686     );
00687 
00688 fsal_status_t FSAL_rename(fsal_handle_t * old_parentdir_handle, /* IN */
00689                           fsal_name_t * p_old_name,     /* IN */
00690                           fsal_handle_t * new_parentdir_handle, /* IN */
00691                           fsal_name_t * p_new_name,     /* IN */
00692                           fsal_op_context_t * p_context,        /* IN */
00693                           fsal_attrib_list_t * src_dir_attributes,      /* [ IN/OUT ] */
00694                           fsal_attrib_list_t * tgt_dir_attributes       /* [ IN/OUT ] */
00695     );
00696 
00697 fsal_status_t FSAL_unlink(fsal_handle_t * parentdir_handle,     /* IN */
00698                           fsal_name_t * p_object_name,  /* IN */
00699                           fsal_op_context_t * p_context,        /* IN */
00700                           fsal_attrib_list_t * parentdir_attributes     /* [IN/OUT ] */
00701     );
00702 
00703 fsal_status_t FSAL_mknode(fsal_handle_t * parentdir_handle,     /* IN */
00704                           fsal_name_t * p_node_name,    /* IN */
00705                           fsal_op_context_t * p_context,        /* IN */
00706                           fsal_accessmode_t accessmode, /* IN */
00707                           fsal_nodetype_t nodetype,     /* IN */
00708                           fsal_dev_t * dev,     /* IN */
00709                           fsal_handle_t * p_object_handle,      /* OUT */
00710                           fsal_attrib_list_t * node_attributes  /* [ IN/OUT ] */
00711     );
00712 
00713 fsal_status_t FSAL_dynamic_fsinfo(fsal_handle_t * filehandle,   /* IN */
00714                                   fsal_op_context_t * p_context,        /* IN */
00715                                   fsal_dynamicfsinfo_t * dynamicinfo    /* OUT */
00716     );
00717 
00718 fsal_status_t FSAL_rcp(fsal_handle_t * filehandle,      /* IN */
00719                        fsal_op_context_t * p_context,   /* IN */
00720                        fsal_path_t * p_local_path,      /* IN */
00721                        fsal_rcpflag_t transfer_opt      /* IN */
00722     );
00723 
00724 fsal_status_t FSAL_lock_op( fsal_file_t       * p_file_descriptor,   /* IN */
00725                             fsal_handle_t     * p_filehandle,        /* IN */
00726                             fsal_op_context_t * p_context,           /* IN */
00727                             void              * p_owner,             /* IN (opaque to FSAL) */
00728                             fsal_lock_op_t      lock_op,             /* IN */
00729                             fsal_lock_param_t   request_lock,        /* IN */
00730                             fsal_lock_param_t * conflicting_lock     /* OUT */
00731                             );
00732 
00733 fsal_status_t FSAL_share_op( fsal_file_t       * p_file_descriptor,   /* IN */
00734                              fsal_handle_t     * p_filehandle,        /* IN */
00735                              fsal_op_context_t * p_context,           /* IN */
00736                              void              * p_owner,             /* IN (opaque to FSAL) */
00737                              fsal_share_param_t  request_share        /* IN */
00738                              );
00739 
00740 /* FSAL_UP functions */
00741 /* These structs are defined here because including fsal_up.h causes
00742  * preprocessor issues. */
00743 #ifdef _USE_FSAL_UP
00744 struct fsal_up_event_bus_filter_t_;
00745 struct fsal_up_event_t_;
00746 struct fsal_up_event_bus_parameter_t_;
00747 struct fsal_up_event_bus_context_t_;
00748 fsal_status_t FSAL_UP_Init(struct fsal_up_event_bus_parameter_t_ * pebparam,      /* IN */
00749                            struct fsal_up_event_bus_context_t_ * pupebcontext     /* OUT */
00750                            );
00751 
00752 fsal_status_t FSAL_UP_AddFilter(struct fsal_up_event_bus_filter_t_ * pupebfilter,  /* IN */
00753                                 struct fsal_up_event_bus_context_t_ * pupebcontext /* INOUT */
00754                                    );
00755 fsal_status_t FSAL_UP_GetEvents(struct glist_head * pevent_head,           /* OUT */
00756                                 fsal_count_t * event_nb,                   /* IN */
00757                                 fsal_time_t timeout,                       /* IN */
00758                                 fsal_count_t * peventfound,                /* OUT */
00759                                 struct fsal_up_event_bus_context_t_ * pupebcontext /* IN */
00760                                 );
00761 #endif /* _USE_FSAL_UP */
00762 
00763 /* To be called before exiting */
00764 fsal_status_t FSAL_terminate();
00765 
00766 #ifndef _USE_SWIG
00767 
00768 /******************************************************
00769  *          FSAL extended attributes management.
00770  ******************************************************/
00771 
00773 #define XATTRS_READLIST_FROM_BEGINNING  (0)
00774 
00776 typedef struct fsal_xattrent__
00777 {
00778   unsigned int xattr_id;                 
00779   fsal_name_t xattr_name;                
00780   unsigned int xattr_cookie;             
00781   fsal_attrib_list_t attributes;         
00783 } fsal_xattrent_t;
00784 
00797 fsal_status_t FSAL_ListXAttrs(fsal_handle_t * p_objecthandle,   /* IN */
00798                               unsigned int cookie,      /* IN */
00799                               fsal_op_context_t * p_context,    /* IN */
00800                               fsal_xattrent_t * xattrs_tab,     /* IN/OUT */
00801                               unsigned int xattrs_tabsize,      /* IN */
00802                               unsigned int *p_nb_returned,      /* OUT */
00803                               int *end_of_list  /* OUT */
00804     );
00805 
00815 fsal_status_t FSAL_GetXAttrIdByName(fsal_handle_t * p_objecthandle,     /* IN */
00816                                     const fsal_name_t * xattr_name,     /* IN */
00817                                     fsal_op_context_t * p_context,      /* IN */
00818                                     unsigned int *pxattr_id     /* OUT */
00819     );
00820 
00831 fsal_status_t FSAL_GetXAttrValueByName(fsal_handle_t * p_objecthandle,  /* IN */
00832                                        const fsal_name_t * xattr_name,  /* IN */
00833                                        fsal_op_context_t * p_context,   /* IN */
00834                                        caddr_t buffer_addr,     /* IN/OUT */
00835                                        size_t buffer_size,      /* IN */
00836                                        size_t * p_output_size   /* OUT */
00837     );
00838 
00849 fsal_status_t FSAL_GetXAttrValueById(fsal_handle_t * p_objecthandle,    /* IN */
00850                                      unsigned int xattr_id,     /* IN */
00851                                      fsal_op_context_t * p_context,     /* IN */
00852                                      caddr_t buffer_addr,       /* IN/OUT */
00853                                      size_t buffer_size,        /* IN */
00854                                      size_t * p_output_size     /* OUT */
00855     );
00856 
00868 fsal_status_t FSAL_SetXAttrValue(fsal_handle_t * p_objecthandle,        /* IN */
00869                                  const fsal_name_t * xattr_name,        /* IN */
00870                                  fsal_op_context_t * p_context, /* IN */
00871                                  caddr_t buffer_addr,   /* IN */
00872                                  size_t buffer_size,    /* IN */
00873                                  int create     /* IN */
00874     );
00875 
00885 fsal_status_t FSAL_SetXAttrValueById(fsal_handle_t * p_objecthandle,    /* IN */
00886                                      unsigned int xattr_id,     /* IN */
00887                                      fsal_op_context_t * p_context,     /* IN */
00888                                      caddr_t buffer_addr,       /* IN */
00889                                      size_t buffer_size);       /* IN */
00890 
00899 fsal_status_t FSAL_GetXAttrAttrs(fsal_handle_t * p_objecthandle,        /* IN */
00900                                  fsal_op_context_t * p_context, /* IN */
00901                                  unsigned int xattr_id, /* IN */
00902                                  fsal_attrib_list_t * p_attrs
00904     );
00905 
00913 fsal_status_t FSAL_RemoveXAttrById(fsal_handle_t * p_objecthandle,      /* IN */
00914                                    fsal_op_context_t * p_context,       /* IN */
00915                                    unsigned int xattr_id);      /* IN */
00916 
00924 fsal_status_t FSAL_RemoveXAttrByName(fsal_handle_t * p_objecthandle,    /* IN */
00925                                      fsal_op_context_t * p_context,     /* IN */
00926                                      const fsal_name_t * xattr_name);   /* IN */
00927 
00928 /******************************************************
00929  *                FSAL miscelaneous tools.
00930  ******************************************************/
00931 
00932 /* Note : one per client thread */
00933 void FSAL_get_stats(fsal_statistics_t * stats,  /* OUT */
00934                     fsal_boolean_t reset        /* IN */
00935     );
00936 
00937 /* Return the name of the underlying file system (used for traces) */
00938 char *FSAL_GetFSName();
00939 
00940 /******************************************************
00941  *                FSAL quota related functions.
00942  ******************************************************/
00943 #define FSAL_QCMD(cmd, type)  (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
00944 
00945 fsal_status_t FSAL_get_quota(fsal_path_t * pfsal_path,  /* IN */
00946                              int quota_type,    /* IN */
00947                              fsal_uid_t fsal_uid,       /* IN */
00948                              fsal_quota_t * pquota);    /* OUT */
00949 
00950 fsal_status_t FSAL_set_quota(fsal_path_t * pfsal_path,  /* IN */
00951                              int quota_type,    /* IN */
00952                              fsal_uid_t fsal_uid,       /* IN */
00953                              fsal_quota_t * pquot,      /* IN */
00954                              fsal_quota_t * presquot);  /* OUT */
00955 
00956 fsal_status_t FSAL_check_quota( char *path,  /* IN */
00957                                 fsal_quota_type_t  quota_type,
00958                                 fsal_uid_t fsal_uid);      /* IN */
00959 
00960 
00961 
00962 /******************************************************
00963  *                Standard convertion routines.
00964  ******************************************************/
00965 
00966 unsigned int FSAL_GetFileno(fsal_file_t * pfile);
00967 #define FSAL_FILENO( pfile ) FSAL_GetFileno( pfile )
00968 
00978 mode_t fsal2unix_mode(fsal_accessmode_t fsal_mode);
00979 
00980 fsal_dev_t posix2fsal_devt(dev_t posix_devid);
00981 
00991 fsal_accessmode_t unix2fsal_mode(mode_t unix_mode);
00992 
00993 /* The following functions are used in Cache_Inode_Asynch mode */
00994 
00995 fsal_status_t FSAL_setattr_access(fsal_op_context_t * p_context,        /* IN */
00996                                   fsal_attrib_list_t * candidate_attributes,    /* IN */
00997                                   fsal_attrib_list_t * object_attributes        /* IN */
00998     );
00999 
01000 fsal_status_t FSAL_merge_attrs(fsal_attrib_list_t * pinit_attr, /* IN */
01001                                fsal_attrib_list_t * pnew_attr,  /* IN */
01002                                fsal_attrib_list_t * presult_attr);      /* OUT */
01003 
01004 fsal_status_t FSAL_rename_access(fsal_op_context_t * pcontext,  /* IN */
01005                                  fsal_attrib_list_t * pattrsrc, /* IN */
01006                                  fsal_attrib_list_t * pattrdest);       /* IN */
01007 
01008 fsal_status_t FSAL_unlink_access(fsal_op_context_t * pcontext,  /* IN */
01009                                  fsal_attrib_list_t * pattr);   /* IN */
01010 
01011 fsal_status_t FSAL_create_access(fsal_op_context_t * pcontext,  /* IN */
01012                                  fsal_attrib_list_t * pattr);   /* IN */
01013 
01014 fsal_status_t FSAL_link_access(fsal_op_context_t * pcontext,    /* IN */
01015                                fsal_attrib_list_t * pattr);     /* IN */
01016 
01017 /******************************************************
01018  *                Structure used to define a fsal
01019  ******************************************************/
01020 
01021 typedef struct fsal_functions__
01022 {
01023   /* FSAL_access */
01024   fsal_status_t(*fsal_access) (fsal_handle_t * p_object_handle,
01025                                fsal_op_context_t * p_context,
01026                                fsal_accessflags_t access_type,
01027                                fsal_attrib_list_t * p_object_attribute);
01028 
01029   /* FSAL_getattrs */
01030   fsal_status_t(*fsal_getattrs) (fsal_handle_t * p_filehandle,  /* IN */
01031                                  fsal_op_context_t * p_context, /* IN */
01032                                  fsal_attrib_list_t * p_object_attributes /* IN/OUT */ );
01033 
01034   /* FSAL_getattrs_descriptor */
01035   fsal_status_t(*fsal_getattrs_descriptor) (fsal_file_t * p_file_descriptor,         /* IN */
01036                                             fsal_handle_t * p_filehandle,            /* IN */
01037                                             fsal_op_context_t * p_context,           /* IN */
01038                                             fsal_attrib_list_t * p_object_attributes /* IN/OUT */ );
01039 
01040   /* FSAL_setattrs */
01041   fsal_status_t(*fsal_setattrs) (fsal_handle_t * p_filehandle,  /* IN */
01042                                  fsal_op_context_t * p_context, /* IN */
01043                                  fsal_attrib_list_t * p_attrib_set,     /* IN */
01044                                  fsal_attrib_list_t *
01045                                  p_object_attributes /* [ IN/OUT ] */ );
01046 
01047   /* FSAL__BuildExportContext */
01048   fsal_status_t(*fsal_buildexportcontext) (fsal_export_context_t * p_export_context,    /* OUT */
01049                                            fsal_path_t * p_export_path, /* IN */
01050                                            char *fs_specific_options /* IN */ );
01051 
01052   /* FSAL_CleanUpExportContent */
01053   fsal_status_t(*fsal_cleanupexportcontext) (fsal_export_context_t * p_export_context);
01054 
01055 
01056   /* FSAL_InitClientContext */
01057   fsal_status_t(*fsal_initclientcontext) (fsal_op_context_t * p_thr_context);
01058 
01059   /* FSAL_GetClientContext */
01060   fsal_status_t(*fsal_getclientcontext) (fsal_op_context_t * p_thr_context,     /* IN/OUT  */
01061                                          fsal_export_context_t * p_export_context,      /* IN */
01062                                          fsal_uid_t uid,        /* IN */
01063                                          fsal_gid_t gid,        /* IN */
01064                                          fsal_gid_t * alt_groups,       /* IN */
01065                                          fsal_count_t nb_alt_groups /* IN */ );
01066 
01067   /* FSAL_create */
01068   fsal_status_t(*fsal_create) (fsal_handle_t * p_parent_directory_handle,       /* IN */
01069                                fsal_name_t * p_filename,        /* IN */
01070                                fsal_op_context_t * p_context,   /* IN */
01071                                fsal_accessmode_t accessmode,    /* IN */
01072                                fsal_handle_t * p_object_handle, /* OUT */
01073                                fsal_attrib_list_t *
01074                                p_object_attributes /* [ IN/OUT ] */ );
01075 
01076   /* FSAL_mkdir */
01077   fsal_status_t(*fsal_mkdir) (fsal_handle_t * p_parent_directory_handle,        /* IN */
01078                               fsal_name_t * p_dirname,  /* IN */
01079                               fsal_op_context_t * p_context,    /* IN */
01080                               fsal_accessmode_t accessmode,     /* IN */
01081                               fsal_handle_t * p_object_handle,  /* OUT */
01082                               fsal_attrib_list_t * p_object_attributes /* [ IN/OUT ] */ );
01083 
01084   /* FSAL_link */
01085   fsal_status_t(*fsal_link) (fsal_handle_t * p_target_handle,   /* IN */
01086                              fsal_handle_t * p_dir_handle,      /* IN */
01087                              fsal_name_t * p_link_name, /* IN */
01088                              fsal_op_context_t * p_context,     /* IN */
01089                              fsal_attrib_list_t * p_attributes /* [ IN/OUT ] */ );
01090 
01091   /* FSAL_mknode */
01092   fsal_status_t(*fsal_mknode) (fsal_handle_t * parentdir_handle,        /* IN */
01093                                fsal_name_t * p_node_name,       /* IN */
01094                                fsal_op_context_t * p_context,   /* IN */
01095                                fsal_accessmode_t accessmode,    /* IN */
01096                                fsal_nodetype_t nodetype,        /* IN */
01097                                fsal_dev_t * dev,        /* IN */
01098                                fsal_handle_t * p_object_handle, /* OUT (handle to the created node) */
01099                                fsal_attrib_list_t * node_attributes /* [ IN/OUT ] */ );
01100 
01101   /* FSAL_opendir */
01102   fsal_status_t(*fsal_opendir) (fsal_handle_t * p_dir_handle,   /* IN */
01103                                 fsal_op_context_t * p_context,  /* IN */
01104                                 fsal_dir_t * p_dir_descriptor,  /* OUT */
01105                                 fsal_attrib_list_t * p_dir_attributes /* [ IN/OUT ] */ );
01106 
01107   /* FSAL_readdir */
01108   fsal_status_t(*fsal_readdir) (fsal_dir_t * p_dir_descriptor,  /* IN */
01109                                 fsal_cookie_t start_position,   /* IN */
01110                                 fsal_attrib_mask_t get_attr_mask,       /* IN */
01111                                 fsal_mdsize_t buffersize,       /* IN */
01112                                 fsal_dirent_t * p_pdirent,      /* OUT */
01113                                 fsal_cookie_t * p_end_position, /* OUT */
01114                                 fsal_count_t * p_nb_entries,    /* OUT */
01115                                 fsal_boolean_t * p_end_of_dir /* OUT */ );
01116 
01117   /* FSAL_closedir */
01118   fsal_status_t(*fsal_closedir) (fsal_dir_t * p_dir_descriptor /* IN */ );
01119 
01120   /* FSAL_open_by_name */
01121   fsal_status_t(*fsal_open_by_name) (fsal_handle_t * dirhandle, /* IN */
01122                                      fsal_name_t * filename,    /* IN */
01123                                      fsal_op_context_t * p_context,     /* IN */
01124                                      fsal_openflags_t openflags,        /* IN */
01125                                      fsal_file_t * file_descriptor,     /* OUT */
01126                                      fsal_attrib_list_t *
01127                                      file_attributes /* [ IN/OUT ] */ );
01128 
01129   /* FSAL_open */
01130   fsal_status_t(*fsal_open) (fsal_handle_t * p_filehandle,      /* IN */
01131                              fsal_op_context_t * p_context,     /* IN */
01132                              fsal_openflags_t openflags,        /* IN */
01133                              fsal_file_t * p_file_descriptor,   /* OUT */
01134                              fsal_attrib_list_t * p_file_attributes /* [ IN/OUT ] */ );
01135 
01136   /* FSAL_read */
01137   fsal_status_t(*fsal_read) (fsal_file_t * p_file_descriptor,   /* IN */
01138                              fsal_seek_t * p_seek_descriptor,   /* [IN] */
01139                              fsal_size_t buffer_size,   /* IN */
01140                              caddr_t buffer,    /* OUT */
01141                              fsal_size_t * p_read_amount,       /* OUT */
01142                              fsal_boolean_t * p_end_of_file /* OUT */ );
01143 
01144   /* FSAL_write */
01145   fsal_status_t(*fsal_write) (fsal_file_t * p_file_descriptor,  /* IN */
01146                               fsal_op_context_t * p_context,    /* IN */
01147                               fsal_seek_t * p_seek_descriptor,  /* IN */
01148                               fsal_size_t buffer_size,  /* IN */
01149                               caddr_t buffer,   /* IN */
01150                               fsal_size_t * p_write_amount /* OUT */ );
01151 
01152   /* FSAL_close */
01153   fsal_status_t(*fsal_close) (fsal_file_t * p_file_descriptor /* IN */ );
01154 
01155   /* FSAL_open_by_fileid */
01156   fsal_status_t(*fsal_open_by_fileid) (fsal_handle_t * filehandle,      /* IN */
01157                                        fsal_u64_t fileid,       /* IN */
01158                                        fsal_op_context_t * p_context,   /* IN */
01159                                        fsal_openflags_t openflags,      /* IN */
01160                                        fsal_file_t * file_descriptor,   /* OUT */
01161                                        fsal_attrib_list_t *
01162                                        file_attributes /* [ IN/OUT ] */ );
01163 
01164   /* FSAL_close_by_fileid */
01165   fsal_status_t(*fsal_close_by_fileid) (fsal_file_t * file_descriptor /* IN */ ,
01166                                         fsal_u64_t fileid);
01167 
01168   /* FSAL_dynamic_fsinfo */
01169   fsal_status_t(*fsal_dynamic_fsinfo) (fsal_handle_t * p_filehandle,    /* IN */
01170                                        fsal_op_context_t * p_context,   /* IN */
01171                                        fsal_dynamicfsinfo_t * p_dynamicinfo /* OUT */ );
01172 
01173   /* FSAL_Init */
01174   fsal_status_t(*fsal_init) (fsal_parameter_t * init_info /* IN */ );
01175 
01176   /* FSAL_terminate */
01177   fsal_status_t(*fsal_terminate) ();
01178 
01179   /* FSAL_test_access */
01180   fsal_status_t(*fsal_test_access) (fsal_op_context_t * p_context,      /* IN */
01181                                     fsal_accessflags_t access_type,     /* IN */
01182                                     fsal_attrib_list_t * p_object_attributes /* IN */ );
01183 
01184   /* FSAL_setattr_access */
01185   fsal_status_t(*fsal_setattr_access) (fsal_op_context_t * p_context,   /* IN */
01186                                        fsal_attrib_list_t * candidate_attributes,       /* IN */
01187                                        fsal_attrib_list_t * object_attributes /* IN */ );
01188 
01189   /* FSAL_rename_access */
01190   fsal_status_t(*fsal_rename_access) (fsal_op_context_t * pcontext,     /* IN */
01191                                       fsal_attrib_list_t * pattrsrc,    /* IN */
01192                                       fsal_attrib_list_t * pattrdest) /* IN */ ;
01193 
01194   /* FSAL_create_access */
01195   fsal_status_t(*fsal_create_access) (fsal_op_context_t * pcontext,     /* IN */
01196                                       fsal_attrib_list_t * pattr) /* IN */ ;
01197 
01198   /* FSAL_unlink_access */
01199   fsal_status_t(*fsal_unlink_access) (fsal_op_context_t * pcontext,     /* IN */
01200                                       fsal_attrib_list_t * pattr) /* IN */ ;
01201 
01202   /* FSAL_link_access */
01203   fsal_status_t(*fsal_link_access) (fsal_op_context_t * pcontext,       /* IN */
01204                                     fsal_attrib_list_t * pattr) /* IN */ ;
01205 
01206   /* FSAL_merge_attrs */
01207   fsal_status_t(*fsal_merge_attrs) (fsal_attrib_list_t * pinit_attr,
01208                                     fsal_attrib_list_t * pnew_attr,
01209                                     fsal_attrib_list_t * presult_attr);
01210 
01211   /* FSAL_lookup */
01212   fsal_status_t(*fsal_lookup) (fsal_handle_t * p_parent_directory_handle,       /* IN */
01213                                fsal_name_t * p_filename,        /* IN */
01214                                fsal_op_context_t * p_context,   /* IN */
01215                                fsal_handle_t * p_object_handle, /* OUT */
01216                                fsal_attrib_list_t *
01217                                p_object_attributes /* [ IN/OUT ] */ );
01218 
01219   /* FSAL_lookupPath */
01220   fsal_status_t(*fsal_lookuppath) (fsal_path_t * p_path,        /* IN */
01221                                    fsal_op_context_t * p_context,       /* IN */
01222                                    fsal_handle_t * object_handle,       /* OUT */
01223                                    fsal_attrib_list_t *
01224                                    p_object_attributes /* [ IN/OUT ] */ );
01225 
01226   /* FSAL_lookupJunction */
01227   fsal_status_t(*fsal_lookupjunction) (fsal_handle_t * p_junction_handle,       /* IN */
01228                                        fsal_op_context_t * p_context,   /* IN */
01229                                        fsal_handle_t * p_fsoot_handle,  /* OUT */
01230                                        fsal_attrib_list_t *
01231                                        p_fsroot_attributes /* [ IN/OUT ] */ );
01232   /* FSAL_CleanObjectResources */
01233   fsal_status_t(*fsal_cleanobjectresources) (fsal_handle_t * in_fsal_handle);
01234 
01235   /* FSAL_cookie_to_uint64 */
01236   fsal_status_t(*fsal_cookie_to_uint64) (fsal_handle_t * handle,
01237                                          fsal_cookie_t * cookie,
01238                                          uint64_t * uint64);
01239 
01240   /* FSAL_uint64_to_cookie */
01241   fsal_status_t(*fsal_uint64_to_cookie) (fsal_handle_t * handle,
01242                                          uint64_t * uint64,
01243                                          fsal_cookie_t * cookie);
01244 
01245   /* FSAL_get_cookieverf */
01246   fsal_status_t(*fsal_get_cookieverf)(fsal_handle_t * handle,
01247                                       uint64_t * cookie);
01248   /* FSAL_set_quota */
01249   fsal_status_t(*fsal_set_quota) (fsal_path_t * pfsal_path,     /* IN */
01250                                   int quota_type,       /* IN */
01251                                   fsal_uid_t fsal_uid,  /* IN */
01252                                   fsal_quota_t * pquota,        /* IN */
01253                                   fsal_quota_t * presquota);    /* OUT */
01254 
01255   /* FSAL_get_quota */
01256   fsal_status_t(*fsal_get_quota) (fsal_path_t * pfsal_path,     /* IN */
01257                                   int quota_type,       /* IN */
01258                                   fsal_uid_t fsal_uid,  /* IN */
01259                                   fsal_quota_t * pquota);       /* OUT */
01260 
01261   /* FSAL_check_quota */
01262   fsal_status_t(*fsal_check_quota)( char * pfsal_path,  /* IN */
01263                                     fsal_quota_type_t   quota_type,
01264                                     fsal_uid_t fsal_uid);      /* IN */
01265 
01266   /* FSAL_rcp */
01267   fsal_status_t(*fsal_rcp) (fsal_handle_t * filehandle, /* IN */
01268                             fsal_op_context_t * p_context,      /* IN */
01269                             fsal_path_t * p_local_path, /* IN */
01270                             fsal_rcpflag_t transfer_opt);       /* IN */
01271 
01272   /* FSAL_rename */
01273   fsal_status_t(*fsal_rename) (fsal_handle_t * p_old_parentdir_handle,  /* IN */
01274                                fsal_name_t * p_old_name,        /* IN */
01275                                fsal_handle_t * p_new_parentdir_handle,  /* IN */
01276                                fsal_name_t * p_new_name,        /* IN */
01277                                fsal_op_context_t * p_context,   /* IN */
01278                                fsal_attrib_list_t * p_src_dir_attributes,       /* [ IN/OUT ] */
01279                                fsal_attrib_list_t *
01280                                p_tgt_dir_attributes /* [ IN/OUT ] */ );
01281 
01282   /* FSAL_get_stats */
01283   void (*fsal_get_stats) (fsal_statistics_t * stats,    /* OUT */
01284                           fsal_boolean_t reset);        /* IN */
01285 
01286   /* FSAL_readlink */
01287    fsal_status_t(*fsal_readlink) (fsal_handle_t * p_linkhandle, /* IN */
01288                                   fsal_op_context_t * p_context,        /* IN */
01289                                   fsal_path_t * p_link_content, /* OUT */
01290                                   fsal_attrib_list_t *
01291                                   p_link_attributes /* [ IN/OUT ] */ );
01292 
01293   /* FSAL_symlink */
01294    fsal_status_t(*fsal_symlink) (fsal_handle_t * p_parent_directory_handle,     /* IN */
01295                                  fsal_name_t * p_linkname,      /* IN */
01296                                  fsal_path_t * p_linkcontent,   /* IN */
01297                                  fsal_op_context_t * p_context, /* IN */
01298                                  fsal_accessmode_t accessmode,  /* IN (ignored) */
01299                                  fsal_handle_t * p_link_handle, /* OUT */
01300                                  fsal_attrib_list_t *
01301                                  p_link_attributes /* [ IN/OUT ] */ );
01302 
01303   /* FSAL_handlecmp */
01304   int (*fsal_handlecmp) (fsal_handle_t * handle1, fsal_handle_t * handle2,
01305                          fsal_status_t * status);
01306 
01307   /* FSAL_Handle_to_HashIndex */
01308   unsigned int (*fsal_handle_to_hashindex) (fsal_handle_t * p_handle,
01309                                             unsigned int cookie,
01310                                             unsigned int alphabet_len,
01311                                             unsigned int index_size);
01312 
01313   /* FSAL_Handle_to_RBTIndex */
01314   unsigned int (*fsal_handle_to_rbtindex) (fsal_handle_t * p_handle, unsigned int cookie);
01315 
01316   /* FSAL_Handle_to_Hash_both */
01317   unsigned int (*fsal_handle_to_hash_both) (fsal_handle_t * p_handle, unsigned int cookie, unsigned int alphabet_len, 
01318                                       unsigned int index_size, unsigned int * phashval, unsigned int *prbtval ) ;
01319 
01320   /* FSAL_DigestHandle */
01321    fsal_status_t(*fsal_digesthandle) (fsal_export_context_t * p_expcontext,     /* IN */
01322                                       fsal_digesttype_t output_type,    /* IN */
01323                                       fsal_handle_t * p_in_fsal_handle, /* IN */
01324                                       struct fsal_handle_desc *fh_desc /* OUT */ );
01325 
01326   /* FSAL_ExpandHandle */
01327    fsal_status_t(*fsal_expandhandle) (fsal_export_context_t * p_expcontext,     /* IN */
01328                                       fsal_digesttype_t in_type,        /* IN */
01329                                       struct fsal_handle_desc *fh_desc  /* IN OUT */ );
01330 
01331   /* FSAL_SetDefault_FSAL_parameter */
01332    fsal_status_t(*fsal_setdefault_fsal_parameter) (fsal_parameter_t * out_parameter);
01333 
01334   /* FSAL_SetDefault_FS_common_parameter */
01335    fsal_status_t(*fsal_setdefault_fs_common_parameter) (fsal_parameter_t * out_parameter);
01336 
01337   /* FSAL_SetDefault_FS_specific_parameter */
01338    fsal_status_t(*fsal_setdefault_fs_specific_parameter) (fsal_parameter_t *
01339                                                           out_parameter);
01340 
01341   /* FSAL_load_FSAL_parameter_from_conf */
01342    fsal_status_t(*fsal_load_fsal_parameter_from_conf) (config_file_t in_config,
01343                                                        fsal_parameter_t * out_parameter);
01344 
01345   /* FSAL_load_FS_common_parameter_from_conf */
01346    fsal_status_t(*fsal_load_fs_common_parameter_from_conf) (config_file_t in_config,
01347                                                             fsal_parameter_t *
01348                                                             out_parameter);
01349 
01350   /* FSAL_load_FS_specific_parameter_from_conf */
01351    fsal_status_t(*fsal_load_fs_specific_parameter_from_conf) (config_file_t in_config,
01352                                                               fsal_parameter_t *
01353                                                               out_parameter);
01354 
01355   /* FSAL_truncate */
01356    fsal_status_t(*fsal_truncate) (fsal_handle_t * p_filehandle, /* IN */
01357                                   fsal_op_context_t * p_context,        /* IN */
01358                                   fsal_size_t length,   /* IN */
01359                                   fsal_file_t * file_descriptor,        /* Unused in this FSAL */
01360                                   fsal_attrib_list_t *
01361                                   p_object_attributes /* [ IN/OUT ] */ );
01362 
01363   /* FSAL_unlink */
01364    fsal_status_t(*fsal_unlink) (fsal_handle_t * p_parent_directory_handle,      /* IN */
01365                                 fsal_name_t * p_object_name,    /* IN */
01366                                 fsal_op_context_t * p_context,  /* IN */
01367                                 fsal_attrib_list_t *
01368                                 p_parent_directory_attributes /* [IN/OUT ] */ );
01369 
01370   /* FSAL_GetFSName */
01371   char *(*fsal_getfsname) ();
01372 
01373   /* FSAL_GetXAttrAttrs */
01374    fsal_status_t(*fsal_getxattrattrs) (fsal_handle_t * p_objecthandle,  /* IN */
01375                                        fsal_op_context_t * p_context,   /* IN */
01376                                        unsigned int xattr_id,   /* IN */
01377                                        fsal_attrib_list_t * p_attrs);
01378 
01379   /* FSAL_ListXAttrs */
01380    fsal_status_t(*fsal_listxattrs) (fsal_handle_t * p_objecthandle,     /* IN */
01381                                     unsigned int cookie,        /* IN */
01382                                     fsal_op_context_t * p_context,      /* IN */
01383                                     fsal_xattrent_t * xattrs_tab,       /* IN/OUT */
01384                                     unsigned int xattrs_tabsize,        /* IN */
01385                                     unsigned int *p_nb_returned,        /* OUT */
01386                                     int *end_of_list /* OUT */ );
01387 
01388   /* FSAL_GetXAttrValueById */
01389    fsal_status_t(*fsal_getxattrvaluebyid) (fsal_handle_t * p_objecthandle,      /* IN */
01390                                            unsigned int xattr_id,       /* IN */
01391                                            fsal_op_context_t * p_context,       /* IN */
01392                                            caddr_t buffer_addr, /* IN/OUT */
01393                                            size_t buffer_size,  /* IN */
01394                                            size_t * p_output_size /* OUT */ );
01395 
01396   /* FSAL_GetXAttrIdByName */
01397    fsal_status_t(*fsal_getxattridbyname) (fsal_handle_t * p_objecthandle,       /* IN */
01398                                           const fsal_name_t * xattr_name,       /* IN */
01399                                           fsal_op_context_t * p_context,        /* IN */
01400                                           unsigned int *pxattr_id /* OUT */ );
01401 
01402   /* FSAL_GetXAttrValueByName */
01403    fsal_status_t(*fsal_getxattrvaluebyname) (fsal_handle_t * p_objecthandle,    /* IN */
01404                                              const fsal_name_t * xattr_name,    /* IN */
01405                                              fsal_op_context_t * p_context,     /* IN */
01406                                              caddr_t buffer_addr,       /* IN/OUT */
01407                                              size_t buffer_size,        /* IN */
01408                                              size_t * p_output_size /* OUT */ );
01409 
01410   /* FSAL_SetXAttrValue */
01411    fsal_status_t(*fsal_setxattrvalue) (fsal_handle_t * p_objecthandle,  /* IN */
01412                                        const fsal_name_t * xattr_name,  /* IN */
01413                                        fsal_op_context_t * p_context,   /* IN */
01414                                        caddr_t buffer_addr,     /* IN */
01415                                        size_t buffer_size,      /* IN */
01416                                        int create /* IN */ );
01417 
01418   /* FSAL_SetXAttrValueById */
01419    fsal_status_t(*fsal_setxattrvaluebyid) (fsal_handle_t * p_objecthandle,      /* IN */
01420                                            unsigned int xattr_id,       /* IN */
01421                                            fsal_op_context_t * p_context,       /* IN */
01422                                            caddr_t buffer_addr, /* IN */
01423                                            size_t buffer_size /* IN */ );
01424 
01425   /* FSAL_RemoveXAttrById */
01426    fsal_status_t(*fsal_removexattrbyid) (fsal_handle_t * p_objecthandle,        /* IN */
01427                                          fsal_op_context_t * p_context, /* IN */
01428                                          unsigned int xattr_id) /* IN */ ;
01429 
01430   /* FSAL_RemoveXAttrByName */
01431    fsal_status_t(*fsal_removexattrbyname) (fsal_handle_t * p_objecthandle,      /* IN */
01432                                            fsal_op_context_t * p_context,       /* IN */
01433                                            const fsal_name_t * xattr_name) /* IN */ ;
01434 
01435   /* FSAL_getextattrs */
01436   fsal_status_t (*fsal_getextattrs)( fsal_handle_t * p_filehandle, /* IN */
01437                                      fsal_op_context_t * p_context,        /* IN */
01438                                      fsal_extattrib_list_t * p_object_attributes /* OUT */ ) ;
01439 
01440   fsal_status_t (*fsal_lock_op)( fsal_file_t             * p_file_descriptor,   /* IN */
01441                                  fsal_handle_t           * p_filehandle,        /* IN */
01442                                  fsal_op_context_t       * p_context,           /* IN */
01443                                  void                    * p_owner,             /* IN (opaque to FSAL) */
01444                                  fsal_lock_op_t            lock_op,             /* IN */
01445                                  fsal_lock_param_t         request_lock,        /* IN */
01446                                  fsal_lock_param_t       * conflicting_lock     /* OUT */ );
01447 
01448   /* get fileno */
01449   unsigned int (*fsal_getfileno) (fsal_file_t *);
01450 
01451   fsal_status_t(*fsal_commit) ( fsal_file_t * p_file_descriptor, 
01452                               fsal_off_t    offset, 
01453                               fsal_size_t   size );
01454 
01455   /* FSAL_UP functions */
01456 #ifdef _USE_FSAL_UP
01457   fsal_status_t(*fsal_up_init) (struct fsal_up_event_bus_parameter_t_ * pebparam,      /* IN */
01458                                 struct fsal_up_event_bus_context_t_ * pupebcontext     /* OUT */ );
01459   fsal_status_t(*fsal_up_addfilter)(struct fsal_up_event_bus_filter_t_ * pupebfilter,  /* IN */
01460                                   struct fsal_up_event_bus_context_t_ * pupebcontext /* INOUT */ );
01461   fsal_status_t(*fsal_up_getevents)(struct glist_head * pevent_head,         /* OUT */
01462                                   fsal_count_t * event_nb,                   /* IN */
01463                                   fsal_time_t timeout,                       /* IN */
01464                                     fsal_count_t * peventfound,                 /* OUT */
01465                                   struct fsal_up_event_bus_context_t_ * pupebcontext /* IN */ );
01466 #endif /* _USE_FSAL_UP */
01467 
01468   fsal_status_t (*fsal_share_op)( fsal_file_t            * p_file_descriptor,   /* IN */
01469                                   fsal_handle_t          * p_filehandle,        /* IN */
01470                                   fsal_op_context_t      * p_context,           /* IN */
01471                                   void                   * p_owner,             /* IN (opaque to FSAL) */
01472                                   fsal_share_param_t       request_share        /* IN */ );
01473 } fsal_functions_t;
01474 
01475 /* Structure allow assignement, char[<n>] do not */
01476 typedef struct fsal_const__
01477 {
01478   unsigned int fsal_handle_t_size;
01479   unsigned int fsal_op_context_t_size;
01480   unsigned int fsal_export_context_t_size;
01481   unsigned int fsal_file_t_size;
01482   unsigned int fsal_cookie_t_size;
01483   unsigned int fsal_cred_t_size;
01484   unsigned int fs_specific_initinfo_t_size;
01485   unsigned int fsal_dir_t_size;
01486 } fsal_const_t;
01487 
01488 int FSAL_LoadLibrary(char *path);
01489 
01490 fsal_functions_t FSAL_GetFunctions(void);
01491 void FSAL_LoadFunctions(void);
01492 
01493 fsal_const_t FSAL_GetConsts(void);
01494 void FSAL_LoadConsts(void);
01495 
01496 #endif                          /* ! _USE_SWIG */
01497 
01498 #endif                          /* _FSAL_H */