Re: a litter question about mdunlinkfiletag function - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: a litter question about mdunlinkfiletag function
Date
Msg-id Zw2GOZlX3VSCI8nK@momjian.us
Whole thread Raw
In response to a litter question about mdunlinkfiletag function  (px shi <spxlyy123@gmail.com>)
Responses Re: a litter question about mdunlinkfiletag function
List pgsql-hackers
On Mon, Sep 30, 2024 at 10:43:17AM +0800, px shi wrote:
> Hi, hackers
> 
> When calculating the path, forknum is hardcoded as MAIN_FORKNUM:
> 
> /* Compute the path. */
> p = relpathperm(ftag->rnode, MAIN_FORKNUM);
> 
> 
> But since the ftag structure already contains forknum:
> 
> typedef struct FileTag
> {
> int16 handler; /* SyncRequestHandler value, saving space */
> int16 forknum; /* ForkNumber, saving space */
> RelFileNode rnode;
> uint32 segno;
> } FileTag;
> 
> 
> Wouldn’t it be more flexible to use the value from the ftag structure directly?

You will find other places where relpathperm() is called without having
a FileTag structure available, e.g. ReorderBufferProcessTXN().

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  When a patient asks the doctor, "Am I going to die?", he means 
  "Am I going to die soon?"



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Make foreach_ptr macro work in C++ extensions
Next
From: Bruce Momjian
Date:
Subject: Re: Changing the default random_page_cost value