Skip to content

Commit 7ebc540

Browse files
dhowellsbrauner
authored andcommitted
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>
1 parent 1fcb712 commit 7ebc540

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/infiniband/hw/hfi1/file_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from)
267267

268268
if (!HFI1_CAP_IS_KSET(SDMA))
269269
return -EINVAL;
270-
if (!from->user_backed)
270+
if (!user_backed_iter(from))
271271
return -EINVAL;
272272
idx = srcu_read_lock(&fd->pq_srcu);
273273
pq = srcu_dereference(fd->pq, &fd->pq_srcu);

drivers/infiniband/hw/qib/qib_file_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2244,7 +2244,7 @@ static ssize_t qib_write_iter(struct kiocb *iocb, struct iov_iter *from)
22442244
struct qib_ctxtdata *rcd = ctxt_fp(iocb->ki_filp);
22452245
struct qib_user_sdma_queue *pq = fp->pq;
22462246

2247-
if (!from->user_backed || !from->nr_segs || !pq)
2247+
if (!user_backed_iter(from) || !from->nr_segs || !pq)
22482248
return -EINVAL;
22492249

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

0 commit comments

Comments
 (0)