nfs-ganesha 1.4

nlm_async.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  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 3 of the License, or (at your option) any later version.
00011  * 
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020  * 
00021  *
00022  */
00023 
00024 #ifndef NLM_ASYNC_H
00025 #define NLM_ASYNC_H
00026 
00027 
00028 #include <pthread.h>
00029 
00030 #include "nfs_proto_functions.h"
00031 #include "nlm_list.h"
00032 #include "nlm_util.h"
00033 #include "nlm4.h"
00034 #include "cache_inode.h"
00035 #include "sal_data.h"
00036 
00037 extern pthread_mutex_t                nlm_async_resp_mutex;
00038 extern pthread_cond_t                 nlm_async_resp_cond;
00039 
00040 int nlm_async_callback_init();
00041 
00042 int nlm_send_async_res_nlm4(state_nlm_client_t * host,
00043                             state_async_func_t   func,
00044                             nfs_res_t          * pres);
00045 
00046 int nlm_send_async_res_nlm4test(state_nlm_client_t * host,
00047                                 state_async_func_t   func,
00048                                 nfs_res_t          * pres);
00049 
00050 /* Client routine  to send the asynchrnous response, key is used to wait for a response */
00051 int nlm_send_async(int                  proc,
00052                    state_nlm_client_t * host,
00053                    void               * inarg,
00054                    void               * key);
00055 
00056 void nlm_signal_async_resp(void *key);
00057 
00058 #endif                          /* NLM_ASYNC_H */