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.96) (envelope-from ) id 1vYwNZ-0003Ye-1S for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Dec 2025 01:12:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vYwNX-008JbA-16 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Dec 2025 01:12:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vYwNW-008Jb1-33 for pgsql-hackers@lists.postgresql.org; Fri, 26 Dec 2025 01:12:27 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vYwNV-002dZS-1N for pgsql-hackers@lists.postgresql.org; Fri, 26 Dec 2025 01:12:26 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7b9c17dd591so5946445b3a.3 for ; Thu, 25 Dec 2025 17:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766711544; x=1767316344; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jVtuD27wQa9fCXRWbFOkEqfgOBVWkqpkCfVY8U71ZWs=; b=YQ63JQw+BDeGgqA8JzrHz2CwuJhpaf0bjXnmV2E8UiPb8bXkElf/T9dPQTlFB77B// VgVhCsXz61uOYz/ANTXYr6XvgRvr6zBTKA2RGWdvMI4sc1Khejn34pGtcKS/3ZRYALr7 L561WyRnrwnskoYCf6g69qm7eNm4ckFWK00nRd8MLalIbajsSusWWheIycUQob5VQ9Wz C8F6CijC2dvb69wAae4RFdoHTKXEEKPUk1MZouEyGVBmMAeCMRX5yhP1fa/Xxi6tQeQ7 GMt5Lk9e7g4TTYPnCLysmWpzKwOQIXf6A7OF9lnT7oLgUAuyerKuVjsaanNTRpUflvUX qA7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766711544; x=1767316344; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jVtuD27wQa9fCXRWbFOkEqfgOBVWkqpkCfVY8U71ZWs=; b=AILabEkLq2/xzSDZX4UMFx746pcFRHo6hUnr8lhVBeQuvE/xrwpqDNI+mqI5uDlf4f Urwd0nxdexo8c+K3MSDQKKIVf8Dyv21dDR09Yli8PN50TH5CqheEkT8Wpk8iVX6BpXTi hFnuK65piPmcNwhlacHf3FdRADqLLduQ9t1rzsPj4ZPebbZ66YhnkVoW63QD84TlhWRz 9+paR37Tpivmlu4lkFYJPEJh9Zu7yEPi2IT3dZT0wujn2aup6Hq0EGie55CqFws7Yie2 QBefV+O489DMrdM4IwCjkDOdyT3Fi8tdyWL19IlcVxiwqN3r1DY0BUWOlZRlOoRHVt5v lveA== X-Gm-Message-State: AOJu0Ywvt5d4Y58gquJUhd6ZxSPKqOSsC6nXgN8Wqx5w9qJzriWWFuh/ yb0brDUsxDXXt5j2/kmKpL79Qfx7cwP60dr63EX+Nj2yWPou0w0cT3ZN X-Gm-Gg: AY/fxX5+zcjc22AD0zNkt78FfSthGDeg5huQxKhmXjGfCjVxmr2g8fqKF71r0pAYMwp 5XgtELI8WTXv9u9pxXKQxlyHekVR7n5csqEG7ajwKrbFkEsR6BF0k2FF/UnBH2sYF0v6soTbm6x 6e0/5bcT59kiShuU4BiWnQcSijomGYHclg05OvfgPNK0HWpHSCQwIrjCa1IdA7kh99/LpPUXxxT 5aimYNDvLOzueeKCrVC9RrXR8Lgni7Y43AU/KYc4CkoOOqJTMvInqGvriH5gGTkTFuewDeFXalb gHfKmphE56cBTZvQV0ikttFKsUqEoaWrXqEo0arbU6hgNa5gjOwdCgcxd/yftxcSKEV5UtNNuT9 AYBXr74xWWIWdrcua+hkUHAVyhQpMFqx8E117Xd+lP5ao0SN8Btjlr5ekXQVgGN1bWnFvmMZDWV n0Thu+GjJFew3oPJqPS+I= X-Google-Smtp-Source: AGHT+IHPKd8Ij1j51R3crIzvB6zRX4Zn2Gsj+b5axqBApqeq2KOJt4BQVbtYdltI1Dl6IBTCdVJamw== X-Received: by 2002:a05:6a00:f04:b0:7e8:4587:e8cd with SMTP id d2e1a72fcca58-7ff66a6c55fmr20162442b3a.64.1766711544014; Thu, 25 Dec 2025 17:12:24 -0800 (PST) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7a844d5asm20293981b3a.3.2025.12.25.17.12.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Dec 2025 17:12:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: Switch buffile.c/h to use pgoff_t From: Chao Li In-Reply-To: Date: Fri, 26 Dec 2025 09:11:48 +0800 Cc: Postgres hackers , Bryan Green Content-Transfer-Encoding: quoted-printable Message-Id: References: <85F6E9BB-59E8-4BD5-9FC1-357C3ACD5F87@gmail.com> To: Michael Paquier X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 26, 2025, at 07:45, Michael Paquier = wrote: >=20 > On Thu, Dec 25, 2025 at 10:40:02AM +0800, Chao Li wrote: >> In attached v3, I have applied int64 to the 2 struct fields and >> corresponding local variables. I ran a clean build, no warning was >> introduced, and "make check" passed. >=20 > The advantage of being able to make the code transparently more > pluggable for max large sizes while we already use 8-byte offsets is > kind of nice, I guess. "availbytes" is a clarification bonus as it is > not an offset per-se. I can see that you have missed on cast spot, so > adjusted things a bit, then applied the result. > -- > Michael Thanks a lot for pushing. WRT to the original (int) casts, I intentionally removed them, because = file->nbytes, newOffset and file->curOffset are all signed 64 bit = integers now. Compiling with -Wextra won=E2=80=99t get a warning, so = technically, the type cast is no longer needed. I saw you changed to: ``` - file->pos =3D (int) (newOffset - file->curOffset); + file->pos =3D (int64) (newOffset - file->curOffset); - file->pos =3D (int) (newOffset - file->curOffset); + file->pos =3D (int64) newOffset - file->curOffset; - file->nbytes =3D (int) (newOffset - file->curOffset); + file->nbytes =3D (int64) newOffset - file->curOffset; ```=20 The latter two places missed (), but that should also work, just a = little inconsistent. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/