diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-24 14:46:11 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-08 20:25:23 -0500 |
commit | abb78f875f3fcedb88d85eef9f7be7aa474c6727 (patch) | |
tree | fc097b375bb4230c1e1f40ec413ee8f0252e2a1f /mm/iov_iter.c | |
parent | a604ec7e9ffea22fed84db8306585090e7a6e85d (diff) | |
download | linux-abb78f875f3fcedb88d85eef9f7be7aa474c6727.tar.gz linux-abb78f875f3fcedb88d85eef9f7be7aa474c6727.tar.bz2 linux-abb78f875f3fcedb88d85eef9f7be7aa474c6727.zip |
new helper: iov_iter_kvec()
initialization of kvec-backed iov_iter
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/iov_iter.c')
-rw-r--r-- | mm/iov_iter.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mm/iov_iter.c b/mm/iov_iter.c index 1d2cdeb57c58..88c052e63a1d 100644 --- a/mm/iov_iter.c +++ b/mm/iov_iter.c @@ -479,6 +479,19 @@ 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, + size_t count) +{ + BUG_ON(!(direction & ITER_KVEC)); + i->type = direction; + i->kvec = (struct kvec *)iov; + i->nr_segs = nr_segs; + i->iov_offset = 0; + i->count = count; +} +EXPORT_SYMBOL(iov_iter_kvec); + unsigned long iov_iter_alignment(const struct iov_iter *i) { unsigned long res = 0; |