Skip to content

Commit 3047b44

Browse files
committed
Clean up comments.
1 parent d8ba3df commit 3047b44

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

src/include/storage/buf_internals.h

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
/*-------------------------------------------------------------------------
22
*
33
* buf_internals.h
4-
* Internal definitions.
4+
* Internal definitions for buffer manager.
55
*
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: buf_internals.h,v 1.33 1999/09/24 00:25:27 tgl Exp $
10-
*
11-
* NOTE
12-
* If BUFFERPAGE0 is defined, then 0 will be used as a
13-
* valid buffer page number.
9+
* $Id: buf_internals.h,v 1.34 1999/11/21 19:56:12 tgl Exp $
1410
*
1511
*-------------------------------------------------------------------------
1612
*/
@@ -42,18 +38,14 @@ extern int Num_Descriptors;
4238

4339
typedef bits16 BufFlags;
4440

45-
typedef struct sbufdesc BufferDesc;
46-
typedef struct sbufdesc BufferHdr;
47-
typedef struct buftag BufferTag;
48-
4941
/* long * so alignment will be correct */
5042
typedef long **BufferBlock;
5143

52-
struct buftag
44+
typedef struct buftag
5345
{
5446
LockRelId relId;
5547
BlockNumber blockNum; /* blknum relative to begin of reln */
56-
};
48+
} BufferTag;
5749

5850
#define CLEAR_BUFFERTAG(a) \
5951
( \
@@ -72,8 +64,8 @@ struct buftag
7264
#define INVALID_DESCRIPTOR (-3)
7365

7466
/*
75-
* struct sbufdesc -- shared buffer cache metadata for a single
76-
* shared buffer descriptor.
67+
* BufferDesc -- shared buffer cache metadata for a single
68+
* shared buffer descriptor.
7769
*
7870
* We keep the name of the database and relation in which this
7971
* buffer appears in order to avoid a catalog lookup on cache
@@ -83,17 +75,17 @@ struct buftag
8375
* Dbname, relname, dbid, and relid are enough to determine where
8476
* to put the buffer, for all storage managers.
8577
*/
86-
struct sbufdesc
78+
typedef struct sbufdesc
8779
{
88-
Buffer freeNext; /* link for freelist chain */
80+
Buffer freeNext; /* links for freelist chain */
8981
Buffer freePrev;
9082
SHMEM_OFFSET data; /* pointer to data in buf pool */
9183

9284
/* tag and id must be together for table lookup to work */
9385
BufferTag tag; /* file/block identifier */
9486
int buf_id; /* maps global desc to local desc */
9587

96-
BufFlags flags; /* described below */
88+
BufFlags flags; /* see bit definitions above */
9789
unsigned refcount; /* # of times buffer is pinned */
9890

9991
#ifdef HAS_TEST_AND_SET
@@ -107,10 +99,12 @@ struct sbufdesc
10799

108100
char sb_dbname[NAMEDATALEN]; /* name of db in which buf belongs */
109101
char sb_relname[NAMEDATALEN]; /* name of reln */
110-
};
102+
} BufferDesc;
111103

112104
/*
113-
* Buffer lock infos in BufferLocks below.
105+
* Each backend has its own BufferLocks[] array holding flag bits
106+
* showing what locks it has set on each buffer.
107+
*
114108
* We have to free these locks in elog(ERROR)...
115109
*/
116110
#define BL_IO_IN_PROGRESS (1 << 0) /* unimplemented */
@@ -178,7 +172,7 @@ extern BufferDesc *LocalBufferDescriptors;
178172
extern int NLocBuffer;
179173

180174
extern BufferDesc *LocalBufferAlloc(Relation reln, BlockNumber blockNum,
181-
bool *foundPtr);
175+
bool *foundPtr);
182176
extern int WriteLocalBuffer(Buffer buffer, bool release);
183177
extern int FlushLocalBuffer(Buffer buffer, bool release);
184178
extern void InitLocalBuffer(void);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy