]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Backing out all the stuff related Hgfs Over VMCI.
authorVMware, Inc <>
Mon, 20 Sep 2010 18:03:49 +0000 (11:03 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 20 Sep 2010 18:03:49 +0000 (11:03 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/freebsd/vmhgfs/channel.h
open-vm-tools/modules/freebsd/vmhgfs/request.c
open-vm-tools/modules/freebsd/vmhgfs/worker.c

index d31b30443af404953c1632334656ff5dbc817d8a..b568680da438f6b7a4abfa878adf42aa90535294 100644 (file)
@@ -54,7 +54,6 @@ typedef struct HgfsTransportChannel {
 
 void HgfsGetBdChannel(HgfsTransportChannel *channel);
 void HgfsGetVmciChannel(HgfsTransportChannel *channel);
-Bool HgfsSetupNewChannel(void);
 extern HgfsTransportChannel *gHgfsChannel;
 
 #endif // _HGFS_CHANNEL_H_
index f3caae5bf9d6be67bdb8ce22ae4020d9014544c0..3769693b1f0b3c51d52f39619ddcf2ea6a0ad112 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "hgfs_kernel.h"
 #include "requestInt.h"
-#include "channel.h"
 
 /*
  * Macros
@@ -387,26 +386,6 @@ HgfsKReq_AllocateRequest(HgfsKReqContainerHandle container)        // IN
 
    ASSERT(container);
 
-   /*
-    * We may not have any channel currently. It so, try to
-    * establish channel once again. Most likely we will fail
-    * because user has probably disabled shared folders. This
-    * check is useful when user enables shared folders and they
-    * tries some operation. During that, we will come across this
-    * code path and user will be magically able to access stuff
-    * on host.
-    *
-    * Note that trying to establish new channel on send() path is
-    * broken because every channel has specific allocator function.
-    * Trying to allocate from one channel and then sending over
-    * another channel is sure asking for trouble. Don't do that.
-    */
-   if (gHgfsChannel->status != HGFS_CHANNEL_CONNECTED) {
-      if (!HgfsSetupNewChannel()) {
-         return NULL;
-      }
-   }
-
    req = os_zone_alloc(hgfsKReqZone, M_WAITOK);
    if (!req) {
       return NULL;
index 81928f6bca80e14ff2737c19d41b30fb1e9d18f4..0cbd6783639227f5e7ff06b4a4493287b3e52d24 100644 (file)
@@ -49,7 +49,6 @@ HgfsKReqWState hgfsKReqWorkerState;
 
 /* Global pointer that handles channel abstraction */
 HgfsTransportChannel *gHgfsChannel = NULL;
-OS_MUTEX_T *gHgfsChannelLock = NULL;
 
 
 /*
@@ -72,18 +71,11 @@ OS_MUTEX_T *gHgfsChannelLock = NULL;
  *----------------------------------------------------------------------
  */
 
-Bool
+static Bool
 HgfsSetupNewChannel(void)
 {
    Bool ret;
 
-   os_mutex_lock(gHgfsChannelLock);
-
-   if (gHgfsChannel->status == HGFS_CHANNEL_CONNECTED) {
-      ret = TRUE;
-      goto exit;
-   }
-
    HgfsGetVmciChannel(gHgfsChannel);
    if (gHgfsChannel->ops.open != NULL) {
       if ((ret = gHgfsChannel->ops.open(gHgfsChannel))) {
@@ -100,16 +92,10 @@ HgfsSetupNewChannel(void)
 exit:
    if (ret) {
       gHgfsChannel->status = HGFS_CHANNEL_CONNECTED;
-   } else {
-      gHgfsChannel->status = HGFS_CHANNEL_NOTCONNECTED;
    }
-
-   os_mutex_unlock(gHgfsChannelLock);
-
    return ret;
 }
 
-
 /*
  *-----------------------------------------------------------------------------
  *
@@ -142,14 +128,10 @@ HgfsKReqWorker(void *arg)
       goto exit;
    }
 
-   gHgfsChannelLock = os_mutex_alloc_init(HGFS_FS_NAME "_channellck");
-   if (!gHgfsChannelLock) {
-      goto exit;
-   }
-
    ret = HgfsSetupNewChannel();
    if (!ret) {
-      DEBUG(VM_DEBUG_INFO, "VMware hgfs: %s: ohoh no channel yet.\n", __func__);
+      DEBUG(VM_DEBUG_INFO, "VMware hgfs: %s: ohoh no channel.\n", __func__);
+      goto exit;
    }
 
    for (;;) {
@@ -196,11 +178,13 @@ HgfsKReqWorker(void *arg)
       switch (req->state) {
       case HGFS_REQ_SUBMITTED:
          if (gHgfsChannel->status != HGFS_CHANNEL_CONNECTED) {
-            req->state = HGFS_REQ_ERROR;
-            os_cv_signal(&req->stateCv);
-            os_mutex_unlock(req->stateLock);
-            os_mutex_unlock(hgfsKReqWorkItemLock);
-            goto done;
+            if (!HgfsSetupNewChannel()) {
+               req->state = HGFS_REQ_ERROR;
+               os_cv_signal(&req->stateCv);
+               os_mutex_unlock(req->stateLock);
+               os_mutex_unlock(hgfsKReqWorkItemLock);
+               goto done;
+            }
          }
          break;
       case HGFS_REQ_ABANDONED:
@@ -227,9 +211,7 @@ HgfsKReqWorker(void *arg)
           * now. We do this because subsequent requests deserve a chance to
           * reopen it.
           */
-         os_mutex_lock(gHgfsChannelLock);
          gHgfsChannel->ops.close(gHgfsChannel);
-         os_mutex_unlock(gHgfsChannelLock);
       }
 
 done:
@@ -266,15 +248,9 @@ done:
 
    ws->running = FALSE;
 
-   if (gHgfsChannel->status == HGFS_CHANNEL_CONNECTED) {
-      gHgfsChannel->ops.close(gHgfsChannel);
-   }
+   gHgfsChannel->ops.close(gHgfsChannel);
 
 exit:
-   if (gHgfsChannelLock) {
-      os_mutex_free(gHgfsChannelLock);
-   }
-
    if (gHgfsChannel) {
       os_free(gHgfsChannel, sizeof (*gHgfsChannel));
    }