From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 643A73BB108 for ; Mon, 18 May 2026 22:32:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779143560; cv=none; b=QyH1N7Wdci8mIiFHz38W2ga4jv0155jBXepejg4Xn0DMWHFrK2q3vKsHOATuEd7QpGKCUG6K5O5Xhi+pjvxYpgOx+AOZBVpLkL1AcdZjkfJNrFV7xhk3g9EkzNRuO3jDBrf9zwMLh79LIxuWH331jSLCjrcMC+dzNJcOTfVpMeQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779143560; c=relaxed/simple; bh=RDoZM2bAZ4Qsft6qMwShgl3rUgUZosExTNOAqAchX3Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UvMEAonQ6xtfEaEszi/QPRlLu4pz3pTKQ9Dn+RaX7aVBTsD6FajraR6odvjQ6JjM7SUJhLExGGgEIc+dTys0QUlWxO73thd47SAXwHSwNtZfsivpIgweFZ0BCK0De+mKECW8UrFxfIg8gLxvWceLYGAgURujlpHKHSCeRc8AZfM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=C8Oa3z/t; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="C8Oa3z/t" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779143556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qGlfupTHkD4ku9IDSUoOP8kdkJKy1we0jMDsuXnaNZs=; b=C8Oa3z/tjB3jSU8eNq21FDI1GqQddZDzakefgyEJHdYafRGmfw5NiU7+6scEqFJQRtDiMV Upy7p98EIqM9ItZCJ9faB9JR5Ef+Qltji5hZSfTi3tMo0rmi99SEAaJ5jNp/IcC4Sov2U5 NsHssKdfcQt1ovTqQL8EGNxZRNW7JJE= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-450-4qyYzh9BMSurSxqG4zREXg-1; Mon, 18 May 2026 18:32:24 -0400 X-MC-Unique: 4qyYzh9BMSurSxqG4zREXg-1 X-Mimecast-MFC-AGG-ID: 4qyYzh9BMSurSxqG4zREXg_1779143532 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7393319560B7; Mon, 18 May 2026 22:32:12 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.48.33]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9A0151956053; Mon, 18 May 2026 22:32:05 +0000 (UTC) From: David Howells To: Christian Brauner , Matthew Wilcox , Christoph Hellwig Cc: David Howells , Paulo Alcantara , Jens Axboe , Leon Romanovsky , Steve French , ChenXiaoSong , Marc Dionne , Eric Van Hensbergen , Dominique Martinet , Ilya Dryomov , Trond Myklebust , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Metzmacher , Shyam Prasad N , Tom Talpey Subject: [PATCH v2 14/21] cifs: Remove support for ITER_FOLIOQ from smb_extract_iter_to_rdma() Date: Mon, 18 May 2026 23:29:46 +0100 Message-ID: <20260518222959.488126-15-dhowells@redhat.com> In-Reply-To: <20260518222959.488126-1-dhowells@redhat.com> References: <20260518222959.488126-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 netfslib now only presents an bvecq queue and an associated ITER_BVECQ iterator to the filesystem, so it isn't going to see the ITER_FOLIOQ iterator. So remove that code. Netfslib also won't supply ITER_BVEC/KVEC iterators, though smbdirect might; further in future, it won't supply iterators at all, but rather a bvecq slice (that can be used to construct an iterator). Signed-off-by: David Howells cc: Steve French cc: Paulo Alcantara cc: Stefan Metzmacher cc: Shyam Prasad N cc: Tom Talpey cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/smb/smbdirect/connection.c | 68 ----------------------------------- 1 file changed, 68 deletions(-) diff --git a/fs/smb/smbdirect/connection.c b/fs/smb/smbdirect/connection.c index 4d2a1700104e..8858e1dfbc25 100644 --- a/fs/smb/smbdirect/connection.c +++ b/fs/smb/smbdirect/connection.c @@ -6,7 +6,6 @@ #include "internal.h" #include -#include struct smbdirect_map_sges { struct ib_sge *sge; @@ -2130,70 +2129,6 @@ static ssize_t smbdirect_map_sges_from_kvec(struct iov_iter *iter, return ret; } -/* - * Extract folio fragments from a FOLIOQ-class iterator and add them to an - * ib_sge list. The folios are not pinned. - */ -static ssize_t smbdirect_map_sges_from_folioq(struct iov_iter *iter, - struct smbdirect_map_sges *state, - ssize_t maxsize) -{ - const struct folio_queue *folioq = iter->folioq; - unsigned int slot = iter->folioq_slot; - ssize_t ret = 0; - size_t offset = iter->iov_offset; - - if (WARN_ON_ONCE(!folioq)) - return -EIO; - - if (slot >= folioq_nr_slots(folioq)) { - folioq = folioq->next; - if (WARN_ON_ONCE(!folioq)) - return -EIO; - slot = 0; - } - - do { - struct folio *folio = folioq_folio(folioq, slot); - size_t fsize = folioq_folio_size(folioq, slot); - - if (offset < fsize) { - size_t part = umin(maxsize, fsize - offset); - bool ok; - - ok = smbdirect_map_sges_single_page(state, - folio_page(folio, 0), - offset, - part); - if (!ok) - return -EIO; - - offset += part; - ret += part; - maxsize -= part; - } - - if (offset >= fsize) { - offset = 0; - slot++; - if (slot >= folioq_nr_slots(folioq)) { - if (!folioq->next) { - WARN_ON_ONCE(ret < iter->count); - break; - } - folioq = folioq->next; - slot = 0; - } - } - } while (state->num_sge < state->max_sge && maxsize > 0); - - iter->folioq = folioq; - iter->folioq_slot = slot; - iter->iov_offset = offset; - iter->count -= ret; - return ret; -} - /* * Extract page fragments from up to the given amount of the source iterator * and build up an ib_sge list that refers to all of those bits. The ib_sge list @@ -2224,9 +2159,6 @@ static ssize_t smbdirect_map_sges_from_iter(struct iov_iter *iter, size_t len, case ITER_KVEC: ret = smbdirect_map_sges_from_kvec(iter, state, len); break; - case ITER_FOLIOQ: - ret = smbdirect_map_sges_from_folioq(iter, state, len); - break; default: WARN_ONCE(1, "iov_iter_type[%u]\n", iov_iter_type(iter)); return -EIO;