]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common source file changes not directly applicable to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)
committerOliver Kurth <okurth@vmware.com>
Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)
open-vm-tools/lib/hgfsServer/Makefile.am
open-vm-tools/lib/hgfsServer/hgfsThreadpool.h [new file with mode: 0644]
open-vm-tools/lib/hgfsServer/hgfsThreadpoolStub.c [new file with mode: 0644]
open-vm-tools/lib/include/hgfsServer.h
open-vm-tools/lib/include/mutexRankLib.h

index 07150816a73b80994330372e4d93a9253e86c752..9936a56ec0359de81c8e76bad2c089cb8c300f82 100644 (file)
@@ -1,5 +1,5 @@
 ################################################################################
-### Copyright (C) 2007-2016 VMware, Inc.  All rights reserved.
+### Copyright (C) 2007-2016, 2020 VMware, Inc.  All rights reserved.
 ###
 ### This program is free software; you can redistribute it and/or modify
 ### it under the terms of version 2 of the GNU General Public License as
@@ -25,6 +25,7 @@ libHgfsServer_la_SOURCES += hgfsDirNotifyStub.c
 libHgfsServer_la_SOURCES += hgfsServerParameters.c
 libHgfsServer_la_SOURCES += hgfsServerOplock.c
 libHgfsServer_la_SOURCES += hgfsServerOplockLinux.c
+libHgfsServer_la_SOURCES += hgfsThreadpoolStub.c
 
 AM_CFLAGS =
 AM_CFLAGS += -DVMTOOLS_USE_GLIB
diff --git a/open-vm-tools/lib/hgfsServer/hgfsThreadpool.h b/open-vm-tools/lib/hgfsServer/hgfsThreadpool.h
new file mode 100644 (file)
index 0000000..a3ef53c
--- /dev/null
@@ -0,0 +1,49 @@
+/*********************************************************
+ * Copyright (C) 2020 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation version 2.1 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
+ *
+ *********************************************************/
+
+#ifndef _HGFS_THREADPOOL_H
+#define _HGFS_THREADPOOL_H
+
+/*
+ * hgfsThreadpool.h --
+ *
+ *     Function definitions for threadpool.
+ */
+
+#include "hgfsUtil.h"       // for HgfsInternalStatus
+#include "hgfsServerInt.h"  // for HgfsSessionInfo
+
+/*
+ * The maximum count of thread in threadpool.
+ * For Windows 10 guest, the file explorer issues 8 asynchronous request
+ * at one time.
+ * Please keep this value same with the PHYSMEM_HGFS_WORKER_THREADS
+ */
+#define HGFS_THREADPOOL_MAX_COUNT 10
+
+typedef void(*HgfsThreadpoolWorkItem)(void *data);
+
+HgfsInternalStatus HgfsThreadpool_Init(void);
+
+Bool HgfsThreadpool_Activate(void);
+void HgfsThreadpool_Deactivate(void);
+
+void HgfsThreadpool_Exit(void);
+Bool HgfsThreadpool_QueueWorkItem(HgfsThreadpoolWorkItem workItem, void *data);
+
+#endif // _HGFS_THREADPOOL_H
diff --git a/open-vm-tools/lib/hgfsServer/hgfsThreadpoolStub.c b/open-vm-tools/lib/hgfsServer/hgfsThreadpoolStub.c
new file mode 100644 (file)
index 0000000..9073527
--- /dev/null
@@ -0,0 +1,146 @@
+/*********************************************************
+ * Copyright (C) 2020 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation version 2.1 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
+ *
+ *********************************************************/
+
+/*
+ * hgfsThreadPoolStub.c --
+ *
+ *     Stubs for threadpool support, used to build guest components.
+ */
+
+#include "vmware.h"
+#include "vm_basic_types.h"
+#include "util.h"
+
+#include "hgfsProto.h"
+#include "hgfsServer.h"
+#include "hgfsThreadpool.h"
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * HgfsThreadpool_Init --
+ *
+ *    Initialization of the threadpool component.
+ *
+ * Results:
+ *    0 if success, error code otherwise.
+ *
+ * Side effects:
+ *    None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+HgfsInternalStatus
+HgfsThreadpool_Init(void)
+{
+   return HGFS_ERROR_NOT_SUPPORTED;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * HgfsThreadpool_Activate --
+ *
+ *    Activate the threadpool.
+ *
+ * Results:
+ *    Always return FALSE.
+ *
+ * Side effects:
+ *    None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+Bool
+HgfsThreadpool_Activate(void)
+{
+   return FALSE;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * HgfsThreadpool_Deactivate --
+ *
+ *    Deactivate the threadpool.
+ *
+ * Results:
+ *    None.
+ *
+ * Side effects:
+ *    None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+HgfsThreadpool_Deactivate(void)
+{
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * HgfsThreadpool_Exit --
+ *
+ *    Exit for the threadpool component.
+ *
+ * Results:
+ *    None.
+ *
+ * Side effects:
+ *    None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+HgfsThreadpool_Exit(void)
+{
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * HgfsThreadpool_QueueWorkItem --
+ *
+ *    Execute a work item.
+ *
+ * Results:
+ *    TRUE if the work item is queued successfully,
+ *    FALSE if the work item is not queued.
+ *
+ * Side effects:
+ *    None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+Bool
+HgfsThreadpool_QueueWorkItem(HgfsThreadpoolWorkItem workItem, // IN
+                             void *data)                      // IN
+{
+   return FALSE;
+}
+
index 4b1a5d2d79dfe2ad6eaa3c88856fe1e4a062cf57..da3510f7c723168328cf7d890c5f72dee0041f32 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2020 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -125,6 +125,7 @@ typedef uint32 HgfsConfigFlags;
 #define HGFS_CONFIG_VOL_INFO_MIN                     (1 << 2)
 #define HGFS_CONFIG_OPLOCK_ENABLED                   (1 << 3)
 #define HGFS_CONFIG_SHARE_ALL_HOST_DRIVES_ENABLED    (1 << 4)
+#define HGFS_CONFIG_THREADPOOL_ENABLED               (1 << 5)
 
 typedef struct HgfsServerConfig {
    HgfsConfigFlags flags;
@@ -167,6 +168,7 @@ typedef struct HgfsServerMgrCallbacks {
 } HgfsServerMgrCallbacks;
 
 typedef enum {
+   HGFS_QUIESCE_CHANNEL_FREEZE,  /*Op sent before the channel device quiesce*/
    HGFS_QUIESCE_FREEZE,
    HGFS_QUIESCE_THAW,
 } HgfsQuiesceOp;
index 3ce0d716513e751f658f5061f2658b7e936c3631..ddf0bd1f40d488e8c085e6d84fac313f010071b2 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2010-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2010-2020 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -63,6 +63,8 @@ extern "C" {
 #define RANK_hgfsFileIOLock          (RANK_libLockBase + 0x4050)
 #define RANK_hgfsSearchArrayLock     (RANK_libLockBase + 0x4060)
 #define RANK_hgfsNodeArrayLock       (RANK_libLockBase + 0x4070)
+#define RANK_hgfsActivateLock        (RANK_libLockBase + 0x4080)
+#define RANK_hgfsThreadpoolLock      (RANK_libLockBase + 0x4090)
 
 /*
  * vigor (must be < VMDB range and < disklib, see bug 741290)