diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 61816730955..db3eb2cce1e 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -1002,7 +1002,7 @@ ExtendBufferedRelTo(BufferManagerRelation bmr, if (buffer == InvalidBuffer) { Assert(extended_by == 0); - buffer = ReadBuffer_common(bmr.rel, bmr.smgr, 0, + buffer = ReadBuffer_common(bmr.rel, bmr.smgr, bmr.relpersistence, fork, extend_to - 1, mode, strategy); } @@ -1117,16 +1117,8 @@ PinBufferForBlock(Relation rel, Assert(blockNum != P_NEW); - /* - * If there is no Relation it usually implies recovery and thus permanent, - * but we take an argument because CreateAndCopyRelationData can reach us - * with only an SMgrRelation for an unlogged relation that we don't want - * to flag with BM_PERMANENT. - */ if (rel) persistence = rel->rd_rel->relpersistence; - else if (smgr_persistence == 0) - persistence = RELPERSISTENCE_PERMANENT; else persistence = smgr_persistence; diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index a1e71013d32..bc26a4536ff 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -114,14 +114,10 @@ typedef struct BufferManagerRelation struct ReadBuffersOperation { - /* - * The following members should be set by the caller. If only smgr is - * provided without rel, then smgr_persistence can be set to override the - * default assumption of RELPERSISTENCE_PERMANENT. - */ - Relation rel; + /* The following members should be set by the caller. */ + Relation rel; /* optional */ struct SMgrRelationData *smgr; - char smgr_persistence; + char smgr_persistence; /* optional if rel != NULL */ ForkNumber forknum; BufferAccessStrategy strategy;