Lines Matching refs:len

59 static int do_op_one_page(unsigned long addr, int len, int is_write,  in do_op_one_page()  argument
60 int (*op)(unsigned long addr, int len, void *arg), void *arg) in do_op_one_page()
79 n = (*op)(addr, len, arg); in do_op_one_page()
90 static int buffer_op(unsigned long addr, int len, int is_write, in buffer_op() argument
95 size = min(PAGE_ALIGN(addr) - addr, (unsigned long) len); in buffer_op()
96 remain = len; in buffer_op()
133 static int copy_chunk_from_user(unsigned long from, int len, void *arg) in copy_chunk_from_user() argument
137 memcpy((void *) to, (void *) from, len); in copy_chunk_from_user()
138 *to_ptr += len; in copy_chunk_from_user()
155 static int copy_chunk_to_user(unsigned long to, int len, void *arg) in copy_chunk_to_user() argument
159 memcpy((void *) to, (void *) from, len); in copy_chunk_to_user()
160 *from_ptr += len; in copy_chunk_to_user()
177 static int strncpy_chunk_from_user(unsigned long from, int len, void *arg) in strncpy_chunk_from_user() argument
182 strncpy(to, (void *) from, len); in strncpy_chunk_from_user()
183 n = strnlen(to, len); in strncpy_chunk_from_user()
186 if (n < len) in strncpy_chunk_from_user()
212 static int clear_chunk(unsigned long addr, int len, void *unused) in clear_chunk() argument
214 memset((void *) addr, 0, len); in clear_chunk()
218 int __clear_user(void __user *mem, int len) in __clear_user() argument
220 return buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL); in __clear_user()
223 int clear_user(void __user *mem, int len) in clear_user() argument
226 memset((__force void*)mem, 0, len); in clear_user()
230 return access_ok(VERIFY_WRITE, mem, len) ? in clear_user()
231 buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len; in clear_user()
235 static int strnlen_chunk(unsigned long str, int len, void *arg) in strnlen_chunk() argument
239 n = strnlen((void *) str, len); in strnlen_chunk()
242 if (n < len) in strnlen_chunk()
247 int strnlen_user(const void __user *str, int len) in strnlen_user() argument
252 return strnlen((__force char*)str, len) + 1; in strnlen_user()
254 n = buffer_op((unsigned long) str, len, 0, strnlen_chunk, &count); in strnlen_user()