Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\iov_iter.c Create Date:2022-07-28 06:21:06
Last Modify:2022-05-21 11:43:54 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:copy_page_from_iter_iovec

Proto:static size_t copy_page_from_iter_iovec(struct page *page, size_t offset, size_t bytes, struct iov_iter *i)

Type:size_t

Parameter:

TypeParameterName
struct page *page
size_toffset
size_tbytes
struct iov_iter *i
245  __user * buf
248  If Value for the false possibility is greater at compile time(bytes > count) Then bytes = count
251  If Value for the false possibility is greater at compile time(!bytes) Then Return 0
254  might_fault()
255  wanted = bytes
256  iov = iov
257  skip = iov_offset
258  buf = BSD uses caddr_t (1003.1g requires void *) + skip
259  copy = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(bytes, Must be size_t (1003.1g) - skip)
261  If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_HIGHMEM) && Not fault_in_pages_readable(buf, copy) Then
262  kaddr = kmap_atomic(page)
263  to = kaddr + offset
266  left = copyin(to, buf, copy)
267  copy -= left
268  skip += copy
269  to += copy
270  bytes -= copy
273  iov++
276  left = copyin(to, buf, copy)
277  copy -= left
278  skip = copy
279  to += copy
280  bytes -= copy
284  Go to done
286  offset = to - kaddr
287  buf += copy
288  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(kaddr)
289  copy = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(bytes, Must be size_t (1003.1g) - skip)
293  kaddr = kmap(page)
294  to = kaddr + offset
295  left = copyin(to, buf, copy)
296  copy -= left
297  skip += copy
298  to += copy
299  bytes -= copy
300  When Value for the false possibility is greater at compile time(!left && bytes) cycle
301  iov++
302  buf = BSD uses caddr_t (1003.1g requires void *)
303  copy = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(bytes, Must be size_t (1003.1g) )
304  left = copyin(to, buf, copy)
305  copy -= left
306  skip = copy
307  to += copy
308  bytes -= copy
310  kunmap(page)
312  done :
313  If skip == Must be size_t (1003.1g) Then
314  iov++
315  skip = 0
317  count -= wanted - bytes
318  nr_segs -= iov - iov
319  iov = iov
320  iov_offset = skip
321  Return wanted - bytes
Caller
NameDescribe
copy_page_from_iter