head	1.6;
access;
symbols;
locks; strict;
comment	@ * @;


1.6
date	92.05.28.20.29.10;	author mer;	state Exp;
branches;
next	1.5;

1.5
date	91.11.14.19.38.11;	author kemnitz;	state Exp;
branches;
next	1.4;

1.4
date	91.11.08.15.44.34;	author kemnitz;	state Exp;
branches;
next	1.3;

1.3
date	91.08.29.23.49.37;	author mer;	state Exp;
branches;
next	1.2;

1.2
date	91.08.06.12.24.46;	author mer;	state Exp;
branches;
next	1.1;

1.1
date	91.08.01.10.58.25;	author mer;	state Exp;
branches;
next	;


desc
@moved from lib/H/utils
@


1.6
log
@TransactionIdData type no longer exists (WARNING xids now 4 bytes!!!)
@
text
@/*
 * lmgr.h --
 *	POSTGRES lock manager definitions.
 *
 * Identification:
 *	$Header: /private/mer/pg.latest/src/lib/H/storage/RCS/lmgr.h,v 1.5 1991/11/14 19:38:11 kemnitz Exp mer $
 */

#ifndef	LMgrIncluded	/* Include this file only once */
#define LMgrIncluded	1

#include "tmp/postgres.h"

#include "storage/itemptr.h"
#include "storage/part.h"
#include "storage/lock.h"
#include "utils/rel.h"

/* 
 * This was moved from pladt.h for the new lock manager.  Want to obsolete
 * all of the old code.
 */
typedef struct LRelId {
    ObjectId	 relId;     /* a relation identifier */
    ObjectId     dbId;      /* a database identifier */
} LRelId;

typedef struct LockInfoData  {
        bool                    initialized;
        LRelId                  lRelId;
        TransactionId           transactionIdData;
        uint16                  flags;
} LockInfoData;
typedef LockInfoData    *LockInfo;

#define LockInfoIsValid(linfo) \
	((PointerIsValid(linfo)) &&  ((LockInfo) linfo)->initialized)
/*
 * RelationGetLRelId --
 *	Returns "lock" relation identifier for a relation.
 */
extern
LRelId
RelationGetLRelId ARGS((
	Relation	relation
));

/*
 * LRelIdGetDatabaseId --
 *	Returns database identifier for a "lock" relation identifier.
 */
extern
ObjectId
LRelIdGetDatabaseId ARGS((
	LRelId  lRelId
));

/*
 * LRelIdGetRelationId --
 *	Returns relation identifier for a "lock" relation identifier.
 */
extern
ObjectId
LRelIdGetRelationId ARGS((
	LRelId	relation
));

/*
 * DatabaseIdIsMyDatabaseId --
 *	True iff database object identifier is valid in my present database.
 */
extern
bool
DatabaseIdIsMyDatabaseId ARGS((
	ObjectId	databaseId
));

/*
 * LRelIdContainsMyDatabaseId --
 *	True iff "lock" relation identifier is valid in my present database.
 */
extern
bool
LRelIdContainsMyDatabaseId ARGS((
	LRelId	lRelId
));

/*
 * RelationInitLockInfo --
 *	Initializes the lock information in a relation descriptor.
 */
extern
void
RelationInitLockInfo ARGS((
	Relation	relation
));

/*
 * RelationDiscardLockInfo --
 *	Discards the lock information in a relation descriptor.
 */
extern
void
RelationDiscardLockInfo ARGS((
	Relation	relation
));

/*
 * RelationSetLockForDescriptorOpen --
 *	Sets read locks for a relation descriptor.
 */
extern
void
RelationSetLockForDescriptorOpen ARGS((
	Relation	relation
));

/*
 * RelationSetLockForRead --
 *	Sets relation level read lock.
 */
extern
void
RelationSetLockForRead ARGS((
	Relation	relation
));

/*
 * RelationSetLockForWrite --
 *	Sets relation level write lock.
 */
extern
void
RelationSetLockForWrite ARGS((
	Relation	relation
));

/*
 * RelationUnsetLockForRead --
 *	Unsets relation level read lock.
 */
extern
void
RelationUnsetLockForRead ARGS((
	Relation	relation
));

/*
 * RelationUnsetLockForWrite --
 *	Unsets relation level write lock.
 */
extern
void
RelationUnsetLockForWrite ARGS((
	Relation	relation
));

/*
 * RelationSetLockForTupleRead --
 *	Sets tuple level read lock.
 */
extern
void
RelationSetLockForTupleRead ARGS((
	Relation	relation,
	ItemPointer	itemPointer
));

/*
 * RelationSetLockForReadPage --
 *	Sets read lock on a page.
 */
extern
void
RelationSetLockForReadPage ARGS((
	Relation	relation,
	PagePartition	partition,
	ItemPointer	itemPointer
));

/*
 * RelationSetLockForWritePage --
 *	Sets write lock on a page.
 */
extern
void
RelationSetLockForWritePage ARGS((
	Relation	relation,
	PagePartition	partition,
	ItemPointer	itemPointer
));

/*
 * RelationUnsetLockForReadPage --
 *	Frees read lock on a page.
 */
extern
void
RelationUnsetLockForReadPage ARGS((
	Relation	relation,
	PagePartition	partition,
	ItemPointer	itemPointer
));

/*
 * RelationUnsetLockForWritePage --
 *	Frees write lock on a page.
 */
extern
void
RelationUnsetLockForWritePage ARGS((
	Relation	relation,
	PagePartition	partition,
	ItemPointer	itemPointer
));

void
LRelIdAssign ARGS((
	LRelId		*lRelId,
	ObjectId	dbId,
	ObjectId	relId
));

#endif	/* !defined(LMgrIncluded) */
@


1.5
log
@protos checkin.
@
text
@d6 1
a6 1
 *	$Header: RCS/lmgr.h,v 1.4 91/11/08 15:44:34 kemnitz Exp Locker: kemnitz $
d31 1
a31 1
        TransactionIdData       transactionIdData;
@


1.4
log
@fixed prototypes.
@
text
@d6 1
a6 1
 *	$Header: RCS/lmgr.h,v 1.3 91/08/29 23:49:37 mer Exp Locker: kemnitz $
d55 1
a55 1
	Relation	relation
d65 1
a65 1
	Relation	relation
@


1.3
log
@purge old lmgr code
@
text
@d6 1
a6 1
 *	$Header: /users/mer/postgres/src/lib/H/storage/RCS/lmgr.h,v 1.2 1991/08/06 12:24:46 mer Exp mer $
d165 1
a165 1
	Relation	relation
@


1.2
log
@make LockInfoIsValid a macro
@
text
@d6 1
a6 1
 *	$Header: RCS/lmgr.h,v 1.1 91/08/01 10:58:25 mer Exp Locker: mer $
a15 1
#include "storage/pladt.h"
d19 9
d215 7
@


1.1
log
@Initial revision
@
text
@d6 1
a6 1
 *	$Header: RCS/lmgr.h,v 1.9 91/07/29 19:10:51 mer Exp $
d28 2
@
