Lines Matching refs:buf
184 struct readdir_callback *buf = in fillonedir() local
189 if (buf->result) in fillonedir()
191 buf->result = verify_dirent_name(name, namlen); in fillonedir()
192 if (buf->result) in fillonedir()
196 buf->result = -EOVERFLOW; in fillonedir()
199 buf->result++; in fillonedir()
200 dirent = buf->dirent; in fillonedir()
214 buf->result = -EFAULT; in fillonedir()
223 struct readdir_callback buf = { in SYSCALL_DEFINE3() local
232 error = iterate_dir(fd_file(f), &buf.ctx); in SYSCALL_DEFINE3()
233 if (buf.result) in SYSCALL_DEFINE3()
234 error = buf.result; in SYSCALL_DEFINE3()
263 struct getdents_callback *buf = in filldir() local
274 buf->error = verify_dirent_name(name, namlen); in filldir()
275 if (unlikely(buf->error)) in filldir()
277 buf->error = -EINVAL; /* only used if we fail.. */ in filldir()
282 buf->error = -EOVERFLOW; in filldir()
285 prev_reclen = buf->prev_reclen; in filldir()
288 dirent = buf->current_dir; in filldir()
301 buf->current_dir = (void __user *)dirent + reclen; in filldir()
302 buf->prev_reclen = reclen; in filldir()
308 buf->error = -EFAULT; in filldir()
316 struct getdents_callback buf = { in SYSCALL_DEFINE3() local
326 error = iterate_dir(fd_file(f), &buf.ctx); in SYSCALL_DEFINE3()
328 error = buf.error; in SYSCALL_DEFINE3()
329 if (buf.prev_reclen) { in SYSCALL_DEFINE3()
331 lastdirent = (void __user *)buf.current_dir - buf.prev_reclen; in SYSCALL_DEFINE3()
333 if (put_user(buf.ctx.pos, &lastdirent->d_off)) in SYSCALL_DEFINE3()
336 error = count - buf.ctx.count; in SYSCALL_DEFINE3()
352 struct getdents_callback64 *buf = in filldir64() local
362 buf->error = verify_dirent_name(name, namlen); in filldir64()
363 if (unlikely(buf->error)) in filldir64()
365 buf->error = -EINVAL; /* only used if we fail.. */ in filldir64()
368 prev_reclen = buf->prev_reclen; in filldir64()
371 dirent = buf->current_dir; in filldir64()
384 buf->prev_reclen = reclen; in filldir64()
385 buf->current_dir = (void __user *)dirent + reclen; in filldir64()
392 buf->error = -EFAULT; in filldir64()
400 struct getdents_callback64 buf = { in SYSCALL_DEFINE3() local
410 error = iterate_dir(fd_file(f), &buf.ctx); in SYSCALL_DEFINE3()
412 error = buf.error; in SYSCALL_DEFINE3()
413 if (buf.prev_reclen) { in SYSCALL_DEFINE3()
415 typeof(lastdirent->d_off) d_off = buf.ctx.pos; in SYSCALL_DEFINE3()
417 lastdirent = (void __user *) buf.current_dir - buf.prev_reclen; in SYSCALL_DEFINE3()
421 error = count - buf.ctx.count; in SYSCALL_DEFINE3()
444 struct compat_readdir_callback *buf = in compat_fillonedir() local
449 if (buf->result) in compat_fillonedir()
451 buf->result = verify_dirent_name(name, namlen); in compat_fillonedir()
452 if (buf->result) in compat_fillonedir()
456 buf->result = -EOVERFLOW; in compat_fillonedir()
459 buf->result++; in compat_fillonedir()
460 dirent = buf->dirent; in compat_fillonedir()
474 buf->result = -EFAULT; in compat_fillonedir()
483 struct compat_readdir_callback buf = { in COMPAT_SYSCALL_DEFINE3() local
492 error = iterate_dir(fd_file(f), &buf.ctx); in COMPAT_SYSCALL_DEFINE3()
493 if (buf.result) in COMPAT_SYSCALL_DEFINE3()
494 error = buf.result; in COMPAT_SYSCALL_DEFINE3()
517 struct compat_getdents_callback *buf = in compat_filldir() local
528 buf->error = verify_dirent_name(name, namlen); in compat_filldir()
529 if (unlikely(buf->error)) in compat_filldir()
531 buf->error = -EINVAL; /* only used if we fail.. */ in compat_filldir()
536 buf->error = -EOVERFLOW; in compat_filldir()
539 prev_reclen = buf->prev_reclen; in compat_filldir()
542 dirent = buf->current_dir; in compat_filldir()
554 buf->prev_reclen = reclen; in compat_filldir()
555 buf->current_dir = (void __user *)dirent + reclen; in compat_filldir()
561 buf->error = -EFAULT; in compat_filldir()
569 struct compat_getdents_callback buf = { in COMPAT_SYSCALL_DEFINE3() local
579 error = iterate_dir(fd_file(f), &buf.ctx); in COMPAT_SYSCALL_DEFINE3()
581 error = buf.error; in COMPAT_SYSCALL_DEFINE3()
582 if (buf.prev_reclen) { in COMPAT_SYSCALL_DEFINE3()
584 lastdirent = (void __user *)buf.current_dir - buf.prev_reclen; in COMPAT_SYSCALL_DEFINE3()
586 if (put_user(buf.ctx.pos, &lastdirent->d_off)) in COMPAT_SYSCALL_DEFINE3()
589 error = count - buf.ctx.count; in COMPAT_SYSCALL_DEFINE3()