Re: _pg_relbuf() Relation paramter

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: _pg_relbuf() Relation paramter
Date: 2015-02-04 15:09:04
Message-ID: 54D23610.7020506@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-02-04 15:10:31 Re: Getting rid of wal_level=archive and default to hot_standby + wal_senders
Previous Message Tom Lane 2015-02-04 15:07:07 Re: ecpg array support, or lack thereof