Skip to content

Commit

Permalink
Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/viro/vfs

Pull iov_iter infrastructure updates from Al Viro:
 "A couple of iov_iter updates"

* 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  iov_iter: export import_single_range()
  iov_iter: constify {csum_and_,}copy_to_iter()
  • Loading branch information
torvalds committed Jan 13, 2016
2 parents fce205e + e126758 commit ca9706a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/linux/uio.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
struct iov_iter *i);
size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
struct iov_iter *i);
size_t copy_to_iter(void *addr, size_t bytes, struct iov_iter *i);
size_t copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i);
size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i);
size_t copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i);
size_t iov_iter_zero(size_t bytes, struct iov_iter *);
Expand Down Expand Up @@ -145,7 +145,7 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count)
{
i->count = count;
}
size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
size_t csum_and_copy_to_iter(const void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);

int import_iovec(int type, const struct iovec __user * uvector,
Expand Down
11 changes: 6 additions & 5 deletions lib/iov_iter.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ static void memcpy_from_page(char *to, struct page *page, size_t offset, size_t
kunmap_atomic(from);
}

static void memcpy_to_page(struct page *page, size_t offset, char *from, size_t len)
static void memcpy_to_page(struct page *page, size_t offset, const char *from, size_t len)
{
char *to = kmap_atomic(page);
memcpy(to + offset, from, len);
Expand All @@ -383,9 +383,9 @@ static void memzero_page(struct page *page, size_t offset, size_t len)
kunmap_atomic(addr);
}

size_t copy_to_iter(void *addr, size_t bytes, struct iov_iter *i)
size_t copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i)
{
char *from = addr;
const char *from = addr;
if (unlikely(bytes > i->count))
bytes = i->count;

Expand Down Expand Up @@ -704,10 +704,10 @@ size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum,
}
EXPORT_SYMBOL(csum_and_copy_from_iter);

size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum,
size_t csum_and_copy_to_iter(const void *addr, size_t bytes, __wsum *csum,
struct iov_iter *i)
{
char *from = addr;
const char *from = addr;
__wsum sum, next;
size_t off = 0;
if (unlikely(bytes > i->count))
Expand Down Expand Up @@ -849,3 +849,4 @@ int import_single_range(int rw, void __user *buf, size_t len,
iov_iter_init(i, rw, iov, 1, len);
return 0;
}
EXPORT_SYMBOL(import_single_range);

0 comments on commit ca9706a

Please sign in to comment.