nfs-ganesha 1.4
|
00001 /* 00002 * vim:expandtab:shiftwidth=8:tabstop=8: 00003 * 00004 * Copyright CEA/DAM/DIF (2008) 00005 * contributeur : Philippe DENIEL philippe.deniel@cea.fr 00006 * Thomas LEIBOVICI thomas.leibovici@cea.fr 00007 * 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 3 of the License, or (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this library; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00022 * 00023 * --------------------------------------- 00024 */ 00025 00035 #ifdef HAVE_CONFIG_H 00036 #include "config.h" 00037 #endif 00038 00039 #ifdef _SOLARIS 00040 #include "solaris_port.h" 00041 #endif 00042 00043 #include <stdio.h> 00044 #include <string.h> 00045 #include <pthread.h> 00046 #include <fcntl.h> 00047 #include <sys/file.h> /* for having FNDELAY */ 00048 #include "HashData.h" 00049 #include "HashTable.h" 00050 #include "log.h" 00051 #include "nfs23.h" 00052 #include "nfs4.h" 00053 #include "nfs_core.h" 00054 #include "cache_inode.h" 00055 #include "nfs_exports.h" 00056 #include "nfs_creds.h" 00057 #include "nfs_tools.h" 00058 #include "mount.h" 00059 #include "nfs_proto_functions.h" 00060 00073 int mnt_Umnt(nfs_arg_t *parg, 00074 exportlist_t *pexport, 00075 fsal_op_context_t *pcontext, 00076 nfs_worker_data_t *pworker, 00077 struct svc_req *preq, 00078 nfs_res_t *pres) 00079 { 00080 char *hostname; 00081 00082 LogDebug(COMPONENT_NFSPROTO, "REQUEST PROCESSING: Calling mnt_Umnt path %s", 00083 parg->arg_mnt); 00084 00085 /* @todo: BUGAZOMEU; seul AUTHUNIX est supporte */ 00086 hostname = ((struct authunix_parms *)(preq->rq_clntcred))->aup_machname; 00087 00088 if(hostname == NULL) 00089 { 00090 LogCrit(COMPONENT_NFSPROTO, "NULL passed as Umount argument !!!"); 00091 return NFS_REQ_DROP; 00092 } 00093 00094 /* TODO: this should actually process the path also. 00095 * nfs_Remove_MountList_Entry() will need updating also. 00096 */ 00097 if(!nfs_Remove_MountList_Entry(hostname, NULL)) 00098 { 00099 LogCrit(COMPONENT_NFSPROTO, 00100 "UMOUNT: Cannot remove mount entry for client %s", hostname); 00101 } 00102 LogInfo(COMPONENT_NFSPROTO, 00103 "UMOUNT: Client %s was removed from mount list", hostname); 00104 00105 return NFS_REQ_OK; 00106 } /* mnt_Umnt */ 00107 00116 void mnt_Umnt_Free(nfs_res_t * pres) 00117 { 00118 /* Nothing to do */ 00119 return; 00120 } /* mnt_Umnt_Free */