Lines Matching full:src
44 static inline int copy_from_sockptr_offset(void *dst, sockptr_t src, in copy_from_sockptr_offset() argument
47 if (!sockptr_is_kernel(src)) in copy_from_sockptr_offset()
48 return copy_from_user(dst, src.user + offset, size); in copy_from_sockptr_offset()
49 memcpy(dst, src.kernel + offset, size); in copy_from_sockptr_offset()
57 static inline int copy_from_sockptr(void *dst, sockptr_t src, size_t size) in copy_from_sockptr() argument
59 return copy_from_sockptr_offset(dst, src, 0, size); in copy_from_sockptr()
86 sockptr_t src, size_t usize) in copy_struct_from_sockptr() argument
91 if (!sockptr_is_kernel(src)) in copy_struct_from_sockptr()
92 return copy_struct_from_user(dst, ksize, src.user, size); in copy_struct_from_sockptr()
97 char *p = src.kernel; in copy_struct_from_sockptr()
104 memcpy(dst, src.kernel, size); in copy_struct_from_sockptr()
109 const void *src, size_t size) in copy_to_sockptr_offset() argument
112 return copy_to_user(dst.user + offset, src, size); in copy_to_sockptr_offset()
113 memcpy(dst.kernel + offset, src, size); in copy_to_sockptr_offset()
117 static inline int copy_to_sockptr(sockptr_t dst, const void *src, size_t size) in copy_to_sockptr() argument
119 return copy_to_sockptr_offset(dst, 0, src, size); in copy_to_sockptr()
122 static inline void *memdup_sockptr_noprof(sockptr_t src, size_t len) in memdup_sockptr_noprof() argument
128 if (copy_from_sockptr(p, src, len)) { in memdup_sockptr_noprof()
136 static inline void *memdup_sockptr_nul_noprof(sockptr_t src, size_t len) in memdup_sockptr_nul_noprof() argument
142 if (copy_from_sockptr(p, src, len)) { in memdup_sockptr_nul_noprof()
151 static inline long strncpy_from_sockptr(char *dst, sockptr_t src, size_t count) in strncpy_from_sockptr() argument
153 if (sockptr_is_kernel(src)) { in strncpy_from_sockptr()
154 size_t len = min(strnlen(src.kernel, count - 1) + 1, count); in strncpy_from_sockptr()
156 memcpy(dst, src.kernel, len); in strncpy_from_sockptr()
159 return strncpy_from_user(dst, src.user, count); in strncpy_from_sockptr()
162 static inline int check_zeroed_sockptr(sockptr_t src, size_t offset, in check_zeroed_sockptr() argument
165 if (!sockptr_is_kernel(src)) in check_zeroed_sockptr()
166 return check_zeroed_user(src.user + offset, size); in check_zeroed_sockptr()
167 return memchr_inv(src.kernel + offset, 0, size) == NULL; in check_zeroed_sockptr()