Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
b619cb09
Commit
b619cb09
authored
Jul 23, 1996
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iBrought in a fix for backend crashes
Submitted by: "Vadim B. Mikheev" <vadim@sable.krasnoyarsk.su>
parent
00fe588f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
src/backend/storage/buf_internals.h
src/backend/storage/buf_internals.h
+4
-4
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/bufmgr.c
+17
-14
No files found.
src/backend/storage/buf_internals.h
View file @
b619cb09
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: buf_internals.h,v 1.
2 1996/07/22 22:59:42
scrappy Exp $
* $Id: buf_internals.h,v 1.
3 1996/07/23 05:43:11
scrappy Exp $
*
* NOTE
* If BUFFERPAGE0 is defined, then 0 will be used as a
...
...
@@ -118,8 +118,8 @@ struct sbufdesc {
int16
bufsmgr
;
/* storage manager id for buffer */
unsigned
refcount
;
/* # of times buffer is pinned */
char
*
sb_dbname
;
/* name of db in which buf belongs */
char
*
sb_relname
;
/* name of reln */
char
sb_dbname
[
NAMEDATALEN
+
1
]
;
/* name of db in which buf belongs */
char
sb_relname
[
NAMEDATALEN
+
1
]
;
/* name of reln */
#ifdef HAS_TEST_AND_SET
/* can afford a dedicated lock if test-and-set locks are available */
slock_t
io_in_progress_lock
;
...
...
@@ -164,7 +164,7 @@ struct sbufdesc {
#if defined(PORTNAME_BSD44_derived) || \
defined(PORTNAME_bsdi) || \
defined(PORTNAME_i
86pc
_solaris) || \
defined(PORTNAME_i
386
_solaris) || \
defined(PORTNAME_linux) || \
defined(PORTNAME_sparc) || \
defined(PORTNAME_sparc_solaris)
...
...
src/backend/storage/buffer/bufmgr.c
View file @
b619cb09
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.
1.1.1 1996/07/09 06:21:54
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.
2 1996/07/23 05:44:10
scrappy Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -485,20 +485,23 @@ BufferAlloc(Relation reln,
}
}
if
(
buf
!=
NULL
)
{
#ifdef HAS_TEST_AND_SET
S_UNLOCK
(
&
(
buf
->
io_in_progress_lock
));
S_UNLOCK
(
&
(
buf
->
io_in_progress_lock
));
#else
/* !HAS_TEST_AND_SET */
if
(
buf
->
refcount
>
1
)
SignalIO
(
buf
);
if
(
buf
->
refcount
>
1
)
SignalIO
(
buf
);
#endif
/* !HAS_TEST_AND_SET */
/* give up the buffer since we don't need it any more */
buf
->
refcount
--
;
PrivateRefCount
[
BufferDescriptorGetBuffer
(
buf
)
-
1
]
=
0
;
AddBufferToFreelist
(
buf
);
buf
->
flags
|=
BM_FREE
;
buf
->
flags
&=
~
BM_DIRTY
;
buf
->
flags
&=
~
BM_IO_IN_PROGRESS
;
buf
->
refcount
--
;
PrivateRefCount
[
BufferDescriptorGetBuffer
(
buf
)
-
1
]
=
0
;
AddBufferToFreelist
(
buf
);
buf
->
flags
|=
BM_FREE
;
buf
->
flags
&=
~
BM_DIRTY
;
buf
->
flags
&=
~
BM_IO_IN_PROGRESS
;
}
SpinRelease
(
BufMgrLock
);
...
...
@@ -537,8 +540,8 @@ BufferAlloc(Relation reln,
}
/* record the database name and relation name for this buffer */
buf
->
sb_relname
=
pstrdup
(
reln
->
rd_rel
->
relname
.
data
);
buf
->
sb_dbname
=
pstrdup
(
GetDatabaseName
());
strcpy
(
buf
->
sb_relname
,
reln
->
rd_rel
->
relname
.
data
);
strcpy
(
buf
->
sb_dbname
,
GetDatabaseName
());
/* remember which storage manager is responsible for it */
buf
->
bufsmgr
=
reln
->
rd_rel
->
relsmgr
;
...
...
@@ -1248,7 +1251,7 @@ PrintBufferDescs()
elog
(
NOTICE
,
"[%02d] (freeNext=%d, freePrev=%d, relname=%.*s, \
blockNum=%d, flags=0x%x, refcount=%d %d)"
,
i
,
buf
->
freeNext
,
buf
->
freePrev
,
NAMEDATALEN
,
&
(
buf
->
sb_relname
)
,
buf
->
tag
.
blockNum
,
buf
->
flags
,
buf
->
sb_relname
,
buf
->
tag
.
blockNum
,
buf
->
flags
,
buf
->
refcount
,
PrivateRefCount
[
i
]);
}
SpinRelease
(
BufMgrLock
);
...
...
@@ -1273,7 +1276,7 @@ PrintPinnedBufs()
if
(
PrivateRefCount
[
i
]
>
0
)
elog
(
NOTICE
,
"[%02d] (freeNext=%d, freePrev=%d, relname=%.*s, \
blockNum=%d, flags=0x%x, refcount=%d %d)
\n
"
,
i
,
buf
->
freeNext
,
buf
->
freePrev
,
NAMEDATALEN
,
&
(
buf
->
sb_relname
)
,
i
,
buf
->
freeNext
,
buf
->
freePrev
,
NAMEDATALEN
,
buf
->
sb_relname
,
buf
->
tag
.
blockNum
,
buf
->
flags
,
buf
->
refcount
,
PrivateRefCount
[
i
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment