From: Oliver Kurth Date: Tue, 27 Aug 2019 19:55:37 +0000 (-0700) Subject: Get rid of PhysMem's thread registration calls for most threads. X-Git-Tag: stable-11.1.0~260 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cde21bb94ee55616d81b9a0f8d7e9c5eaf02be8;p=thirdparty%2Fopen-vm-tools.git Get rid of PhysMem's thread registration calls for most threads. A previous change eliminated the need to register threads before doing a PPN to BPN conversion on them. This change removes some of the remaining infrastructure. --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsDirNotify.h b/open-vm-tools/lib/hgfsServer/hgfsDirNotify.h index 4fe9daeef..0283497d6 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsDirNotify.h +++ b/open-vm-tools/lib/hgfsServer/hgfsDirNotify.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2009-2019 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 @@ -50,8 +50,6 @@ typedef enum { } HgfsNotifyActivateReason; /* These are the callbacks that are implemented in hgfsServer.c */ -typedef void (*HgfsNotifyRegisterThreadCb)(struct HgfsSessionInfo *session); -typedef void (*HgfsNotifyUnregisterThreadCb)(struct HgfsSessionInfo *session); typedef void (*HgfsNotifyEventReceiveCb)(HgfsSharedFolderHandle sharedFolder, HgfsSubscriberHandle subscriber, char *name, @@ -59,8 +57,6 @@ typedef void (*HgfsNotifyEventReceiveCb)(HgfsSharedFolderHandle sharedFolder, struct HgfsSessionInfo *session); typedef struct HgfsServerNotifyCallbacks { - HgfsNotifyRegisterThreadCb registerThread; - HgfsNotifyUnregisterThreadCb unregisterThread; HgfsNotifyEventReceiveCb eventReceive; } HgfsServerNotifyCallbacks; diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 462245511..c404047f2 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -246,8 +246,6 @@ static const HgfsServerCallbacks gHgfsServerCBTable = { }; -static void HgfsServerNotifyRegisterThreadCb(struct HgfsSessionInfo *session); -static void HgfsServerNotifyUnregisterThreadCb(struct HgfsSessionInfo *session); static void HgfsServerNotifyReceiveEventCb(HgfsSharedFolderHandle sharedFolder, HgfsSubscriberHandle subscriber, char* fileName, @@ -258,8 +256,6 @@ static void HgfsServerNotifyReceiveEventCb(HgfsSharedFolderHandle sharedFolder, * Callback table passed to the directory change notification component. */ static const HgfsServerNotifyCallbacks gHgfsServerNotifyCBTable = { - HgfsServerNotifyRegisterThreadCb, - HgfsServerNotifyUnregisterThreadCb, HgfsServerNotifyReceiveEventCb, }; @@ -9227,76 +9223,6 @@ HgfsServerGetTargetRelativePath(const char* source, // IN: source file name } -/* - *----------------------------------------------------------------------------- - * - * HgfsServerNotifyRegisterThreadCb -- - * - * The callback is invoked by the file system change notification component - * thread for generating change notification events. - * This simply calls back to the channel's register thread function, if present, - * which does the actual work. - * - * Results: - * None. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static void -HgfsServerNotifyRegisterThreadCb(struct HgfsSessionInfo *session) // IN: session info -{ - HgfsTransportSessionInfo *transportSession; - - ASSERT(session); - transportSession = session->transportSession; - - LOG(4, ("%s: Registering thread on session %"FMT64"x\n", __FUNCTION__, session->sessionId)); - - if (transportSession->channelCbTable->registerThread != NULL) { - transportSession->channelCbTable->registerThread(); - } -} - - -/* - *----------------------------------------------------------------------------- - * - * HgfsServerNotifyUnregisterThreadCb -- - * - * The callback is invoked by the file system change notification component - * thread for generating change notification events. - * This simply calls back to the channel's unregister thread function, if present, - * which does the actual work. - * - * Results: - * None. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static void -HgfsServerNotifyUnregisterThreadCb(struct HgfsSessionInfo *session) // IN: session info -{ - HgfsTransportSessionInfo *transportSession; - - ASSERT(session); - transportSession = session->transportSession; - - LOG(4, ("%s: Unregistering thread on session %"FMT64"x\n", __FUNCTION__, session->sessionId)); - - if (transportSession->channelCbTable->unregisterThread != NULL) { - transportSession->channelCbTable->unregisterThread(); - } -} - - /* *----------------------------------------------------------------------------- * diff --git a/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuestBd.c b/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuestBd.c index 844635d24..6da64ed37 100644 --- a/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuestBd.c +++ b/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuestBd.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2017,2019 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 @@ -347,8 +347,6 @@ HgfsChannelGuestConnConnect(HgfsGuestConn *connData) // IN: our connection data HGFS_LARGE_PACKET_MAX }; - connData->channelCbTable.registerThread = NULL; - connData->channelCbTable.unregisterThread = NULL; connData->channelCbTable.getWriteVa = NULL; connData->channelCbTable.getReadVa = NULL; connData->channelCbTable.putVa = NULL; diff --git a/open-vm-tools/lib/include/hgfsServer.h b/open-vm-tools/lib/include/hgfsServer.h index 37bd54d55..4b1a5d2d7 100644 --- a/open-vm-tools/lib/include/hgfsServer.h +++ b/open-vm-tools/lib/include/hgfsServer.h @@ -186,8 +186,6 @@ typedef void (*HgfsChannelRegisterThreadFunc)(void); typedef void (*HgfsChannelUnregisterThreadFunc)(void); typedef struct HgfsServerChannelCallbacks { - HgfsChannelRegisterThreadFunc registerThread; - HgfsChannelUnregisterThreadFunc unregisterThread; HgfsChannelMapVirtAddrFunc getReadVa; HgfsChannelMapVirtAddrFunc getWriteVa; HgfsChannelUnmapVirtAddrFunc putVa;