summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r--src/backend/access/heap/heapam.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 6aecc143e7b..922744e04db 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -9098,8 +9098,7 @@ heap_sync(Relation rel)
/* main heap */
FlushRelationBuffers(rel);
- /* FlushRelationBuffers will have opened rd_smgr */
- smgrimmedsync(rel->rd_smgr, MAIN_FORKNUM);
+ smgrimmedsync(RelationGetSmgr(rel), MAIN_FORKNUM);
/* FSM is not critical, don't bother syncing it */
@@ -9110,7 +9109,7 @@ heap_sync(Relation rel)
toastrel = table_open(rel->rd_rel->reltoastrelid, AccessShareLock);
FlushRelationBuffers(toastrel);
- smgrimmedsync(toastrel->rd_smgr, MAIN_FORKNUM);
+ smgrimmedsync(RelationGetSmgr(toastrel), MAIN_FORKNUM);
table_close(toastrel, AccessShareLock);
}
}