Re: _pg_relbuf() Relation paramter - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: _pg_relbuf() Relation paramter
Date
Msg-id 54D23610.7020506@vmware.com
Whole thread Raw
In response to _pg_relbuf() Relation paramter  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: _pg_relbuf() Relation paramter
Re: _pg_relbuf() Relation paramter
List pgsql-hackers
On 02/04/2015 04:49 PM, Kevin Grittner wrote:
> I ran across this function in nbtpage.c:
>
> /*
>   * _bt_relbuf() -- release a locked buffer.
>   *
>   * Lock and pin (refcount) are both dropped.
>   */
> void
> _bt_relbuf(Relation rel, Buffer buf)
> {
>      UnlockReleaseBuffer(buf);
> }
>
> Would anyone object to me removing the first parameter (including,
> obviously, in all references in our code tree)?

No objection, although I have to wonder why bother? While you're at it, 
the 'size' argument to _bt_pageinit is also pretty useless. It's useless 
for PageInit() too, but that's used in more places, potentially even in 
extensions. (there's a call to _bt_relbuf in contrib/pgstattuple, but it 
shouldn't really be used in 3rd party extensions)

- Heikki




pgsql-hackers by date:

Previous
From: Sawada Masahiko
Date:
Subject: Re: Proposal : REINDEX xxx VERBOSE
Next
From: Tom Lane
Date:
Subject: Re: Getting rid of wal_level=archive and default to hot_standby + wal_senders