Unverified Commit 7ebc540b authored by David Howells's avatar David Howells Committed by Christian Brauner
Browse files

infiniband: Use user_backed_iter() to see if iterator is UBUF/IOVEC



Use user_backed_iter() to see if iterator is UBUF/IOVEC rather than poking
inside the iterator.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20230925120309.1731676-5-dhowells@redhat.com


cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
cc: Jason Gunthorpe <jgg@ziepe.ca>
cc: Leon Romanovsky <leon@kernel.org>
cc: linux-rdma@vger.kernel.org
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 1fcb7128
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from)

	if (!HFI1_CAP_IS_KSET(SDMA))
		return -EINVAL;
	if (!from->user_backed)
	if (!user_backed_iter(from))
		return -EINVAL;
	idx = srcu_read_lock(&fd->pq_srcu);
	pq = srcu_dereference(fd->pq, &fd->pq_srcu);
+1 −1
Original line number Diff line number Diff line
@@ -2244,7 +2244,7 @@ static ssize_t qib_write_iter(struct kiocb *iocb, struct iov_iter *from)
	struct qib_ctxtdata *rcd = ctxt_fp(iocb->ki_filp);
	struct qib_user_sdma_queue *pq = fp->pq;

	if (!from->user_backed || !from->nr_segs || !pq)
	if (!user_backed_iter(from) || !from->nr_segs || !pq)
		return -EINVAL;

	return qib_user_sdma_writev(rcd, pq, iter_iov(from), from->nr_segs);