Log("%s: initialized notification %s.\n", __FUNCTION__,
(gHgfsDirNotifyActive ? "active" : "inactive"));
}
+ if (0 != (gHgfsCfgSettings.flags & HGFS_CONFIG_OPLOCK_ENABLED)) {
+ if (!HgfsServerOplockInit()) {
+ gHgfsCfgSettings.flags &= ~HGFS_CONFIG_OPLOCK_ENABLED;
+ }
+ }
gHgfsInitialized = TRUE;
} else {
HgfsServer_ExitState(); // Cleanup partially initialized state
{
gHgfsInitialized = FALSE;
+ if (0 != (gHgfsCfgSettings.flags & HGFS_CONFIG_OPLOCK_ENABLED)) {
+ HgfsServerOplockDestroy();
+ }
if (gHgfsDirNotifyActive) {
HgfsNotify_Exit();
gHgfsDirNotifyActive = FALSE;
if (info.maxPacketSize < session->maxPacketSize) {
session->maxPacketSize = info.maxPacketSize;
}
+
+ /*
+ * If the server is enabled for processing oplocks and the client
+ * is requesting to use them, then report back to the client oplocks
+ * are enabled by propagating the session flag.
+ */
+ if ((0 != (info.flags & HGFS_SESSION_OPLOCK_ENABLED)) &&
+ (0 != (gHgfsCfgSettings.flags & HGFS_CONFIG_OPLOCK_ENABLED))) {
+ session->flags |= HGFS_SESSION_OPLOCK_ENABLED;
+ }
+
if (HgfsPackCreateSessionReply(input->packet, input->metaPacket,
&replyPayloadSize, session)) {
status = HGFS_ERROR_SUCCESS;
#include "vmware_pack_end.h"
HgfsIdentity;
-typedef
-#include "vmware_pack_begin.h"
-struct HgfsRequestCreateSessionV4 {
- uint32 numCapabilities; /* Number of capabilities to follow. */
- uint32 maxPacketSize; /* Maximum packet size supported. */
- uint64 reserved; /* Reserved for future use. */
- HgfsCapability capabilities[1]; /* Array of HgfsCapabilities. */
-}
-#include "vmware_pack_end.h"
-HgfsRequestCreateSessionV4;
-
#define HGFS_INVALID_SESSION_ID (~((uint64)0))
/*
#define HGFS_SESSION_MAXPACKETSIZE_VALID (1 << 0)
#define HGFS_SESSION_CHANGENOTIFY_ENABLED (1 << 1)
+#define HGFS_SESSION_OPLOCK_ENABLED (1 << 2)
+
+typedef
+#include "vmware_pack_begin.h"
+struct HgfsRequestCreateSessionV4 {
+ uint32 numCapabilities; /* Number of capabilities to follow. */
+ uint32 maxPacketSize; /* Maximum packet size supported. */
+ HgfsSessionFlags flags; /* Session capability flags. */
+ uint32 reserved; /* Reserved for future use. */
+ HgfsCapability capabilities[1]; /* Array of HgfsCapabilities. */
+}
+#include "vmware_pack_end.h"
+HgfsRequestCreateSessionV4;
typedef
#include "vmware_pack_begin.h"