8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.89 2002/03/02 21:39:16 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.90 2002/03/05 05:30:31 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -87,12 +87,10 @@ static OffsetNumber gistwritebuffer(Relation r,
87
87
Page page ,
88
88
IndexTuple * itup ,
89
89
int len ,
90
- OffsetNumber off ,
91
- GISTSTATE * giststate );
90
+ OffsetNumber off );
92
91
static int gistnospace (Page page ,
93
92
IndexTuple * itvec , int len );
94
- static IndexTuple * gistreadbuffer (Relation r ,
95
- Buffer buffer , int * len );
93
+ static IndexTuple * gistreadbuffer (Buffer buffer , int * len );
96
94
static IndexTuple * gistjoinvector (
97
95
IndexTuple * itvec , int * len ,
98
96
IndexTuple * additvec , int addlen );
@@ -117,7 +115,7 @@ static IndexTuple *gistSplit(Relation r,
117
115
int * len ,
118
116
GISTSTATE * giststate ,
119
117
InsertIndexResult * res );
120
- static void gistnewroot (GISTSTATE * giststate , Relation r ,
118
+ static void gistnewroot (Relation r ,
121
119
IndexTuple * itup , int len );
122
120
static void GISTInitBuffer (Buffer b , uint32 f );
123
121
static OffsetNumber gistchoose (Relation r , Page p ,
@@ -359,11 +357,11 @@ gistinsert(PG_FUNCTION_ARGS)
359
357
360
358
#ifdef GIST_PAGEADDITEM
361
359
/*
362
- * * Take a compressed entry, and install it on a page. Since we now know
363
- * * where the entry will live, we decompress it and recompress it using
364
- * * that knowledge (some compression routines may want to fish around
365
- * * on the page, for example, or do something special for leaf nodes.)
366
- */
360
+ * Take a compressed entry, and install it on a page. Since we now know
361
+ * where the entry will live, we decompress it and recompress it using
362
+ * that knowledge (some compression routines may want to fish around
363
+ * on the page, for example, or do something special for leaf nodes.)
364
+ */
367
365
static OffsetNumber
368
366
gistPageAddItem (GISTSTATE * giststate ,
369
367
Relation r ,
@@ -425,7 +423,7 @@ gistdoinsert(Relation r,
425
423
426
424
ret = gistlayerinsert (r , GISTP_ROOT , & instup , & len , res , giststate );
427
425
if (ret & SPLITED )
428
- gistnewroot (giststate , r , instup , len );
426
+ gistnewroot (r , instup , len );
429
427
430
428
for (i = 0 ; i < len ; i ++ )
431
429
pfree (instup [i ]);
@@ -452,7 +450,7 @@ gistlayerinsert(Relation r, BlockNumber blkno,
452
450
if (!(opaque -> flags & F_LEAF ))
453
451
{
454
452
/* internal page, so we must walk on tree */
455
- /* len IS equial 1 */
453
+ /* len IS equal 1 */
456
454
ItemId iid ;
457
455
BlockNumber nblkno ;
458
456
ItemPointerData oldtid ;
@@ -509,7 +507,7 @@ gistlayerinsert(Relation r, BlockNumber blkno,
509
507
oldlen ;
510
508
511
509
ret |= SPLITED ;
512
- itvec = gistreadbuffer (r , buffer , & tlen );
510
+ itvec = gistreadbuffer (buffer , & tlen );
513
511
itvec = gistjoinvector (itvec , & tlen , (* itup ), * len );
514
512
oldlen = * len ;
515
513
newitup = gistSplit (r , buffer , itvec , & tlen , giststate ,
@@ -534,7 +532,7 @@ gistlayerinsert(Relation r, BlockNumber blkno,
534
532
FirstOffsetNumber
535
533
:
536
534
OffsetNumberNext (PageGetMaxOffsetNumber (page ));
537
- l = gistwritebuffer (r , page , (* itup ), * len , off , giststate );
535
+ l = gistwritebuffer (r , page , (* itup ), * len , off );
538
536
WriteBuffer (buffer );
539
537
540
538
/*
@@ -570,7 +568,7 @@ gistlayerinsert(Relation r, BlockNumber blkno,
570
568
*/
571
569
static OffsetNumber
572
570
gistwritebuffer (Relation r , Page page , IndexTuple * itup ,
573
- int len , OffsetNumber off , GISTSTATE * giststate )
571
+ int len , OffsetNumber off )
574
572
{
575
573
OffsetNumber l = InvalidOffsetNumber ;
576
574
int i ;
@@ -609,7 +607,7 @@ gistwritebuffer(Relation r, Page page, IndexTuple *itup,
609
607
static int
610
608
gistnospace (Page page , IndexTuple * itvec , int len )
611
609
{
612
- int size = 0 ;
610
+ unsigned int size = 0 ;
613
611
int i ;
614
612
615
613
for (i = 0 ; i < len ; i ++ )
@@ -622,7 +620,7 @@ gistnospace(Page page, IndexTuple *itvec, int len)
622
620
* Read buffer into itup vector
623
621
*/
624
622
static IndexTuple *
625
- gistreadbuffer (Relation r , Buffer buffer , int * len /* out */ )
623
+ gistreadbuffer (Buffer buffer , int * len /* out */ )
626
624
{
627
625
OffsetNumber i ,
628
626
maxoff ;
@@ -1365,7 +1363,7 @@ gistSplit(Relation r,
1365
1363
{
1366
1364
OffsetNumber l ;
1367
1365
1368
- l = gistwritebuffer (r , right , rvectup , v .spl_nright , FirstOffsetNumber , giststate );
1366
+ l = gistwritebuffer (r , right , rvectup , v .spl_nright , FirstOffsetNumber );
1369
1367
WriteBuffer (rightbuf );
1370
1368
1371
1369
if (res )
@@ -1398,7 +1396,7 @@ gistSplit(Relation r,
1398
1396
{
1399
1397
OffsetNumber l ;
1400
1398
1401
- l = gistwritebuffer (r , left , lvectup , v .spl_nleft , FirstOffsetNumber , giststate );
1399
+ l = gistwritebuffer (r , left , lvectup , v .spl_nleft , FirstOffsetNumber );
1402
1400
if (BufferGetBlockNumber (buffer ) != GISTP_ROOT )
1403
1401
PageRestoreTempPage (left , p );
1404
1402
@@ -1428,7 +1426,7 @@ gistSplit(Relation r,
1428
1426
}
1429
1427
1430
1428
static void
1431
- gistnewroot (GISTSTATE * giststate , Relation r , IndexTuple * itup , int len )
1429
+ gistnewroot (Relation r , IndexTuple * itup , int len )
1432
1430
{
1433
1431
Buffer b ;
1434
1432
Page p ;
@@ -1437,7 +1435,7 @@ gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple *itup, int len)
1437
1435
GISTInitBuffer (b , 0 );
1438
1436
p = BufferGetPage (b );
1439
1437
1440
- gistwritebuffer (r , p , itup , len , FirstOffsetNumber , giststate );
1438
+ gistwritebuffer (r , p , itup , len , FirstOffsetNumber );
1441
1439
WriteBuffer (b );
1442
1440
}
1443
1441
0 commit comments