File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ static int NSmgr = 0;
6969
7070static Size LargestSMgrRelationSize = 0 ;
7171
72+ SMgrId storage_manager_id ;
73+
7274/*
7375 * Each backend has a hashtable that stores all extant SMgrRelation objects.
7476 * In addition, "unpinned" SMgrRelation objects are chained together in a list.
@@ -227,7 +229,7 @@ smgropen(RelFileLocator rlocator, ProcNumber backend)
227229 for (int i = 0 ; i <= MAX_FORKNUM ; ++ i )
228230 reln -> smgr_cached_nblocks [i ] = InvalidBlockNumber ;
229231
230- reln -> smgr_which = MdSMgrId ; /* we only have md.c at present */
232+ reln -> smgr_which = storage_manager_id ;
231233
232234 /* implementation-specific initialization */
233235 smgrsw [reln -> smgr_which ].smgr_open (reln );
Original file line number Diff line number Diff line change @@ -1931,6 +1931,8 @@ void
19311931register_builtin_dynamic_managers (void )
19321932{
19331933 mdsmgr_register ();
1934+
1935+ storage_manager_id = MdSMgrId ;
19341936}
19351937
19361938/*
Original file line number Diff line number Diff line change 2020
2121typedef uint8 SMgrId ;
2222
23+ extern PGDLLIMPORT SMgrId storage_manager_id ;
24+
2325/*
2426 * smgr.c maintains a table of SMgrRelation objects, which are essentially
2527 * cached file handles. An SMgrRelation is created (if not already present)
You can’t perform that action at this time.
0 commit comments