mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Convert macros to static inline functions (rel.h)
Reviewed-by: Amul Sul <sulamul@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/5b558da8-99fb-0a99-83dd-f72f05388517%40enterprisedb.com
This commit is contained in:
parent
f14aad5169
commit
3edc71ec04
@ -572,22 +572,21 @@ RelationGetSmgr(Relation rel)
|
||||
smgrsetowner(&(rel->rd_smgr), smgropen(rel->rd_locator, rel->rd_backend));
|
||||
return rel->rd_smgr;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* RelationCloseSmgr
|
||||
* Close the relation at the smgr level, if not already done.
|
||||
*
|
||||
* Note: smgrclose should unhook from owner pointer, hence the Assert.
|
||||
*/
|
||||
#define RelationCloseSmgr(relation) \
|
||||
do { \
|
||||
if ((relation)->rd_smgr != NULL) \
|
||||
{ \
|
||||
smgrclose((relation)->rd_smgr); \
|
||||
Assert((relation)->rd_smgr == NULL); \
|
||||
} \
|
||||
} while (0)
|
||||
static inline void
|
||||
RelationCloseSmgr(Relation relation)
|
||||
{
|
||||
if (relation->rd_smgr != NULL)
|
||||
smgrclose(relation->rd_smgr);
|
||||
|
||||
/* smgrclose should unhook from owner pointer */
|
||||
Assert(relation->rd_smgr == NULL);
|
||||
}
|
||||
#endif /* !FRONTEND */
|
||||
|
||||
/*
|
||||
* RelationGetTargetBlock
|
||||
|
Loading…
Reference in New Issue
Block a user