kill iov_shorten()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
0e5b935d43
commit
faea13297e
@ -634,27 +634,6 @@ SYSCALL_DEFINE4(pwrite64, unsigned int, fd, const char __user *, buf,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Reduce an iovec's length in-place. Return the resulting number of segments
|
|
||||||
*/
|
|
||||||
unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to)
|
|
||||||
{
|
|
||||||
unsigned long seg = 0;
|
|
||||||
size_t len = 0;
|
|
||||||
|
|
||||||
while (seg < nr_segs) {
|
|
||||||
seg++;
|
|
||||||
if (len + iov->iov_len >= to) {
|
|
||||||
iov->iov_len = to - len;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
len += iov->iov_len;
|
|
||||||
iov++;
|
|
||||||
}
|
|
||||||
return seg;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(iov_shorten);
|
|
||||||
|
|
||||||
static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter,
|
static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter,
|
||||||
loff_t *ppos, int type, rwf_t flags)
|
loff_t *ppos, int type, rwf_t flags)
|
||||||
{
|
{
|
||||||
|
@ -80,8 +80,6 @@ static inline struct iovec iov_iter_iovec(const struct iov_iter *iter)
|
|||||||
((iov = iov_iter_iovec(&(iter))), 1); \
|
((iov = iov_iter_iovec(&(iter))), 1); \
|
||||||
iov_iter_advance(&(iter), (iov).iov_len))
|
iov_iter_advance(&(iter), (iov).iov_len))
|
||||||
|
|
||||||
unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
|
|
||||||
|
|
||||||
size_t iov_iter_copy_from_user_atomic(struct page *page,
|
size_t iov_iter_copy_from_user_atomic(struct page *page,
|
||||||
struct iov_iter *i, unsigned long offset, size_t bytes);
|
struct iov_iter *i, unsigned long offset, size_t bytes);
|
||||||
void iov_iter_advance(struct iov_iter *i, size_t bytes);
|
void iov_iter_advance(struct iov_iter *i, size_t bytes);
|
||||||
|
Loading…
Reference in New Issue
Block a user