From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:51 +0000 (-0700) Subject: Changes to common source files; not applicable to open-vm-tools. X-Git-Tag: stable-10.2.0~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22c3f23f55153f08e788db6c4ae7a96d555ed8ca;p=thirdparty%2Fopen-vm-tools.git Changes to common source files; not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c index c8ed34201..1d16075a7 100644 --- a/open-vm-tools/lib/file/fileIOPosix.c +++ b/open-vm-tools/lib/file/fileIOPosix.c @@ -834,7 +834,9 @@ FileIOCreateRetry(FileIODescriptor *file, // OUT: } #elif defined(__linux__) if (HostType_OSIsVMK()) { - if ((access & FILEIO_OPEN_MULTIWRITER_LOCK) != 0) { + if ((access & FILEIO_OPEN_SWMR_LOCK) != 0) { + flags |= O_SWMR_LOCK; + } else if ((access & FILEIO_OPEN_MULTIWRITER_LOCK) != 0) { flags |= O_MULTIWRITER_LOCK; } else if ((access & FILEIO_OPEN_LOCK_MANDATORY) != 0) { flags |= O_EXCLUSIVE_LOCK; diff --git a/open-vm-tools/lib/include/fileIO.h b/open-vm-tools/lib/include/fileIO.h index 47f9f1a62..3da90143f 100644 --- a/open-vm-tools/lib/include/fileIO.h +++ b/open-vm-tools/lib/include/fileIO.h @@ -140,7 +140,7 @@ typedef enum { * unshare the flags between the two at which point this could be fixed. * --Tommy */ -#define FILEIO_OPEN_PRIVILEGED_IOCTL (1 << 12) +#define FILEIO_OPEN_PRIVILEGED_IOCTL (1 << 12) /* * Lock the file on open with a exclusive leased lock that can be broken * (supported on ESX file systems) @@ -151,6 +151,11 @@ typedef enum { * (supported on ESX file systems) */ #define FILEIO_OPEN_MULTIWRITER_LOCK (1 << 14) +/* + * Lock the file on open with an SWMR leased lock that can be broken + * (supported on ESX file systems) + */ +#define FILEIO_OPEN_SWMR_LOCK (1 << 15) /* * Valid only for MacOS. It eventually results into O_EXLOCK flag passed to open * system call. @@ -173,11 +178,11 @@ typedef enum { /* * Valid only on POSIXen. Don't follow a symbolic link. */ -#define FILEIO_OPEN_ACCESS_NOFOLLOW (1 << 18) +#define FILEIO_OPEN_ACCESS_NOFOLLOW (1 << 18) /* * Valid only on Windows. Set FILE_SHARE_DELETE. */ -#define FILEIO_OPEN_SHARE_DELETE (1 << 19) +#define FILEIO_OPEN_SHARE_DELETE (1 << 19) /* * Strengths of file lock. * Advisory: @@ -190,9 +195,15 @@ typedef enum { * Adaptively picks between mandatory and advisory. * Almost all cases should use the "best" lock. */ -#define FILEIO_OPEN_LOCK_BEST FILEIO_OPEN_LOCKED /* historical */ -#define FILEIO_OPEN_LOCK_ADVISORY (1 << 20) -#define FILEIO_OPEN_LOCK_MANDATORY (1 << 21) +#define FILEIO_OPEN_LOCK_BEST FILEIO_OPEN_LOCKED /* historical */ +#define FILEIO_OPEN_LOCK_ADVISORY (1 << 20) +#define FILEIO_OPEN_LOCK_MANDATORY (1 << 21) + +/* + * Flag passed to open() to enable use of swmr-reader locks on VMFS. This + * definition must match USEROBJ_OPEN_SWMR_LOCK in user_vsiTypes.h. + */ +#define O_SWMR_LOCK (1 << 21) // 0x00200000 /* * OPTIMISTIC is an alternative to EXCLUSIVE and MANDATORY. It applies @@ -200,19 +211,19 @@ typedef enum { * called "optimistic" to speed up opens. Rule-of-thumb is to use it * only for read-only opens of small files (< 1KB). */ -#define FILEIO_OPEN_OPTIMISTIC_LOCK (1 << 22) // 0x00400000 +#define FILEIO_OPEN_OPTIMISTIC_LOCK (1 << 22) // 0x00400000 /* * Flag passed to open() to enable use of oplocks on VMFS. This definition * must match USEROBJ_OPEN_OPTIMISTIC_LOCK in user_vsiTypes.h. */ -#define O_OPTIMISTIC_LOCK (1 << 22) // 0x00400000 +#define O_OPTIMISTIC_LOCK (1 << 22) // 0x00400000 /* * POSIX specific close the file descriptor when the program uses a variant * of the exec system call capability. This is useful in fork/exec scenarios. */ -#define FILEIO_OPEN_CLOSE_ON_EXEC (1 << 23) // 0x00800000 +#define FILEIO_OPEN_CLOSE_ON_EXEC (1 << 23) // 0x00800000 /* * Flag passed to open() to not attempt to get the LUN attributes as part of @@ -220,21 +231,21 @@ typedef enum { * definition must match the definition of USEROBJ_OPEN_NOATTR in * user_vsiTypes.h and FS_OPEN_NOATTR in fs_public.h */ -#define O_NOATTR (1 << 26) // 0x04000000 +#define O_NOATTR (1 << 26) // 0x04000000 /* * Flag passed to open() to get multiwriter VMFS lock. This definition must * match USEROBJ_OPEN_MULTIWRITER_LOCK in user_vsiTypes.h. */ -#define O_MULTIWRITER_LOCK (1 << 27) // 0x08000000 +#define O_MULTIWRITER_LOCK (1 << 27) // 0x08000000 /* * Flag passed to open() to get exclusive VMFS lock. This definition must * match USEROBJ_OPEN_EXCLUSIVE_LOCK in user_vsiTypes.h. */ -#define O_EXCLUSIVE_LOCK (1 << 28) // 0x10000000 +#define O_EXCLUSIVE_LOCK (1 << 28) // 0x10000000 /* File Access check args */ #define FILEIO_ACCESS_READ (1 << 0) diff --git a/open-vm-tools/lib/include/vm_product_versions.h b/open-vm-tools/lib/include/vm_product_versions.h index b37db8d73..2dbd67307 100644 --- a/open-vm-tools/lib/include/vm_product_versions.h +++ b/open-vm-tools/lib/include/vm_product_versions.h @@ -37,7 +37,7 @@ * versioning is correct. */ #if defined(VMX86_VIEWCLIENT) - #define PRODUCT_VERSION 4,5,1,PRODUCT_BUILD_NUMBER_NUMERIC + #define PRODUCT_VERSION 4,6,0,PRODUCT_BUILD_NUMBER_NUMERIC #elif defined(VMX86_VMRC) /* check VMX86_VMRC before VMX86_DESKTOP */ #define PRODUCT_VERSION 10,0,1,PRODUCT_BUILD_NUMBER_NUMERIC /* VMRC_VERSION_NUMBER below has to match this */ #elif defined(VMX86_FLEX) /* check VMX86_FLEX before VMX86_DESKTOP */ @@ -267,7 +267,7 @@ #define PRECHECK_VERSION "e.x.p" #define VIEW_FEATUREPACK_VERSION "5.2.0" #define VIEW_CLIENT_VERSION_NUMBER "4.5.1" -#define VIEW_CLIENT_VERSION "4.5.1" +#define VIEW_CLIENT_VERSION "4.6.0" #define VHSESDK_VERSION "1.0.0" #define RDE_RFT_ALL_VERSION "4.0.0" #define RDESDK_VERSION "2.0.0"