Re: [PATCH 5/9 next] scsi: Use iovec_import() instead of import_iovec().

From
Christoph Hellwig <hch@infradead.org>
Date
2020-09-21 14:22:12
Also in
io-uring, linux-fsdevel, lkml
Reply to
David Laight, 2020-09-15
So looking at the various callers I'm not sure this API is the
best.  If we want to do something fancy I'd hide the struct iovec
instances entirely with something like:

struct iov_storage {
	struct iovec stack[UIO_FASTIOV], *vec;
}

int iov_iter_import_iovec(struct iov_iter *iter, struct iov_storage *s,
		const struct iovec __user *vec, unsigned long nr_segs,
		int type);

and then add a new helper to free the thing if needed:

void iov_iter_release_iovec(struct iov_storage *s)
{
	if (s->vec != s->stack)
		kfree(s->vec);
}
Thread (4 messages) 4 messages, 2 authors, last reply 2021-01-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help