From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:42 +0000 (-0700) Subject: Hgfs Server: Remove the register share callback and usage part 2 X-Git-Tag: stable-10.2.0~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=888d4a7a8394e4391b9abb09b3884f7e1d5971b9;p=thirdparty%2Fopen-vm-tools.git Hgfs Server: Remove the register share callback and usage part 2 Now the function is not being called at all it is time to remove it along with the callback table entry for it. --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 22bc566f8..31733218d 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -234,9 +234,6 @@ static void HgfsServerSessionInvalidateObjects(void *clientData, DblLnkLst_Links *shares); static uint32 HgfsServerSessionInvalidateInactiveSessions(void *clientData); static void HgfsServerSessionSendComplete(HgfsPacket *packet, void *clientData); -static HgfsSharedFolderHandle HgfsServerRegisterShare(const char *shareName, - const char *sharePath, - Bool addFolder); /* * Callback table passed to transport and any channels. @@ -251,7 +248,6 @@ static const HgfsServerCallbacks gHgfsServerCBTable = { HgfsServerSessionInvalidateInactiveSessions, HgfsServerSessionSendComplete, }, - HgfsServerRegisterShare, }; /* Lock that protects shared folders list. */ @@ -3797,47 +3793,6 @@ HgfsServerSharesReset(DblLnkLst_Links *newSharesList) // IN: List of new shares } -/* - *----------------------------------------------------------------------------- - * - * HgfsServerRegisterShare -- - * - * This is a callback function which is invoked by hgfsServerManagement - * for every shared folder when something changed in shared folders - * configuration. The function iterates through the list of existing - * shared folders trying to locate an entry with the shareName. If the - * entry is found the function returns corresponding handle. Otherwise - * it creates a new entry and assigns a new handle to it. - * - * Currently there is no notification that a shared folder has been - * deleted. The only way to find out that a shred folder is deleted - * is to notice that it is not enumerated any more. Thus an explicit - * "end of list" notification is needed. "sharedFolder == NULL" notifies - * that enumeration is completed which allows to delete all shared - * folders that were not mentioned during current enumeration. - * - * Results: - * HgfsSharedFolderHandle for the entry. - * - * Side effects: - * May add an entry to known shared folders list. - * - *----------------------------------------------------------------------------- - */ - -static HgfsSharedFolderHandle -HgfsServerRegisterShare(const char *shareName, // IN: shared folder name - const char *sharePath, // IN: shared folder path - Bool addFolder) // IN: add or remove folder -{ - HgfsSharedFolderHandle result = HGFS_INVALID_FOLDER_HANDLE; - LOG(8, ("%s: %s, %s, %s exit %#x\n",__FUNCTION__, - (shareName ? shareName : "NULL"), (sharePath ? sharePath : "NULL"), - (addFolder ? "add" : "remove"), result)); - return result; -} - - /* *----------------------------------------------------------------------------- * diff --git a/open-vm-tools/lib/include/hgfsServer.h b/open-vm-tools/lib/include/hgfsServer.h index dc9a0c621..5fca45962 100644 --- a/open-vm-tools/lib/include/hgfsServer.h +++ b/open-vm-tools/lib/include/hgfsServer.h @@ -134,9 +134,6 @@ typedef struct HgfsServerConfig { typedef uint32 HgfsSharedFolderHandle; #define HGFS_INVALID_FOLDER_HANDLE ((HgfsSharedFolderHandle)~((HgfsSharedFolderHandle)0)) -typedef HgfsSharedFolderHandle (*HgfsRegisterSharedFolderFunc)(const char *shareName, - const char *sharePath, - Bool addFolder); /* * Callback functions to enumerate the share resources. * Filled in by the HGFS server policy and passed in to the HGFS server @@ -197,9 +194,9 @@ typedef struct HgfsServerSessionCallbacks { void (*sendComplete)(HgfsPacket *, void *); } HgfsServerSessionCallbacks; +/* XXX: TODO delete this layer if no other non-session callbacks are required. */ typedef struct HgfsServerCallbacks { HgfsServerSessionCallbacks session; - HgfsRegisterSharedFolderFunc registerShare; } HgfsServerCallbacks; Bool HgfsServer_InitState(const HgfsServerCallbacks **,