On Mon, 26 May 2025 17:20:58 +0200
Laurent Vivier
On 26/05/2025 16:19, Stefano Brivio wrote:
+ * @dst_iov_cnt: Maximum number of elements in the destination iov array. + * @iov: Pointer to the source array of struct iovec describing + * the scatter/gather I/O vector to copy from. + * @iov_cnt: Maximum number of elements in the source iov array. + * @offset: Offset within the source iov from where copying should start. I would mention explicitly this is only for the first iov, otherwise it might look like it's a fixed offset that applies to all elements (...until you find the offset = 0 assignment below), say:
It's not an offset for the first iov, it's offset in the entire data.
...well, yes, that's what I meant, in the entire data, but not _for each element_ (that is, if the source iov has two items, and @offset is 5, we skip 5 bytes in total, not 10 bytes). Given that the first iov is the first iov of the entire data, one could also say that it applies to the first iov (assuming we mean the same thing). Hence the possible confusion. However:
We skip this offset using:
i = iov_skip_bytes(iov, iov_cnt, offset, &offset);
so we skip all iov entries until 'i' and then we apply the remaining offset to entry 'i'.
Perhaps:
@offset: Data offset within the source iov array from where copying should start
that's much clearer and I'd say unambiguous, yes. -- Stefano