nfs-ganesha 1.4

nlm_util.h

Go to the documentation of this file.
00001 /*
00002  * Copyright IBM Corporation, 2010
00003  *  Contributor: Aneesh Kumar K.v  <aneesh.kumar@linux.vnet.ibm.com>
00004  *
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 3 of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  * ---------------------------------------
00021  * 
00022  *
00023  */
00024 
00025 #ifndef _NLM_UTIL_H
00026 #define _NLM_UTIL_H
00027 
00028 #include "nlm_list.h"
00029 #include "nlm4.h"
00030 #include "sal_functions.h"
00031 
00032 bool_t nlm_block_data_to_fsal_context(state_block_data_t * block_data,
00033                                       fsal_op_context_t  * fsal_context);
00034 
00035 extern const char *lock_result_str(int rc);
00036 extern netobj *copy_netobj(netobj * dst, netobj * src);
00037 extern void netobj_free(netobj * obj);
00038 extern void netobj_to_string(netobj *obj, char *buffer, int maxlen);
00057 int nlm_process_parameters(struct svc_req        * preq,
00058                            bool_t                  exclusive,
00059                            nlm4_lock             * alock,
00060                            fsal_lock_param_t     * plock,
00061                            cache_entry_t        ** ppentry,
00062                            fsal_op_context_t     * pcontext,
00063                            care_t                  care,
00064                            state_nsm_client_t   ** ppnsm_client,
00065                            state_nlm_client_t   ** ppnlm_client,
00066                            state_owner_t        ** ppowner,
00067                            state_block_data_t   ** ppblock_data);
00068 
00069 int nlm_process_share_parms(struct svc_req        * preq,
00070                             nlm4_share            * share,
00071                             cache_entry_t        ** ppentry,
00072                             fsal_op_context_t     * pcontext,
00073                             care_t                  care,
00074                             state_nsm_client_t   ** ppnsm_client,
00075                             state_nlm_client_t   ** ppnlm_client,
00076                             state_owner_t        ** ppowner);
00077 
00078 void nlm_process_conflict(nlm4_holder          * nlm_holder,
00079                           state_owner_t        * holder,
00080                           fsal_lock_param_t    * conflict);
00081 
00082 nlm4_stats nlm_convert_state_error(state_status_t status);
00083 
00084 state_status_t nlm_granted_callback(cache_entry_t        * pentry,
00085                                     state_lock_entry_t   * lock_entry,
00086                                     state_status_t       * pstatus);
00087 
00088 #endif                          /* _NLM_UTIL_H */