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 E5CE52F9DA7; Mon, 20 Oct 2025 09:40:32 +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=1760953233; cv=none; b=ZvIwr5rlAslceFp6nNW3n+3P9CCLJVmDikQD+kMvCkC1/Fz2KC/5w/zpqwCSH9YzbtBRzvPoEJSnQvztOespsHM+nAhw59FKeTh++jOZEn9LTWhXDSg9sOJV4IPDVyyJPJXYR/CgBCRGWMlaj1upgcmwvN1kgr3JzNQj6ruO9CA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760953233; c=relaxed/simple; bh=Z1kaVO3Ed9EJ8fGuWa7kSlIV+SC1mWkBs/JeBs2k83Y=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:To:From:Subject: References:In-Reply-To; b=TjoLlrAaQbRytQNtdHZiQAdDPDG2m7Y/BROCaSJdktrQb3r7C5ON9fc7Z9SEc6LWCoUGL8Aws81ArfqRsi0L+owk5Lhyxj42pvhK/dfxxS84Vp48wIxrh6uhL63qWpRNug8o0R2eJjSLqZOExZ+/gxAi90gJ9lM9Y6+ouUSd/gE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M66NK0n7; 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="M66NK0n7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD55AC4CEF9; Mon, 20 Oct 2025 09:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760953232; bh=Z1kaVO3Ed9EJ8fGuWa7kSlIV+SC1mWkBs/JeBs2k83Y=; h=Date:Cc:To:From:Subject:References:In-Reply-To:From; b=M66NK0n7kCPkczZVv5CJ0SN99cvs22UTtSJapV/hliT4wneK87ZS3VYhv3aEg6MuM sxBXAPVuPrUOvubD5Ban6A4Qzat2/L3OlQUGBqHYmE9sjKL07cGirQ2PaJoSDKBKRY uyIrxC8T2bjV5Zme0/scFP+4tMpMGkIaASpQoBhnlpQXvQ9NRkc0lTKh0fSZIfTHoI 0K8egAAshl6DkfrGsz7UL5OTjFICMkUMTo6AT1g6t/qjbLgg8cFQ3XxxPKfYlLKGPc u4jArVK5MENoThiQhKmR81T2DFTZNuX3FqegOH/hT0l/lpkHsRvkprFg2C1g544Di+ X8YOz4Po/BwEw== Precedence: bulk X-Mailing-List: rust-for-linux@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: Mon, 20 Oct 2025 11:40:28 +0200 Message-Id: Cc: , , , , , , , , , , , , To: "Alice Ryhl" From: "Danilo Krummrich" Subject: Re: [PATCH 3/7] rust: debugfs: support for binary large objects References: <20251003222729.322059-1-dakr@kernel.org> <20251003222729.322059-4-dakr@kernel.org> In-Reply-To: On Mon Oct 20, 2025 at 10:12 AM CEST, Alice Ryhl wrote: > On Sun, Oct 19, 2025 at 02:01:03PM +0200, Danilo Krummrich wrote: >> On Sun Oct 19, 2025 at 11:44 AM CEST, Alice Ryhl wrote: >> > On Fri, Oct 17, 2025 at 04:53:09PM +0200, Danilo Krummrich wrote: >> >> On Fri Oct 17, 2025 at 4:37 PM CEST, Danilo Krummrich wrote: >> >> > The reason I went with a trait is because that's consistent within = the file. >> >> > >> >> > Otherwise, I don't mind one or the other. If we always want to use = a struct, I'm >> >> > fine with that. :) >> >>=20 >> >> Actually, there's another reason I forgot about since I sent the seri= es. :) >> >>=20 >> >> We need it because we derive it from blanket implementations: >> >>=20 >> >> impl BinaryReadFile for T >> >> impl BinaryWriteFile for T >> >> impl BinaryReadWriteFile f= or T >> > >> > You can still use a struct: >> > >> > struct BinaryWriterVtable; >> > >> > impl BinaryWriterVtable { >> > const VTABLE: bindings::foo =3D ...; >> > } >>=20 >> Yeah, but do we get something for adding yet another type in this case? >>=20 >> Another point to consider is if we want a more generic fops abstraction = type. >>=20 >> In any case, I'd like to add this as good first issue for the whole file= to be >> changed accordingly. > > Yes, keep it as-is for consistency with the rest of the file, even if > the file is inconsistent with the rest of `kernel`. Please go ahead and > file a good-first-issue for this. Before doing so, can you please answer the question above? While I'm all fo= r consistency, in this specific case it seems we'd need another indirection f= or that. And I'm not convinced that's an improvement.