@@ -1299,35 +1299,36 @@ mdregistersync(SMgrRelation reln, ForkNumber forknum)
12991299{
13001300 int segno ;
13011301 int min_inactive_seg ;
1302+ MdSMgrRelation mdreln = (MdSMgrRelation ) reln ;
13021303
13031304 /*
13041305 * NOTE: mdnblocks makes sure we have opened all active segments, so that
13051306 * the loop below will get them all!
13061307 */
13071308 mdnblocks (reln , forknum );
13081309
1309- min_inactive_seg = segno = reln -> md_num_open_segs [forknum ];
1310+ min_inactive_seg = segno = mdreln -> md_num_open_segs [forknum ];
13101311
13111312 /*
13121313 * Temporarily open inactive segments, then close them after sync. There
13131314 * may be some inactive segments left opened after error, but that is
13141315 * harmless. We don't bother to clean them up and take a risk of further
13151316 * trouble. The next mdclose() will soon close them.
13161317 */
1317- while (_mdfd_openseg (reln , forknum , segno , 0 ) != NULL )
1318+ while (_mdfd_openseg (mdreln , forknum , segno , 0 ) != NULL )
13181319 segno ++ ;
13191320
13201321 while (segno > 0 )
13211322 {
1322- MdfdVec * v = & reln -> md_seg_fds [forknum ][segno - 1 ];
1323+ MdfdVec * v = & mdreln -> md_seg_fds [forknum ][segno - 1 ];
13231324
1324- register_dirty_segment (reln , forknum , v );
1325+ register_dirty_segment (mdreln , forknum , v );
13251326
13261327 /* Close inactive segments immediately */
13271328 if (segno > min_inactive_seg )
13281329 {
13291330 FileClose (v -> mdfd_vfd );
1330- _fdvec_resize (reln , forknum , segno - 1 );
1331+ _fdvec_resize (mdreln , forknum , segno - 1 );
13311332 }
13321333
13331334 segno -- ;
0 commit comments