Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0SAO-00BWHP-Of for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Oct 2024 20:59:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t0SAL-00HNM3-F0 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Oct 2024 20:59:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0SAL-00HNLt-4P for pgsql-hackers@lists.postgresql.org; Mon, 14 Oct 2024 20:59:45 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0SAE-0014QX-2O for pgsql-hackers@postgresql.org; Mon, 14 Oct 2024 20:59:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2024011501; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description; bh=M1CrWK42DGEAW+EiKtJmrcMXU+CdbpAeuWKyimiTH2g=; b=m05I2yI7nxaqRlaPOsJ93Wjw2g 9m+FKU32XgbHmcffNs7vBbhjUsfX+x10ay/fFFDHRRvEpfwm1s61tQRGHFEFHSTg+GF5iCJP+QfqZ IZ9Y+Ld0vFdzRxEWWOBISMX5SvYVZZHBvwzOhjX48X58tciHC5WjUB/UAkl1G86kuZJqPx3aQdfi5 bW5kGsDAqsvaBWpTdKcgkVxf+wVbgghGOu1nxsxX2zNf7dxQl3N6dTypAy1WO3A/wAdDSidzfYsWA pdyCUDXvNBtA629PodqScQXlX4RV9jLzxQmT3Jy8oziEEmS31ZoGnSWD/0sYaX9RsTKDu2ZtMJbLd i+iMpjiA==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1t0SAD-001LqH-2W; Mon, 14 Oct 2024 16:59:37 -0400 Date: Mon, 14 Oct 2024 16:59:37 -0400 From: Bruce Momjian To: px shi Cc: pgsql-hackers@postgresql.org Subject: Re: a litter question about mdunlinkfiletag function Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 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?"