Increase st_blksize to 64k

Brian Ford Brian.Ford@FlightSafety.com
Tue Jan 2 18:05:00 GMT 2007


As suggested here:

http://cygwin.com/ml/cygwin/2006-12/msg00911.html

2007-01-02  Brian Ford  <Brian.Ford@FlightSafety.com>

	* fhandler.cc (fhandler_base::fstat): Use system page size (64k)
	as the st_blksize prefered I/O size for improved performance.
	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Likewise.

-- 
Brian Ford
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained crew...

-------------- next part --------------
Index: fhandler.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler.cc,v
retrieving revision 1.273
diff -u -p -r1.273 fhandler.cc
--- fhandler.cc	11 Dec 2006 18:55:28 -0000	1.273
+++ fhandler.cc	2 Jan 2007 17:55:07 -0000
@@ -1328,7 +1328,7 @@ fhandler_base::fstat (struct __stat64 *b
   buf->st_uid = geteuid32 ();
   buf->st_gid = getegid32 ();
   buf->st_nlink = 1;
-  buf->st_blksize = S_BLKSIZE;
+  buf->st_blksize = getpagesize ();
   time_as_timestruc_t (&buf->st_ctim);
   buf->st_atim = buf->st_mtim = buf->st_ctim;
   return 0;
Index: fhandler_disk_file.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_disk_file.cc,v
retrieving revision 1.200
diff -u -p -r1.200 fhandler_disk_file.cc
--- fhandler_disk_file.cc	21 Dec 2006 10:59:47 -0000	1.200
+++ fhandler_disk_file.cc	2 Jan 2007 17:55:07 -0000
@@ -436,7 +436,7 @@ fhandler_base::fstat_helper (struct __st
   else
     buf->st_ino = get_namehash ();
 
-  buf->st_blksize = S_BLKSIZE;
+  buf->st_blksize = getpagesize ();
 
   if (nAllocSize >= 0LL)
     /* A successful NtQueryInformationFile returns the allocation size


More information about the Cygwin-patches mailing list