diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-23 09:08:07 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-29 08:13:11 +0300 |
commit | 05afcb77eb4713f46e7ebaa3cb54bc465c5d516e (patch) | |
tree | feeafbb29a9a41fb7d85ff55fdb624eaa918907f /mm/iov_iter.c | |
parent | 26bc420b59a38e4e6685a73345a0def461136dce (diff) | |
download | linux-05afcb77eb4713f46e7ebaa3cb54bc465c5d516e.tar.xz |
new helper: iov_iter_bvec()
similar to iov_iter_kvec(), for ITER_BVEC ones
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/iov_iter.c')
-rw-r--r-- | mm/iov_iter.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/mm/iov_iter.c b/mm/iov_iter.c index a1599ca4ab0e..827732047da1 100644 --- a/mm/iov_iter.c +++ b/mm/iov_iter.c @@ -501,18 +501,31 @@ size_t iov_iter_single_seg_count(const struct iov_iter *i) EXPORT_SYMBOL(iov_iter_single_seg_count); void iov_iter_kvec(struct iov_iter *i, int direction, - const struct kvec *iov, unsigned long nr_segs, + const struct kvec *kvec, unsigned long nr_segs, size_t count) { BUG_ON(!(direction & ITER_KVEC)); i->type = direction; - i->kvec = (struct kvec *)iov; + i->kvec = kvec; i->nr_segs = nr_segs; i->iov_offset = 0; i->count = count; } EXPORT_SYMBOL(iov_iter_kvec); +void iov_iter_bvec(struct iov_iter *i, int direction, + const struct bio_vec *bvec, unsigned long nr_segs, + size_t count) +{ + BUG_ON(!(direction & ITER_BVEC)); + i->type = direction; + i->bvec = bvec; + i->nr_segs = nr_segs; + i->iov_offset = 0; + i->count = count; +} +EXPORT_SYMBOL(iov_iter_bvec); + unsigned long iov_iter_alignment(const struct iov_iter *i) { unsigned long res = 0; |