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 7E57F199252; Tue, 5 Aug 2025 11:31:30 +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=1754393490; cv=none; b=uokMqPSrTgTS8YbcXn7xN3I1p2pdQxJo/mrorqA7tC+u8TK3UmC24CyfGH6n0EZzcz2Rsn2irT7KHQwXKoyadJprmc+8KcZekm6w1ThsPM99G01ZW+wcfvA5GUE6LoQWOJcPTD9s9iMGK1WD+GGVjYImSiymGMCx1JUyFVDlTUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754393490; c=relaxed/simple; bh=vcEdqIGDti60wtwS8tB1w3lsuctZKyPsi2kttMPEE+c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=aAY/IPxoExomjtWT3zhOIbWlzpB/h3FJtijs99wK32tvUTo85of/RvNKLy5LqNe1gnFvSmeFG9y00PAj3yvxt1n5/iykHgEXu1kZasehG3PnGI+AqdtOvqqKY3lSmIqw+zFXKJK9ftFJViW9okh0xFLQFdhvmIOODphYUFQQinI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lcXOefw5; 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="lcXOefw5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D55F1C4CEF4; Tue, 5 Aug 2025 11:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754393490; bh=vcEdqIGDti60wtwS8tB1w3lsuctZKyPsi2kttMPEE+c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lcXOefw5+1osb9agbetY2MO4OhJIvLTmy7UCqupsGbfhBmtAkMNj0hCwpjCQnFJrV hSj1mM2OaIuLeiFsLi4q7vEpL+rXDrBt3sTBXOisG2akOza4LcHZAolX1cykhrgxrd L2tw4K6XwCFMB9UVB56B2fQEFRaulKyUbYP9kWh9U/lcW1Boep0amIiMt3kQOF0aoS QgUfFdIQBc1Si+HC+ZxfGg2dFtPzY5SMAimFW/h6rXiIaIwkBxgVXau1mqq95EhVYe tRjzeuwhT8A+tr4oi/sET2L1vXn/jrASUALvA+UVXpRGRnpou+VmxH8kYCbTc4kHoz JmY6r/cHNr6mQ== From: Andreas Hindborg To: Alice Ryhl , Greg Kroah-Hartman , Alexander Viro , Arnd Bergmann , Miguel Ojeda Cc: Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , Trevor Gross , Danilo Krummrich , Matthew Maurer , Lee Jones , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Alice Ryhl , Benno Lossin Subject: Re: [PATCH v3 2/4] rust: iov: add iov_iter abstractions for ITER_DEST In-Reply-To: <20250722-iov-iter-v3-2-3efc9c2c2893@google.com> References: <20250722-iov-iter-v3-0-3efc9c2c2893@google.com> <20250722-iov-iter-v3-2-3efc9c2c2893@google.com> Date: Tue, 05 Aug 2025 13:31:16 +0200 Message-ID: <87y0ry80or.fsf@kernel.org> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "Alice Ryhl" writes: > This adds abstractions for the iov_iter type in the case where > data_source is ITER_DEST. This will make Rust implementations of > fops->read_iter possible. > > This series only has support for using existing IO vectors created by C > code. Additional abstractions will be needed to support the creation of > IO vectors in Rust code. > > These abstractions make the assumption that `struct iov_iter` does not > have internal self-references, which implies that it is valid to move it > between different local variables. > > This patch adds an IovIterDest struct that is very similar to the > IovIterSource from the previous patch. However, as the methods on the > two structs have very little overlap (just getting the length and > advance/revert), I do not think it is worth it to try and deduplicate > this logic. Is it not like 50% duplication? `as_raw`, `len`, `is_empty`, `advance`, `revert`. It looks like it makes sense to me, but =F0=9F=A4=B7 We can alway= s do it later. Reviewed-by: Andreas Hindborg Best regards, Andreas Hindborg