/* Return the count of just the current iov_iter segment.  */
size_t iov_iter_single_seg_count(struct iov_iter *i)
/* Return the count of just the current iov_iter segment.  */
size_t iov_iter_single_seg_count(struct iov_iter *i)
{
	const struct iovec *iov = i->iov;
	if (i->nr_segs == 1)
		return i->count;
	else
		return min(i->count, iov->iov_len - i->iov_offset);
}