]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common source files not applicable to open-vm-tools.
authorKruti <kpendharkar@vmware.com>
Fri, 23 Feb 2024 10:25:10 +0000 (02:25 -0800)
committerKruti <kpendharkar@vmware.com>
Fri, 23 Feb 2024 10:25:10 +0000 (02:25 -0800)
open-vm-tools/lib/file/file.c
open-vm-tools/lib/file/filePosix.c

index e6b6a52a8dd02f925792f741479f210e2be1f7de..ffe49417b98b1d01da1105dbdbf43253289b5312 100644 (file)
@@ -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
index 78b4a42c8887e09193ed0242120b6c6fde5093c6..eaf5da443cd9538a8ad3a1436c12d2f1c515f634 100644 (file)
@@ -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