Alexandre Julliard : ntdll: Hardcode the filesystem cluster size to avoid trouble on NFS.
Alexandre Julliard
julliard at winehq.org
Thu Sep 25 10:30:12 CDT 2008
Module: wine
Branch: stable
Commit: b372ec2cbd0dfcd3ba86819af9c63b533bf5f451
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b372ec2cbd0dfcd3ba86819af9c63b533bf5f451
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Sep 16 11:32:38 2008 +0200
ntdll: Hardcode the filesystem cluster size to avoid trouble on NFS.
(cherry picked from commit b0192cfed382c470e67aaac744de56011fe27bfb)
---
dlls/ntdll/file.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 972d600..3c7fac5 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -2221,6 +2221,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
}
else
{
+ ULONGLONG bsize;
/* Linux's fstatvfs is buggy */
#if !defined(linux) || !defined(HAVE_FSTATFS)
struct statvfs stfs;
@@ -2230,7 +2231,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
io->u.Status = FILE_GetNtStatus();
break;
}
- info->BytesPerSector = stfs.f_frsize;
+ bsize = stfs.f_frsize;
#else
struct statfs stfs;
if (fstatfs( fd, &stfs ) < 0)
@@ -2238,11 +2239,12 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
io->u.Status = FILE_GetNtStatus();
break;
}
- info->BytesPerSector = stfs.f_bsize;
+ bsize = stfs.f_bsize;
#endif
- info->TotalAllocationUnits.QuadPart = stfs.f_blocks;
- info->AvailableAllocationUnits.QuadPart = stfs.f_bavail;
- info->SectorsPerAllocationUnit = 1;
+ info->BytesPerSector = 512;
+ info->SectorsPerAllocationUnit = 8;
+ info->TotalAllocationUnits.QuadPart = bsize * stfs.f_blocks / (512 * 8);
+ info->AvailableAllocationUnits.QuadPart = bsize * stfs.f_bavail / (512 * 8);
io->Information = sizeof(*info);
io->u.Status = STATUS_SUCCESS;
}
More information about the wine-cvs
mailing list