This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Increase st_blksize to 64k


On Tue, Jan 02, 2007 at 12:04:49PM -0600, Brian Ford wrote:
>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.

I don't see how replacing the constant "S_BLKSIZE" with what seems to be
an unrelated getpagesize () makes a lot of sense.  Assuming that this is
a good idea, should S_BLKSIZE be changed directly?

cgf

>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]