• Home
  • Raw
  • Download

Lines Matching refs:n

20 #define iterate_iovec(i, n, base, len, off, __p, STEP) {	\  argument
24 len = min(n, __p->iov_len - skip); \
30 n -= len; \
36 } while (n); \
38 n = off; \
41 #define iterate_bvec(i, n, base, len, off, p, STEP) { \ argument
44 while (n) { \
50 len = min(min(n, (size_t)(p->bv_len - skip)), \
61 n -= len; \
66 n = off; \
69 #define iterate_xarray(i, n, base, len, __off, STEP) { \ argument
94 len = min(n, len); \
99 n -= len; \
100 if (left || n == 0) \
108 n = __off; \
111 #define __iterate_and_advance(i, n, base, len, off, I, K) { \ argument
112 if (unlikely(i->count < n)) \
113 n = i->count; \
114 if (likely(n)) { \
119 iterate_iovec(i, n, base, len, off, \
127 iterate_bvec(i, n, base, len, off, \
135 iterate_iovec(i, n, base, len, off, \
142 iterate_xarray(i, n, base, len, off, \
145 i->count -= n; \
148 #define iterate_and_advance(i, n, base, len, off, I, K) \ argument
149 __iterate_and_advance(i, n, base, len, off, I, ((void)(K),0))
151 static int copyout(void __user *to, const void *from, size_t n) in copyout() argument
154 return n; in copyout()
155 if (access_ok(to, n)) { in copyout()
156 instrument_copy_to_user(to, from, n); in copyout()
157 n = raw_copy_to_user(to, from, n); in copyout()
159 return n; in copyout()
162 static int copyin(void *to, const void __user *from, size_t n) in copyin() argument
165 return n; in copyin()
166 if (access_ok(from, n)) { in copyin()
167 instrument_copy_from_user(to, from, n); in copyin()
168 n = raw_copy_from_user(to, from, n); in copyin()
170 return n; in copyin()
603 size_t n, off; in copy_pipe_to_iter() local
608 bytes = n = push_pipe(i, bytes, &i_head, &off); in copy_pipe_to_iter()
609 if (unlikely(!n)) in copy_pipe_to_iter()
612 size_t chunk = min_t(size_t, n, PAGE_SIZE - off); in copy_pipe_to_iter()
616 n -= chunk; in copy_pipe_to_iter()
620 } while (n); in copy_pipe_to_iter()
679 static int copyout_mc(void __user *to, const void *from, size_t n) in copyout_mc() argument
681 if (access_ok(to, n)) { in copyout_mc()
682 instrument_copy_to_user(to, from, n); in copyout_mc()
683 n = copy_mc_to_user((__force void *) to, from, n); in copyout_mc()
685 return n; in copyout_mc()
695 size_t n, off, xfer = 0; in copy_mc_pipe_to_iter() local
700 n = push_pipe(i, bytes, &i_head, &off); in copy_mc_pipe_to_iter()
701 while (n) { in copy_mc_pipe_to_iter()
702 size_t chunk = min_t(size_t, n, PAGE_SIZE - off); in copy_mc_pipe_to_iter()
719 n -= chunk; in copy_mc_pipe_to_iter()
833 static inline bool page_copy_sane(struct page *page, size_t offset, size_t n) in page_copy_sane() argument
836 size_t v = n + offset; in page_copy_sane()
845 if (n <= v && v <= PAGE_SIZE) in page_copy_sane()
851 if (likely(n <= v && v <= (page_size(head)))) in page_copy_sane()
889 size_t n = __copy_page_to_iter(page, offset, in copy_page_to_iter() local
891 res += n; in copy_page_to_iter()
892 bytes -= n; in copy_page_to_iter()
893 if (!bytes || !n) in copy_page_to_iter()
895 offset += n; in copy_page_to_iter()
928 size_t n, off; in pipe_zero() local
933 bytes = n = push_pipe(i, bytes, &i_head, &off); in pipe_zero()
934 if (unlikely(!n)) in pipe_zero()
938 size_t chunk = min_t(size_t, n, PAGE_SIZE - off); in pipe_zero()
944 n -= chunk; in pipe_zero()
947 } while (n); in pipe_zero()
1107 size_t n = off - b->offset; in iov_iter_revert() local
1108 if (unroll < n) { in iov_iter_revert()
1112 unroll -= n; in iov_iter_revert()
1141 size_t n = (--bvec)->bv_len; in iov_iter_revert() local
1143 if (unroll <= n) { in iov_iter_revert()
1145 i->iov_offset = n - unroll; in iov_iter_revert()
1148 unroll -= n; in iov_iter_revert()
1153 size_t n = (--iov)->iov_len; in iov_iter_revert() local
1155 if (unroll <= n) { in iov_iter_revert()
1157 i->iov_offset = n - unroll; in iov_iter_revert()
1160 unroll -= n; in iov_iter_revert()
1380 ssize_t n = push_pipe(i, maxsize, &iter_head, start); in __pipe_get_pages() local
1381 if (!n) in __pipe_get_pages()
1384 maxsize = n; in __pipe_get_pages()
1385 n += *start; in __pipe_get_pages()
1386 while (n > 0) { in __pipe_get_pages()
1389 n -= PAGE_SIZE; in __pipe_get_pages()
1526 int n, res; in iov_iter_get_pages() local
1543 n = DIV_ROUND_UP(len, PAGE_SIZE); in iov_iter_get_pages()
1544 res = get_user_pages_fast(addr, n, gup_flags, pages); in iov_iter_get_pages()
1547 return (res == n ? len : res * PAGE_SIZE) - *start; in iov_iter_get_pages()
1553 n = DIV_ROUND_UP(len, PAGE_SIZE); in iov_iter_get_pages()
1554 while (n--) in iov_iter_get_pages()
1566 static struct page **get_pages_array(size_t n) in get_pages_array() argument
1568 return kvmalloc_array(n, sizeof(struct page *), GFP_KERNEL); in get_pages_array()
1577 ssize_t n; in pipe_get_pages_alloc() local
1585 n = npages * PAGE_SIZE - *start; in pipe_get_pages_alloc()
1586 if (maxsize > n) in pipe_get_pages_alloc()
1587 maxsize = n; in pipe_get_pages_alloc()
1593 n = __pipe_get_pages(i, maxsize, p, iter_head, start); in pipe_get_pages_alloc()
1594 if (n > 0) in pipe_get_pages_alloc()
1598 return n; in pipe_get_pages_alloc()
1646 int n, res; in iov_iter_get_pages_alloc() local
1663 n = DIV_ROUND_UP(len, PAGE_SIZE); in iov_iter_get_pages_alloc()
1664 p = get_pages_array(n); in iov_iter_get_pages_alloc()
1667 res = get_user_pages_fast(addr, n, gup_flags, p); in iov_iter_get_pages_alloc()
1674 return (res == n ? len : res * PAGE_SIZE) - *start; in iov_iter_get_pages_alloc()
1680 n = DIV_ROUND_UP(len, PAGE_SIZE); in iov_iter_get_pages_alloc()
1681 *pages = p = get_pages_array(n); in iov_iter_get_pages_alloc()
1684 while (n--) in iov_iter_get_pages_alloc()