Lines Matching refs: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()
53 static inline int copy_from_sockptr(void *dst, sockptr_t src, size_t size) in copy_from_sockptr() argument
55 return copy_from_sockptr_offset(dst, src, 0, size); in copy_from_sockptr()
59 const void *src, size_t size) in copy_to_sockptr_offset() argument
62 return copy_to_user(dst.user + offset, src, size); in copy_to_sockptr_offset()
63 memcpy(dst.kernel + offset, src, size); in copy_to_sockptr_offset()
67 static inline int copy_to_sockptr(sockptr_t dst, const void *src, size_t size) in copy_to_sockptr() argument
69 return copy_to_sockptr_offset(dst, 0, src, size); in copy_to_sockptr()
72 static inline void *memdup_sockptr(sockptr_t src, size_t len) in memdup_sockptr() argument
78 if (copy_from_sockptr(p, src, len)) { in memdup_sockptr()
85 static inline void *memdup_sockptr_nul(sockptr_t src, size_t len) in memdup_sockptr_nul() argument
91 if (copy_from_sockptr(p, src, len)) { in memdup_sockptr_nul()
99 static inline long strncpy_from_sockptr(char *dst, sockptr_t src, size_t count) in strncpy_from_sockptr() argument
101 if (sockptr_is_kernel(src)) { in strncpy_from_sockptr()
102 size_t len = min(strnlen(src.kernel, count - 1) + 1, count); in strncpy_from_sockptr()
104 memcpy(dst, src.kernel, len); in strncpy_from_sockptr()
107 return strncpy_from_user(dst, src.user, count); in strncpy_from_sockptr()
110 static inline int check_zeroed_sockptr(sockptr_t src, size_t offset, in check_zeroed_sockptr() argument
113 if (!sockptr_is_kernel(src)) in check_zeroed_sockptr()
114 return check_zeroed_user(src.user + offset, size); in check_zeroed_sockptr()
115 return memchr_inv(src.kernel + offset, 0, size) == NULL; in check_zeroed_sockptr()