Commit b0192cfe authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Hardcode the filesystem cluster size to avoid trouble on NFS.

parent 5c2fd1b1
...@@ -2244,6 +2244,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io ...@@ -2244,6 +2244,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
} }
else else
{ {
ULONGLONG bsize;
/* Linux's fstatvfs is buggy */ /* Linux's fstatvfs is buggy */
#if !defined(linux) || !defined(HAVE_FSTATFS) #if !defined(linux) || !defined(HAVE_FSTATFS)
struct statvfs stfs; struct statvfs stfs;
...@@ -2253,7 +2254,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io ...@@ -2253,7 +2254,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
io->u.Status = FILE_GetNtStatus(); io->u.Status = FILE_GetNtStatus();
break; break;
} }
info->BytesPerSector = stfs.f_frsize; bsize = stfs.f_frsize;
#else #else
struct statfs stfs; struct statfs stfs;
if (fstatfs( fd, &stfs ) < 0) if (fstatfs( fd, &stfs ) < 0)
...@@ -2261,11 +2262,12 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io ...@@ -2261,11 +2262,12 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
io->u.Status = FILE_GetNtStatus(); io->u.Status = FILE_GetNtStatus();
break; break;
} }
info->BytesPerSector = stfs.f_bsize; bsize = stfs.f_bsize;
#endif #endif
info->TotalAllocationUnits.QuadPart = stfs.f_blocks; info->BytesPerSector = 512;
info->AvailableAllocationUnits.QuadPart = stfs.f_bavail; info->SectorsPerAllocationUnit = 8;
info->SectorsPerAllocationUnit = 1; info->TotalAllocationUnits.QuadPart = bsize * stfs.f_blocks / (512 * 8);
info->AvailableAllocationUnits.QuadPart = bsize * stfs.f_bavail / (512 * 8);
io->Information = sizeof(*info); io->Information = sizeof(*info);
io->u.Status = STATUS_SUCCESS; io->u.Status = STATUS_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment