nfs-ganesha 1.4
|
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 #ifdef HAVE_CONFIG_H 00025 #include "config.h" 00026 #endif 00027 00028 #ifdef _SOLARIS 00029 #include "solaris_port.h" 00030 #endif 00031 00032 #include <stdio.h> 00033 #include <string.h> 00034 #include <pthread.h> 00035 #include "log.h" 00036 #include "ganesha_rpc.h" 00037 #include "nlm4.h" 00038 #include "sal_functions.h" 00039 #include "nfs_proto_functions.h" 00040 #include "nlm_util.h" 00041 00053 int nlm4_Sm_Notify(nfs_arg_t *parg, 00054 exportlist_t *pexport, 00055 fsal_op_context_t *pcontext, 00056 nfs_worker_data_t *pworker, 00057 struct svc_req *preq, 00058 nfs_res_t *pres) 00059 { 00060 nlm4_sm_notifyargs * arg = &parg->arg_nlm4_sm_notify; 00061 state_status_t state_status = STATE_SUCCESS; 00062 state_nsm_client_t * nsm_client; 00063 00064 LogDebug(COMPONENT_NLM, 00065 "REQUEST PROCESSING: Calling nlm4_sm_notify for %s", 00066 arg->name); 00067 00068 nsm_client = get_nsm_client(CARE_NOT, NULL, arg->name); 00069 if(nsm_client != NULL) 00070 { 00071 /* Cast the state number into a state pointer to protect 00072 * locks from a client that has rebooted from being released 00073 * by this SM_NOTIFY. 00074 */ 00075 if(state_nlm_notify(nsm_client, 00076 (void *) (ptrdiff_t) arg->state, 00077 &state_status) != STATE_SUCCESS) 00078 { 00079 /* TODO FSF: Deal with error */ 00080 } 00081 00082 dec_nsm_client_ref(nsm_client); 00083 } 00084 00085 LogDebug(COMPONENT_NLM, 00086 "REQUEST RESULT: nlm4_sm_notify DONE"); 00087 00088 return NFS_REQ_OK; 00089 } 00090 00099 void nlm4_Sm_Notify_Free(nfs_res_t * pres) 00100 { 00101 return; 00102 }