From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 7CF115A0307 for ; Mon, 03 Jun 2024 06:05:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1717387548; bh=xlcr8TWjbHJIgk5t7cw3m/0/VWooiybaFbKM2j+kzls=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=liJ6Qt7z53tin0Jv+OjgtrEIf4VoghUsSgPwYauGaG3JkSel6KGbKo7C3nbqYcFDH WXuf4KkP7cdVrVFyOhwPA1TGtWwb02HziQF3DkS8Ke08B+7DyZC3LhZZVNJIzcf6LM bR6DbUCaDU9p5pPLM2q8TBfvSlYKrs6WiBty/iMLi4qr5EiR8p5NOTByFSTjBz6TRG 3aHiw1eqdGE8AMuItRp6+S6DRGR7kFBz5Y6/LSk6UkXiUtB5Na7mhZDVpR7Jm/7cC/ rosgVFIByJMFteeqHJL43LEE56GEKuZ/4OIVLA3DN5+/fLmIoXrnE/fB4ynaguEOc0 Wpk75Yym5NwzA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Vt0Wc0Wmmz4wx6; Mon, 3 Jun 2024 14:05:48 +1000 (AEST) Date: Mon, 3 Jun 2024 14:05:39 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v4 08/10] iov: remove iov_copy() Message-ID: References: <20240531142344.1420034-1-lvivier@redhat.com> <20240531142344.1420034-9-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0YIYQ3CWMKrh61zn" Content-Disposition: inline In-Reply-To: <20240531142344.1420034-9-lvivier@redhat.com> Message-ID-Hash: 5G2HP74P625664W55FKN23CSEQXZ4HOU X-Message-ID-Hash: 5G2HP74P625664W55FKN23CSEQXZ4HOU X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --0YIYQ3CWMKrh61zn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 31, 2024 at 04:23:42PM +0200, Laurent Vivier wrote: > it was needed by a draft version of vhost-user, it is not needed > anymore. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson Stefano, I think this could be merged now, independent of the rest of the series. > --- > iov.c | 39 --------------------------------------- > iov.h | 3 --- > 2 files changed, 42 deletions(-) >=20 > diff --git a/iov.c b/iov.c > index 52a7c014a171..3f9e229a305f 100644 > --- a/iov.c > +++ b/iov.c > @@ -156,42 +156,3 @@ size_t iov_size(const struct iovec *iov, size_t iov_= cnt) > =20 > return len; > } > - > -/** > - * iov_copy - Copy data from one scatter/gather I/O vector (struct iovec= ) to > - * another. > - * > - * @dst_iov: Pointer to the destination array of struct iovec descr= ibing > - * the scatter/gather I/O vector to copy to. > - * @dst_iov_cnt: 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: Number of elements in the source iov array. > - * @offset: Offset within the source iov from where copying should= start. > - * @bytes: Total number of bytes to copy from iov to dst_iov. > - * > - * Returns: The number of elements successfully copied to the dest= ination > - * iov array. > - */ > -/* cppcheck-suppress unusedFunction */ > -unsigned iov_copy(struct iovec *dst_iov, size_t dst_iov_cnt, > - const struct iovec *iov, size_t iov_cnt, > - size_t offset, size_t bytes) > -{ > - unsigned int i, j; > - > - i =3D iov_skip_bytes(iov, iov_cnt, offset, &offset); > - > - /* copying data */ > - for (j =3D 0; i < iov_cnt && j < dst_iov_cnt && bytes; i++) { > - size_t len =3D MIN(bytes, iov[i].iov_len - offset); > - > - dst_iov[j].iov_base =3D (char *)iov[i].iov_base + offset; > - dst_iov[j].iov_len =3D len; > - j++; > - bytes -=3D len; > - offset =3D 0; > - } > - > - return j; > -} > diff --git a/iov.h b/iov.h > index 5668ca5f93bc..a9e1722713b3 100644 > --- a/iov.h > +++ b/iov.h > @@ -28,7 +28,4 @@ size_t iov_from_buf(const struct iovec *iov, size_t iov= _cnt, > size_t iov_to_buf(const struct iovec *iov, size_t iov_cnt, > size_t offset, void *buf, size_t bytes); > size_t iov_size(const struct iovec *iov, size_t iov_cnt); > -unsigned iov_copy(struct iovec *dst_iov, size_t dst_iov_cnt, > - const struct iovec *iov, size_t iov_cnt, > - size_t offset, size_t bytes); > #endif /* IOVEC_H */ --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --0YIYQ3CWMKrh61zn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZdQRIACgkQzQJF27ox 2GcuGBAAmpCXReH5tsYKyqTgHWL0c1Fubo1ej1mryA3a1PEvRt0L68MY1tyx1PD2 3XrCtVZg5+NLYMe/su1zkmw4f58U8uOT7b2RlCFyKOaDuQJIDpUXtBXrjcS2cTiw lwAwAwgPzGmuOIXCMwNw+g+5V+IcmtoO/dMqbvOqUM2wbDMJ3NQDTC2vVpkcnIb9 l7p21aXUlg8AuCAvRUQBxaYC+jidSqi+9xTC75QBo5cLb+IUviGnHiqZc5+Rg/Va +3I458aNWB8IGwrxm1J68D16AzmqBTdMBsKQyCrjZKYs1OE6F7TCR69pA20ttLfz CLfwGc3jPqrpIfRoZmJK3l15aQ48Gz32xD509K8Oj5/GTxr2RR4ZXjyiSDZ8jL3n 4Yr5UhXP9aYgt5FNnmb4f9ARVxZZgr8L93XCVpCq58bkSWHCSgMdebpCPi4mgcNI LcHk9yJrGX16sTU1A6YmDiHy4w4Z/kyiGNKLC7qjXp6h6jTiII78uQwh7ijLYkjc LjvcBklq6jDq/iWqLIqr4ETY1WGgEkREoFg0WoWpTH9v8/2NKeviDWkgCrDyCoJd Pz8fI8iK4ZiAo3pvTiLUbFjfJuCLZh9L5ip/TkyXD0diT5iJ2l/1o1TKIjDalKoS QDbXCJMWxpDVGp8weA3r4XAJGMFN+Wg+0PGqJtQLlgymHugjliw= =oQIq -----END PGP SIGNATURE----- --0YIYQ3CWMKrh61zn--