From: Kruti Date: Fri, 23 Feb 2024 10:25:10 +0000 (-0800) Subject: Changes to common source files not applicable to open-vm-tools. X-Git-Tag: stable-12.4.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9769f7b4f90e5da0ee51b699b203e1e737e0b90;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/file.c b/open-vm-tools/lib/file/file.c index e6b6a52a8..ffe49417b 100644 --- a/open-vm-tools/lib/file/file.c +++ b/open-vm-tools/lib/file/file.c @@ -2822,13 +2822,15 @@ File_IsSubPathOf(const char *base, // IN: the base path to test against. } +#if !defined(VMX86_SERVER) + /* *--------------------------------------------------------------------------- * * File_DoesVolumeSupportConvertBlocks -- * * Does the volume support the new convert block allocation - * IOCTL? + * IOCTL? (Always FALSE for now on non-VMFS.) * * Results: * TRUE Yes @@ -2843,12 +2845,8 @@ File_IsSubPathOf(const char *base, // IN: the base path to test against. Bool File_DoesVolumeSupportConvertBlocks(const char *pathName) // IN: { -#if defined(VMX86_SERVER) - uint32 vmfsVersion; - return (File_GetVMFSVersion(pathName, &vmfsVersion) >= 0 && - vmfsVersion >= 6); -#else UNUSED_VARIABLE(pathName); return FALSE; -#endif } + +#endif diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index 78b4a42c8..eaf5da443 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -1655,6 +1655,48 @@ File_GetVMFSLockInfo(const char *path, // IN return ret; } + +/* + *--------------------------------------------------------------------------- + * + * File_DoesVolumeSupportConvertBlocks -- + * + * Does the volume support the new convert block allocation + * IOCTL? (Always FALSE for now on non-VMFS.) + * + * Results: + * TRUE Yes + * FALSE No + * + * Side effects: + * None + * + *--------------------------------------------------------------------------- + */ + +Bool +File_DoesVolumeSupportConvertBlocks(const char *pathName) // IN: +{ + Bool supports; + FS_PartitionListResult *fsAttrs = NULL; + int ret = File_GetVMFSAttributes(pathName, &fsAttrs); + + if (ret < 0) { + /* Probably not VMFS. */ + return FALSE; + } + + /* + * Only regular VMFS (no VMFS-L, VMFSOS, or other oddities) and + * only version 6 and above. + */ + supports = Str_Strcmp(fsAttrs->fsType, FS_VMFS_ON_ESX) == 0 && + fsAttrs->versionNumber >= 6; + + Posix_Free(fsAttrs); + return supports; +} + #endif // VMX86_SERVER