diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-22 14:51:37 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-07 01:32:54 +0400 |
commit | 0c949334a9e2581646c6ff0d1470a805b1e5be99 (patch) | |
tree | 60a4d6bc2260d648915baa9b78626cd4b6915431 /include/linux/uio.h | |
parent | 28060d5d9b261da110afe48aae7a2aa6555f798f (diff) | |
download | linux-0c949334a9e2581646c6ff0d1470a805b1e5be99.tar.xz |
iov_iter_truncate()
Now It Can Be Done(tm) - we don't need to do iov_shorten() in
generic_file_direct_write() anymore, now that all ->direct_IO()
instances are converted to proper iov_iter methods and honour
iter->count and iter->iov_offset properly.
Get rid of count/ocount arguments of generic_file_direct_write(),
while we are at it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/uio.h')
-rw-r--r-- | include/linux/uio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/uio.h b/include/linux/uio.h index 4876e9f2a58f..532f59d0adbb 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -82,6 +82,12 @@ static inline size_t iov_iter_count(struct iov_iter *i) return i->count; } +static inline void iov_iter_truncate(struct iov_iter *i, size_t count) +{ + if (i->count > count) + i->count = count; +} + int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len); |