summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-05-02 19:49:46 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-02 19:49:46 -0400
commitdf889b363198d946c0286b3fb2cfcca18d08a029 (patch)
tree22846d29e33c6f01058d76b7aeccd64baa50731a /lib
parentce8644fcadc52da72e19ae9f0866fb3eb15d3df4 (diff)
parent10c64cea04d3c75c306b3f990586ffb343b63287 (diff)
downloadlinux-df889b363198d946c0286b3fb2cfcca18d08a029.tar.gz
linux-df889b363198d946c0286b3fb2cfcca18d08a029.tar.bz2
linux-df889b363198d946c0286b3fb2cfcca18d08a029.zip
Merge branch 'for-linus' into work.lookups
Diffstat (limited to 'lib')
-rw-r--r--lib/iov_iter.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 5fecddc32b1b..ca5316e0087b 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -569,6 +569,25 @@ unsigned long iov_iter_alignment(const struct iov_iter *i)
}
EXPORT_SYMBOL(iov_iter_alignment);
+unsigned long iov_iter_gap_alignment(const struct iov_iter *i)
+{
+ unsigned long res = 0;
+ size_t size = i->count;
+ if (!size)
+ return 0;
+
+ iterate_all_kinds(i, size, v,
+ (res |= (!res ? 0 : (unsigned long)v.iov_base) |
+ (size != v.iov_len ? size : 0), 0),
+ (res |= (!res ? 0 : (unsigned long)v.bv_offset) |
+ (size != v.bv_len ? size : 0)),
+ (res |= (!res ? 0 : (unsigned long)v.iov_base) |
+ (size != v.iov_len ? size : 0))
+ );
+ return res;
+}
+EXPORT_SYMBOL(iov_iter_gap_alignment);
+
ssize_t iov_iter_get_pages(struct iov_iter *i,
struct page **pages, size_t maxsize, unsigned maxpages,
size_t *start)