1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Some *very* major changes by darrenk@insightdist.com (Darren King)

==========================================
What follows is a set of diffs that cleans up the usage of BLCKSZ.

As a side effect, the person compiling the code can change the
value of BLCKSZ _at_their_own_risk_.  By that, I mean that I've
tried it here at 4096 and 16384 with no ill-effects.  A value
of 4096 _shouldn't_ affect much as far as the kernel/file system
goes, but making it bigger than 8192 can have severe consequences
if you don't know what you're doing.  16394 worked for me, _BUT_
when I went to 32768 and did an initdb, the SCSI driver broke and
the partition that I was running under went to hell in a hand
basket. Had to reboot and do a good bit of fsck'ing to fix things up.

The patch can be safely applied though.  Just leave BLCKSZ = 8192
and everything is as before.  It basically only cleans up all of the
references to BLCKSZ in the code.

If this patch is applied, a comment in the config.h file though above
the BLCKSZ define with warning about monkeying around with it would
be a good idea.

Darren  darrenk@insightdist.com

(Also cleans up some of the #includes in files referencing BLCKSZ.)
==========================================
This commit is contained in:
Marc G. Fournier
1998-01-13 04:05:12 +00:00
parent f0445dcbc4
commit 374bb5d261
15 changed files with 156 additions and 167 deletions

View File

@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.16 1998/01/07 21:04:54 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.17 1998/01/13 04:04:20 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -39,7 +39,6 @@
#include "storage/spin.h"
#include "storage/smgr.h"
#include "storage/lmgr.h"
#include "storage/buf_internals.h"
#include "miscadmin.h"
#include "utils/builtins.h"
#include "utils/hsearch.h"

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.26 1998/01/07 21:05:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.27 1998/01/13 04:04:31 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,14 +20,12 @@
#include "postgres.h"
#include "miscadmin.h" /* for DataDir */
#include "catalog/catalog.h"
#include "storage/block.h"
#include "storage/fd.h"
#include "storage/smgr.h" /* where the declarations go */
#include "storage/fd.h"
#include "utils/mcxt.h"
#include "utils/rel.h"
#include "utils/palloc.h"
#include "catalog/catalog.h"
#undef DIAGNOSTIC
@@ -59,7 +57,22 @@ static MemoryContext MdCxt;
#define MDFD_DIRTY (uint16) 0x01
#define MDFD_FREE (uint16) 0x02
#define RELSEG_SIZE 262144 /* (2 ** 31) / 8192 -- 2GB file */
/*
* RELSEG_SIZE appears to be the number of segments that can
* be in a disk file. It was defined as 262144 based on 8k
* blocks, but now that the block size can be changed, this
* has to be calculated at compile time. Otherwise, the file
* size limit would not work out to 2-gig (2147483648).
*
* The number needs to be (2 ** 31) / BLCKSZ, but to be keep
* the math under MAXINT, pre-divide by 256 and use ...
*
* (((2 ** 23) / BLCKSZ) * (2 ** 8))
*
* 07 Jan 98 darrenk
*/
#define RELSEG_SIZE ((8388608 / BLCKSZ) * 256)
/* routines declared here */
static MdfdVec *_mdfd_openseg(Relation reln, int segno, int oflags);