Lines Matching refs:dirent
139 struct old_linux_dirent __user * dirent; member
148 struct old_linux_dirent __user * dirent; in fillonedir() local
159 dirent = buf->dirent; in fillonedir()
160 if (!access_ok(dirent, in fillonedir()
161 (unsigned long)(dirent->d_name + namlen + 1) - in fillonedir()
162 (unsigned long)dirent)) in fillonedir()
164 if ( __put_user(d_ino, &dirent->d_ino) || in fillonedir()
165 __put_user(offset, &dirent->d_offset) || in fillonedir()
166 __put_user(namlen, &dirent->d_namlen) || in fillonedir()
167 __copy_to_user(dirent->d_name, name, namlen) || in fillonedir()
168 __put_user(0, dirent->d_name + namlen)) in fillonedir()
177 struct old_linux_dirent __user *, dirent, unsigned int, count) in SYSCALL_DEFINE3() argument
183 .dirent = dirent in SYSCALL_DEFINE3()
221 struct linux_dirent __user *dirent, *prev; in filldir() local
243 dirent = buf->current_dir; in filldir()
244 prev = (void __user *) dirent - prev_reclen; in filldir()
250 unsafe_put_user(d_ino, &dirent->d_ino, efault_end); in filldir()
251 unsafe_put_user(reclen, &dirent->d_reclen, efault_end); in filldir()
252 unsafe_put_user(d_type, (char __user *) dirent + reclen - 1, efault_end); in filldir()
253 unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end); in filldir()
256 buf->current_dir = (void __user *)dirent + reclen; in filldir()
268 struct linux_dirent __user *, dirent, unsigned int, count) in SYSCALL_DEFINE3() argument
274 .current_dir = dirent in SYSCALL_DEFINE3()
278 if (!access_ok(dirent, count)) in SYSCALL_DEFINE3()
312 struct linux_dirent64 __user *dirent, *prev; in filldir64() local
328 dirent = buf->current_dir; in filldir64()
329 prev = (void __user *)dirent - prev_reclen; in filldir64()
335 unsafe_put_user(ino, &dirent->d_ino, efault_end); in filldir64()
336 unsafe_put_user(reclen, &dirent->d_reclen, efault_end); in filldir64()
337 unsafe_put_user(d_type, &dirent->d_type, efault_end); in filldir64()
338 unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end); in filldir64()
342 buf->current_dir = (void __user *)dirent + reclen; in filldir64()
353 int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent, in ksys_getdents64() argument
360 .current_dir = dirent in ksys_getdents64()
364 if (!access_ok(dirent, count)) in ksys_getdents64()
390 struct linux_dirent64 __user *, dirent, unsigned int, count) in SYSCALL_DEFINE3() argument
392 return ksys_getdents64(fd, dirent, count); in SYSCALL_DEFINE3()
405 struct compat_old_linux_dirent __user *dirent; member
415 struct compat_old_linux_dirent __user *dirent; in compat_fillonedir() local
426 dirent = buf->dirent; in compat_fillonedir()
427 if (!access_ok(dirent, in compat_fillonedir()
428 (unsigned long)(dirent->d_name + namlen + 1) - in compat_fillonedir()
429 (unsigned long)dirent)) in compat_fillonedir()
431 if ( __put_user(d_ino, &dirent->d_ino) || in compat_fillonedir()
432 __put_user(offset, &dirent->d_offset) || in compat_fillonedir()
433 __put_user(namlen, &dirent->d_namlen) || in compat_fillonedir()
434 __copy_to_user(dirent->d_name, name, namlen) || in compat_fillonedir()
435 __put_user(0, dirent->d_name + namlen)) in compat_fillonedir()
444 struct compat_old_linux_dirent __user *, dirent, unsigned int, count) in COMPAT_SYSCALL_DEFINE3() argument
450 .dirent = dirent in COMPAT_SYSCALL_DEFINE3()
482 struct compat_linux_dirent __user * dirent; in compat_filldir() local
497 dirent = buf->previous; in compat_filldir()
498 if (dirent) { in compat_filldir()
501 if (__put_user(offset, &dirent->d_off)) in compat_filldir()
504 dirent = buf->current_dir; in compat_filldir()
505 if (__put_user(d_ino, &dirent->d_ino)) in compat_filldir()
507 if (__put_user(reclen, &dirent->d_reclen)) in compat_filldir()
509 if (copy_to_user(dirent->d_name, name, namlen)) in compat_filldir()
511 if (__put_user(0, dirent->d_name + namlen)) in compat_filldir()
513 if (__put_user(d_type, (char __user *) dirent + reclen - 1)) in compat_filldir()
515 buf->previous = dirent; in compat_filldir()
516 dirent = (void __user *)dirent + reclen; in compat_filldir()
517 buf->current_dir = dirent; in compat_filldir()
526 struct compat_linux_dirent __user *, dirent, unsigned int, count) in COMPAT_SYSCALL_DEFINE3() argument
532 .current_dir = dirent, in COMPAT_SYSCALL_DEFINE3()
537 if (!access_ok(dirent, count)) in COMPAT_SYSCALL_DEFINE3()