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: David 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: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
1fcb71282e
commit
7ebc540b35
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user