summaryrefslogtreecommitdiff
path: root/src/backend/storage/freespace/freespace.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-10-05 17:28:13 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-10-05 17:28:13 +0000
commit8a52b893b3d83c6dc796fae6a07a4ac30c871fc4 (patch)
tree65b88475931f536afffe13f489c10167a8b12a12 /src/backend/storage/freespace/freespace.c
parent343318028fb4aca0c69663c7d429d602a32aaf02 (diff)
downloadpostgresql-8a52b893b3d83c6dc796fae6a07a4ac30c871fc4.tar.gz
Further cleanup of dynahash.c API, in pursuit of portability and
readability. Bizarre '(long *) TRUE' return convention is gone, in favor of just raising an error internally in dynahash.c when we detect hashtable corruption. HashTableWalk is gone, in favor of using hash_seq_search directly, since it had no hope of working with non-LONGALIGNable datatypes. Simplify some other code that was made undesirably grotty by promixity to HashTableWalk.
Diffstat (limited to 'src/backend/storage/freespace/freespace.c')
-rw-r--r--src/backend/storage/freespace/freespace.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/backend/storage/freespace/freespace.c b/src/backend/storage/freespace/freespace.c
index f8fefee8a0..b51b1fb230 100644
--- a/src/backend/storage/freespace/freespace.c
+++ b/src/backend/storage/freespace/freespace.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/freespace/freespace.c,v 1.6 2001/10/01 05:36:14 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/freespace/freespace.c,v 1.7 2001/10/05 17:28:12 tgl Exp $
*
*
* NOTES:
@@ -490,16 +490,12 @@ static FSMRelation *
lookup_fsm_rel(RelFileNode *rel)
{
FSMRelation *fsmrel;
- bool found;
fsmrel = (FSMRelation *) hash_search(FreeSpaceMap->relHash,
(void *) rel,
HASH_FIND,
- &found);
+ NULL);
if (!fsmrel)
- elog(ERROR, "FreeSpaceMap hashtable corrupted");
-
- if (!found)
return NULL;
return fsmrel;
@@ -523,7 +519,7 @@ create_fsm_rel(RelFileNode *rel)
HASH_ENTER,
&found);
if (!fsmrel)
- elog(ERROR, "FreeSpaceMap hashtable corrupted");
+ elog(ERROR, "FreeSpaceMap hashtable out of memory");
if (!found)
{
@@ -584,7 +580,6 @@ static void
delete_fsm_rel(FSMRelation *fsmrel)
{
FSMRelation *result;
- bool found;
free_chunk_chain(fsmrel->relChunks);
unlink_fsm_rel(fsmrel);
@@ -592,8 +587,8 @@ delete_fsm_rel(FSMRelation *fsmrel)
result = (FSMRelation *) hash_search(FreeSpaceMap->relHash,
(void *) &(fsmrel->key),
HASH_REMOVE,
- &found);
- if (!result || !found)
+ NULL);
+ if (!result)
elog(ERROR, "FreeSpaceMap hashtable corrupted");
}