kiss-repository

personal kiss repository
git clone git://git.ckyln.com/~cem/kiss-repository.git
Log | Files | Refs | Submodules | README | LICENSE

nvi-18-dbpagesize_binpower.patch (740B)


      1 #! /bin/sh /usr/share/dpatch/dpatch-run
      2 ## 18dbpagesize_binpower.dpatch by  <hesso@pool.math.tu-berlin.de>
      3 ##
      4 ## DP: Make sure that the pagesize passed to db__set_pagesize() is
      5 ## DP: a power of two.
      6 
      7 @DPATCH@
      8 --- nvi-1.81.6.orig/common/exf.c	2009-03-09 01:48:01.695862889 +0100
      9 +++ nvi-1.81.6/common/exf.c	2009-03-09 10:42:41.147866272 +0100
     10 @@ -249,11 +249,10 @@
     11  		 * (vi should have good locality) or smaller than 1K.
     12  		 */
     13  		psize = ((sb.st_size / 15) + 1023) / 1024;
     14 -		if (psize > 10)
     15 -			psize = 10;
     16 -		if (psize == 0)
     17 -			psize = 1;
     18 -		psize *= 1024;
     19 +		if (psize >= 8) psize=8<<10;
     20 +		else if (psize >= 4) psize=4<<10;
     21 +		else if (psize >= 2) psize=2<<10;
     22 +		else psize=1<<10;
     23  
     24  		F_SET(ep, F_DEVSET);
     25  		ep->mdev = sb.st_dev;