postgresql/src/include/storage/itemid.h
Marc G. Fournier 374bb5d261 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.)
==========================================
1998-01-13 04:05:12 +00:00

77 lines
1.5 KiB
C

/*-------------------------------------------------------------------------
*
* itemid.h--
* Standard POSTGRES buffer page item identifier definitions.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: itemid.h,v 1.5 1998/01/13 04:05:12 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef ITEMID_H
#define ITEMID_H
typedef uint16 ItemOffset;
typedef uint16 ItemLength;
typedef bits16 ItemIdFlags;
typedef struct ItemIdData
{ /* line pointers */
unsigned lp_off:15, /* offset to find tup */
/* can be reduced by 2 if necc. */
lp_flags:2, /* flags on tuple */
lp_len:15; /* length of tuple */
} ItemIdData;
typedef struct ItemIdData *ItemId;
#ifndef LP_USED
#define LP_USED 0x01 /* this line pointer is being used */
#endif
/* ----------------
* support macros
* ----------------
*/
/*
* ItemIdGetLength
*/
#define ItemIdGetLength(itemId) \
((itemId)->lp_len)
/*
* ItemIdGetOffset
*/
#define ItemIdGetOffset(itemId) \
((itemId)->lp_off)
/*
* ItemIdGetFlags
*/
#define ItemIdGetFlags(itemId) \
((itemId)->lp_flags)
/*
* ItemIdIsValid --
* True iff disk item identifier is valid.
*/
#define ItemIdIsValid(itemId) PointerIsValid(itemId)
/*
* ItemIdIsUsed --
* True iff disk item identifier is in use.
*
* Note:
* Assumes disk item identifier is valid.
*/
#define ItemIdIsUsed(itemId) \
(AssertMacro(ItemIdIsValid(itemId)) ? \
(bool) (((itemId)->lp_flags & LP_USED) != 0) : false)
#endif /* ITEMID_H */