464
464
if (getcwd(buffer, FILE_MAXPATH) == NULL) {
465
465
Msg_Append(MSGID(filePosix.getcwd)
466
466
"Unable to retrieve the current working directory: %s. "
467
"Please check if the directory has been deleted or "
467
"Check if the directory has been deleted or "
469
469
Msg_ErrString());
470
470
Warning(LGPFX" %s: getcwd() failed: %s\n", __FUNCTION__,
1299
*----------------------------------------------------------------------
1301
* File_GetVMFSMountInfo --
1303
* Acquire the FS mount point info such as fsType, major version,
1304
* local mount point (/vmfs/volumes/xyz), and for NFS,
1305
* remote IP and remote mount point for a given file.
1308
* Integer return value and allocated data
1311
* Only implemented on ESX. Will fail on other platforms.
1312
* remoteIP and remoteMountPoint are only populated for files on NFS.
1314
*----------------------------------------------------------------------
1318
File_GetVMFSMountInfo(ConstUnicode pathName,
1322
char **remoteMountPoint,
1323
char **localMountPoint)
1327
FS_PartitionListResult *fsAttrs;
1329
*localMountPoint = File_GetUniqueFileSystemID(pathName);
1331
if (*localMountPoint == NULL) {
1335
// Get file IP and mount point
1336
ret = File_GetVMFSAttributes(pathName, &fsAttrs);
1337
if (ret >= 0 && fsAttrs) {
1338
*version = fsAttrs->versionNumber;
1339
*fsType = Util_SafeStrdup(fsAttrs->fsType);
1341
if (strncmp(fsAttrs->fsType, "NFS", sizeof("NFS")) == 0) {
1342
len = strlen(fsAttrs->logicalDevice);
1343
*remoteIP = Util_SafeMalloc(len);
1344
*remoteMountPoint = Util_SafeMalloc(len);
1345
sscanf(fsAttrs->logicalDevice, "%s %s", *remoteIP, *remoteMountPoint);
1348
*remoteMountPoint = NULL;
1792
#if defined(VMX86_SERVER)
1797
fs1 = Posix_RealPath(path1);
1798
fs2 = Posix_RealPath(path2);
1801
* ESX doesn't have real inodes for VMFS disks in User Worlds. So only
1802
* way to check if a file is the same is using real path. So said Satyam.
1805
if (fs1 && Unicode_StartsWith(fs1, VCFS_MOUNT_POINT)) {
1808
res = (!fs2 || Unicode_Compare(fs1, fs2) != 0) ? FALSE : TRUE;
1822
1853
* First take care of the easy checks. If the paths are identical, or if
1823
1854
* the inode numbers don't match, we're done.
2069
2100
* Check if the given file is on a VMFS supports such a file size
2071
* In the case of VMFS3/4, the largest supported file size is
2102
* In the case of VMFS3, the largest supported file size is
2072
2103
* 256 * 1024 * B bytes
2104
* VMFS5 supports larger file sizes.
2074
2106
* where B represents the blocksize in bytes
2111
2143
if (strcmp(fsType, "VMFS") == 0) {
2113
/* Get ready for VMFS4 and perform sanity check on version */
2114
ASSERT(version == 3 || version == 4);
2116
2145
maxFileSize = (VMFS3CONST * (uint64) blockSize * 1024);
2147
/* Get ready for 64 TB on VMFS5 and perform sanity check on version */
2148
ASSERT(version == 5);
2149
maxFileSize = (uint64) 0x400000000000ULL;
2119
2152
if (fileSize <= maxFileSize && maxFileSize != -1) {