From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0C9F3446B0; Tue, 21 Oct 2025 15:26:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761060394; cv=none; b=ZRnUVohlrqQ+xog3/wWIgaBYbR8/H16y0V5eBKSZMVVyrI22BxPWbU9j6k7JFxf5UEwffVblGXx0wxg8niAlBFqCYrfvQWU3u3HlOqOiHYDtk/ol/vtvn4ppFMgU2s/frDBAhqnCaminj/z7Z/D7FlW0nsLmSpR+y1YhLyxe1jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761060394; c=relaxed/simple; bh=eN/o21nJauxCaIR9XeIoYd7ymIS6OEsOgBmlALQLaVw=; h=Mime-Version:Content-Type:Date:Message-Id:From:Subject:Cc:To: References:In-Reply-To; b=XLiOZO8OGj3yAN8cAAeWGr+AThRKbMaJ2BJRd3c5sAL8tNv9XAOplMRphSCB6C05koJ+xAalZRPO60lodlelhk7MNMOHwnPqBBB8TadcdkUZeJe26hr5zEhlXIbL0TpGQl+i4OP+C2ABCIMT7FfQL2kj+xXAxCw5vIk5a6SgLAc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hEjiUO5B; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hEjiUO5B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB390C4CEF5; Tue, 21 Oct 2025 15:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761060393; bh=eN/o21nJauxCaIR9XeIoYd7ymIS6OEsOgBmlALQLaVw=; h=Date:From:Subject:Cc:To:References:In-Reply-To:From; b=hEjiUO5B/hqZMPKuvBisRUTCBf654jCcmBt5thqh7Dz29JVBhUa6HL+wNmHXcleZA wJQYafG7M0MHWl9KzJkb0OIKBFJNuOt2aLHemokwinZyr2LX2MhZPozTAr2PO9NKNS qj3tXUqN9NMrk0csjH31YkngTPfRTsDVrP0gJuJAAwVfh5lW1kL6d7li1xkHYP3FWT 4sPAyh2ZBExTvHcIn3bnXTnOI0Zsf0cKnZL69qeHSZFO5lr1LejQoElX5BWUKTHd3Z Sh2JhHMX6WXQjmJAKBs1NBxMXQzY+gN4qcKoteJghyeR6eq/CgJLQCJTPtf+yzPmLn wkaAGNOvLD5dw== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 21 Oct 2025 17:26:28 +0200 Message-Id: From: "Danilo Krummrich" Subject: Re: [PATCH v2 1/8] rust: fs: add file::Offset type alias Cc: , , , , , , , , , , , , , , , "Alexander Viro" , "Christian Brauner" , "Jan Kara" To: "Miguel Ojeda" References: <20251020222722.240473-1-dakr@kernel.org> <20251020222722.240473-2-dakr@kernel.org> In-Reply-To: On Tue Oct 21, 2025 at 5:08 PM CEST, Miguel Ojeda wrote: > On Tue, Oct 21, 2025 at 12:27=E2=80=AFAM Danilo Krummrich wrote: >> >> Add a type alias for file offsets, i.e. bindings::loff_t. Trying to >> avoid using raw bindings types, this seems to be the better alternative >> compared to just using i64. > > Would a newtype be too painful? > > Note: I didn't actually check if it is a sensible idea, but when I see > an alias I tend to ask myself that so it would be nice to know the > pros/cons (we could ideally mention why in the commit message in cases > like this). Yeah, I don't think there's any value making this a new type in this case. = There are no type invariants, useful methods, etc. In fact, not even the type alias is strictly needed, as i64 would be suffic= ient as well. The main motivation for the type alias is that I think i64 is not super intuitive for an offset value (people would rather expect usize or isize) a= nd it's nice to not have bindings::loff_t exposed to driver APIs.