History

iov_iter: Add copy_folio_to_iter()

This wrapper around copy_page_to_iter() works because copy_page_to_iter() handles compound pages correctly.

Matthew Wilcox (Oracle) committed 5 years ago

Commit d9c19d31 parent 10331791 file · +7 −0Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/linux/uio.h+7−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77
88 #include <linux/kernel.h>
99 #include <linux/thread_info.h>
10+#include <linux/mm_types.h>
1011 #include <uapi/linux/uio.h>
1112
1213 struct page;
@@ -146,6 +147,12 @@ size_t _copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i); · 133 unmodified lines
146147 size_t _copy_from_iter(void *addr, size_t bytes, struct iov_iter *i);
147148 size_t _copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i);
148149
150+static inline size_t copy_folio_to_iter(struct folio *folio, size_t offset,
151+ size_t bytes, struct iov_iter *i)
152+{
153+ return copy_page_to_iter(&folio->page, offset, bytes, i);
154+}
155+
149156 static __always_inline __must_check
150157 size_t copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i)
151158 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t