[PATCH] iov_iter: add missing handling for ITER_KVEC in iov_iter_single_seg_count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This seems to currently work by happenstance since kvec and iovec fields
basically the same, but it's probably better to make this explicit.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
 lib/iov_iter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index f2bd21b93dfc..6b415b5a100d 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -738,6 +738,8 @@ size_t iov_iter_single_seg_count(const struct iov_iter *i)
 		return i->count;
 	else if (i->type & ITER_BVEC)
 		return min(i->count, i->bvec->bv_len - i->iov_offset);
+	else if (i->type & ITER_KVEC)
+		return min(i->count, i->kvec->iov_len - i->iov_offset);
 	else
 		return min(i->count, i->iov->iov_len - i->iov_offset);
 }
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux