nfs-ganesha 1.4

nlm_Free_All.c

Go to the documentation of this file.
00001 /*
00002  * Copyright IBM Corporation, 2012
00003  *  Contributor: Frank Filz <ffilz@us.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 "ganesha_rpc.h"
00036 #include "log.h"
00037 #include "nlm4.h"
00038 #include "sal_functions.h"
00039 #include "nfs_proto_functions.h"
00040 #include "nlm_util.h"
00041 
00054 int nlm4_Free_All(nfs_arg_t *parg,
00055                   exportlist_t *pexport,
00056                   fsal_op_context_t *pcontext,
00057                   nfs_worker_data_t *pworker,
00058                   struct svc_req *preq,
00059                   nfs_res_t *pres)
00060 {
00061   nlm4_free_allargs  * arg = &parg->arg_nlm4_free_allargs;
00062   state_status_t       state_status = STATE_SUCCESS;
00063   state_nsm_client_t * nsm_client;
00064 
00065   LogDebug(COMPONENT_NLM,
00066            "REQUEST PROCESSING: Calling nlm4_Free_All for %s",
00067            arg->name);
00068 
00069   nsm_client = get_nsm_client(CARE_NOT, preq->rq_xprt, arg->name);
00070   if(nsm_client != NULL)
00071     {
00072       /* NLM_FREE_ALL has the same semantics as handling SM_NOTIFY.
00073        *
00074        * Cast the state number into a state pointer to protect
00075        * locks from a client that has rebooted from being released
00076        * by this NLM_FREE_ALL.
00077        */
00078       if(state_nlm_notify(nsm_client,
00079                           (void *) (ptrdiff_t) arg->state,
00080                           &state_status) != STATE_SUCCESS)
00081         {
00082           /* NLM_FREE_ALL has void result so all we can do is log error */
00083           LogWarn(COMPONENT_NLM,
00084                   "NLM_FREE_ALL failed with result %s",
00085                   state_err_str(state_status));
00086         }
00087 
00088       dec_nsm_client_ref(nsm_client);
00089     }
00090 
00091   LogDebug(COMPONENT_NLM,
00092            "REQUEST RESULT: nlm4_Free_All DONE");
00093 
00094   return NFS_REQ_OK;
00095 }
00096 
00105 void nlm4_Free_All_Free(nfs_res_t * pres)
00106 {
00107   return;
00108 }