From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) (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 EA38A30E0E6 for ; Tue, 19 Aug 2025 17:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.153.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755625305; cv=none; b=iyTwWc72BpurzLvdRFAW11/tUzDapqKKynDKMfizNoOZdvitNxC64S2OYeSkaFIQNlhZkNSbqgda7oHZ8h1ffmhY2zKuWzMvqAdCmhBEsyvpCz/hjcVerzDHqsh+rof1cmw+8nySPYJgFC5QlkGBD0IsJn0Y8YqXKGJOr0n/quQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755625305; c=relaxed/simple; bh=1ZNp140wpq9E0WCbWIbOnetHmPL+ZOGkE6FAFmKO0mo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dgTZEImxhlHrgs63AQHj+c/7PupzPRs8V9uo74PrGyze3BcOXfPL1wDI8M1ASBPWGQgUxVVoxlwJ9fhsFsNMoHGSsMO5pDLdrb2BGSMw5YQIw3TuJRsbdq7cjxEIk9athd7ycxPYmZ8BW5QTIzzzm3438/NfQy7XDa7NGQuYqD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=meta.com; spf=pass smtp.mailfrom=meta.com; dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com header.b=agrYEziu; arc=none smtp.client-ip=67.231.153.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=meta.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=meta.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com header.b="agrYEziu" Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 57JFU4iP1487543 for ; Tue, 19 Aug 2025 10:41:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=s2048-2025-q2; bh=DCB4Rysuy/Bzw8Dv3uCiD4OHIvxqMr6/GXx8GXcfYy4=; b=agrYEziufep9 UFy+WESa0X2OPIDrK8m0zgOnd5SruHnhIo6IPpNKhWkHEVS4rcE+VOlNSH32k67k MghyDTYYAbWlCNZoEh6xuIWNmPGMQAZ/YB2UyLogKXaHI4Z30tpn/4eMclxe9681 JTYV0rmoArX9lIqnbnSpGdJ0bs3VHNcm1RexZxzuelBz29hHtdiprcr7rKKPhymN s1WGTVsfTrNWhJ98wl2D81UD8s7dUgkFaYrjbhDYZL5AmNk2t52iEGdSfde5wQHS 6kiBDt+AyfAMmQznOquwbD7Ky200xwWQbKF3aZF6d0h06PEStV02+fdLNI76zMVi Zk/xvGeTNQ== Received: from maileast.thefacebook.com ([163.114.135.16]) by m0089730.ppops.net (PPS) with ESMTPS id 48muy91amd-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 19 Aug 2025 10:41:41 -0700 (PDT) Received: from twshared10560.01.ash9.facebook.com (2620:10d:c0a8:1b::30) by mail.thefacebook.com (2620:10d:c0a9:6f::237c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.17; Tue, 19 Aug 2025 17:41:39 +0000 Received: by devbig197.nha3.facebook.com (Postfix, from userid 544533) id B83EDC89F31; Tue, 19 Aug 2025 09:49:48 -0700 (PDT) From: Keith Busch To: , , CC: , , , , , , , , , Keith Busch , Hannes Reinecke Subject: [PATCHv3 8/8] iov_iter: remove iov_iter_is_aligned Date: Tue, 19 Aug 2025 09:49:22 -0700 Message-ID: <20250819164922.640964-9-kbusch@meta.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250819164922.640964-1-kbusch@meta.com> References: <20250819164922.640964-1-kbusch@meta.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODE5MDE2MyBTYWx0ZWRfX1BmlsDc9d5lj RsEy9V6LxYPtTOTch9lb9wu8lJizI0ifsKKwZRAp2xwaklbl9lW+lxoGzA7hChKCe3xCu62En11 uu5TjCYEX3u4vKEyQtGS+XzqgTLlJ0B7R4NpZTK4LxATePwiljkFESaSZucNhxcyGin49b6M5Ty DKEKOOxx+k+rDbLfeHOwfbcKsiiQymj/wltTNvci5z3UCshNxjSHKhJDd5ucEFZyyNbxuOlEHTk 6uODbESrcGPV4Wv7uNBY2hoOcRY60QH7NlFzjEO0iVZiluie8awyV7Mk3drTHSLHDxpbrTyQguj PMEYdM/AIaREhQxI3DvX1TRuhCz7ILuVnSAjreWOBoRLeCt3P+AhEWxc1JHm0YY21ApsIQah/OS BUpispetdZJuf/iZeY11muOr7uUKlEvxNv2WuQxnmmhZ8Eazn5JXPnxn+vLnc6Xm4y2RUf69 X-Proofpoint-GUID: phQUuzHwFh1tu9YEjR44QmnLU9ypDVZg X-Proofpoint-ORIG-GUID: phQUuzHwFh1tu9YEjR44QmnLU9ypDVZg X-Authority-Analysis: v=2.4 cv=Qatmvtbv c=1 sm=1 tr=0 ts=68a4b755 cx=c_pps a=MfjaFnPeirRr97d5FC5oHw==:117 a=MfjaFnPeirRr97d5FC5oHw==:17 a=2OwXVqhp2XgA:10 a=VwQbUJbxAAAA:8 a=yPCof4ZbAAAA:8 a=S-mNSWGAXQVMvOK0xjcA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-19_02,2025-08-14_01,2025-03-28_01 From: Keith Busch No more callers. Signed-off-by: Keith Busch Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen --- include/linux/uio.h | 2 - lib/iov_iter.c | 95 --------------------------------------------- 2 files changed, 97 deletions(-) diff --git a/include/linux/uio.h b/include/linux/uio.h index 2e86c653186c6..5b127043a1519 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -286,8 +286,6 @@ size_t _copy_mc_to_iter(const void *addr, size_t byte= s, struct iov_iter *i); #endif =20 size_t iov_iter_zero(size_t bytes, struct iov_iter *); -bool iov_iter_is_aligned(const struct iov_iter *i, unsigned addr_mask, - unsigned len_mask); unsigned long iov_iter_alignment(const struct iov_iter *i); unsigned long iov_iter_gap_alignment(const struct iov_iter *i); void iov_iter_init(struct iov_iter *i, unsigned int direction, const str= uct iovec *iov, diff --git a/lib/iov_iter.c b/lib/iov_iter.c index f9193f952f499..2fe66a6b8789e 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -784,101 +784,6 @@ void iov_iter_discard(struct iov_iter *i, unsigned = int direction, size_t count) } EXPORT_SYMBOL(iov_iter_discard); =20 -static bool iov_iter_aligned_iovec(const struct iov_iter *i, unsigned ad= dr_mask, - unsigned len_mask) -{ - const struct iovec *iov =3D iter_iov(i); - size_t size =3D i->count; - size_t skip =3D i->iov_offset; - - do { - size_t len =3D iov->iov_len - skip; - - if (len > size) - len =3D size; - if (len & len_mask) - return false; - if ((unsigned long)(iov->iov_base + skip) & addr_mask) - return false; - - iov++; - size -=3D len; - skip =3D 0; - } while (size); - - return true; -} - -static bool iov_iter_aligned_bvec(const struct iov_iter *i, unsigned add= r_mask, - unsigned len_mask) -{ - const struct bio_vec *bvec =3D i->bvec; - unsigned skip =3D i->iov_offset; - size_t size =3D i->count; - - do { - size_t len =3D bvec->bv_len - skip; - - if (len > size) - len =3D size; - if (len & len_mask) - return false; - if ((unsigned long)(bvec->bv_offset + skip) & addr_mask) - return false; - - bvec++; - size -=3D len; - skip =3D 0; - } while (size); - - return true; -} - -/** - * iov_iter_is_aligned() - Check if the addresses and lengths of each se= gments - * are aligned to the parameters. - * - * @i: &struct iov_iter to restore - * @addr_mask: bit mask to check against the iov element's addresses - * @len_mask: bit mask to check against the iov element's lengths - * - * Return: false if any addresses or lengths intersect with the provided= masks - */ -bool iov_iter_is_aligned(const struct iov_iter *i, unsigned addr_mask, - unsigned len_mask) -{ - if (likely(iter_is_ubuf(i))) { - if (i->count & len_mask) - return false; - if ((unsigned long)(i->ubuf + i->iov_offset) & addr_mask) - return false; - return true; - } - - if (likely(iter_is_iovec(i) || iov_iter_is_kvec(i))) - return iov_iter_aligned_iovec(i, addr_mask, len_mask); - - if (iov_iter_is_bvec(i)) - return iov_iter_aligned_bvec(i, addr_mask, len_mask); - - /* With both xarray and folioq types, we're dealing with whole folios. = */ - if (iov_iter_is_xarray(i)) { - if (i->count & len_mask) - return false; - if ((i->xarray_start + i->iov_offset) & addr_mask) - return false; - } - if (iov_iter_is_folioq(i)) { - if (i->count & len_mask) - return false; - if (i->iov_offset & addr_mask) - return false; - } - - return true; -} -EXPORT_SYMBOL_GPL(iov_iter_is_aligned); - static unsigned long iov_iter_alignment_iovec(const struct iov_iter *i) { const struct iovec *iov =3D iter_iov(i); --=20 2.47.3