• Home
  • Raw
  • Download

Lines Matching refs:count

366 int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t count)  in rw_verify_area()  argument
372 if (unlikely((ssize_t) count < 0)) in rw_verify_area()
385 if (count >= -pos) /* both values are in 0..LLONG_MAX */ in rw_verify_area()
387 } else if (unlikely((loff_t) (pos + count) < 0)) { in rw_verify_area()
393 retval = locks_mandatory_area(inode, file, pos, pos + count - 1, in rw_verify_area()
430 ssize_t __kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) in __kernel_read() argument
434 .iov_len = min_t(size_t, count, MAX_RW_COUNT), in __kernel_read()
465 ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) in kernel_read() argument
469 ret = rw_verify_area(READ, file, pos, count); in kernel_read()
472 return __kernel_read(file, buf, count, pos); in kernel_read()
476 ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) in vfs_read() argument
484 if (unlikely(!access_ok(buf, count))) in vfs_read()
487 ret = rw_verify_area(READ, file, pos, count); in vfs_read()
490 if (count > MAX_RW_COUNT) in vfs_read()
491 count = MAX_RW_COUNT; in vfs_read()
494 ret = file->f_op->read(file, buf, count, pos); in vfs_read()
496 ret = new_sync_read(file, buf, count, pos); in vfs_read()
526 ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos) in __kernel_write() argument
530 .iov_len = min_t(size_t, count, MAX_RW_COUNT), in __kernel_write()
569 ssize_t kernel_write(struct file *file, const void *buf, size_t count, in kernel_write() argument
574 ret = rw_verify_area(WRITE, file, pos, count); in kernel_write()
579 ret = __kernel_write(file, buf, count, pos); in kernel_write()
585 ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) in vfs_write() argument
593 if (unlikely(!access_ok(buf, count))) in vfs_write()
596 ret = rw_verify_area(WRITE, file, pos, count); in vfs_write()
599 if (count > MAX_RW_COUNT) in vfs_write()
600 count = MAX_RW_COUNT; in vfs_write()
603 ret = file->f_op->write(file, buf, count, pos); in vfs_write()
605 ret = new_sync_write(file, buf, count, pos); in vfs_write()
623 ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count) in ksys_read() argument
634 ret = vfs_read(f.file, buf, count, ppos); in ksys_read()
642 SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) in SYSCALL_DEFINE3() argument
644 return ksys_read(fd, buf, count); in SYSCALL_DEFINE3()
647 ssize_t ksys_write(unsigned int fd, const char __user *buf, size_t count) in ksys_write() argument
658 ret = vfs_write(f.file, buf, count, ppos); in ksys_write()
668 size_t, count) in SYSCALL_DEFINE3() argument
670 return ksys_write(fd, buf, count); in SYSCALL_DEFINE3()
673 ssize_t ksys_pread64(unsigned int fd, char __user *buf, size_t count, in ksys_pread64() argument
686 ret = vfs_read(f.file, buf, count, &pos); in ksys_pread64()
694 size_t, count, loff_t, pos) in SYSCALL_DEFINE4() argument
696 return ksys_pread64(fd, buf, count, pos); in SYSCALL_DEFINE4()
700 size_t count, loff_t pos) in ksys_pwrite64() argument
712 ret = vfs_write(f.file, buf, count, &pos); in ksys_pwrite64()
720 size_t, count, loff_t, pos) in SYSCALL_DEFINE4() argument
722 return ksys_pwrite64(fd, buf, count, pos); in SYSCALL_DEFINE4()
1187 size_t count, loff_t max) in do_sendfile() argument
1213 retval = rw_verify_area(READ, in.file, &pos, count); in do_sendfile()
1216 if (count > MAX_RW_COUNT) in do_sendfile()
1217 count = MAX_RW_COUNT; in do_sendfile()
1231 retval = rw_verify_area(WRITE, out.file, &out_pos, count); in do_sendfile()
1238 if (unlikely(pos + count > max)) { in do_sendfile()
1242 count = max - pos; in do_sendfile()
1257 retval = do_splice_direct(in.file, &pos, out.file, &out_pos, count, fl); in do_sendfile()
1285 SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count) in SYSCALL_DEFINE4() argument
1295 ret = do_sendfile(out_fd, in_fd, &pos, count, MAX_NON_LFS); in SYSCALL_DEFINE4()
1301 return do_sendfile(out_fd, in_fd, NULL, count, 0); in SYSCALL_DEFINE4()
1304 SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count) in SYSCALL_DEFINE4() argument
1312 ret = do_sendfile(out_fd, in_fd, &pos, count, 0); in SYSCALL_DEFINE4()
1318 return do_sendfile(out_fd, in_fd, NULL, count, 0); in SYSCALL_DEFINE4()
1323 compat_off_t __user *, offset, compat_size_t, count) in COMPAT_SYSCALL_DEFINE4() argument
1333 ret = do_sendfile(out_fd, in_fd, &pos, count, MAX_NON_LFS); in COMPAT_SYSCALL_DEFINE4()
1339 return do_sendfile(out_fd, in_fd, NULL, count, 0); in COMPAT_SYSCALL_DEFINE4()
1343 compat_loff_t __user *, offset, compat_size_t, count) in COMPAT_SYSCALL_DEFINE4() argument
1351 ret = do_sendfile(out_fd, in_fd, &pos, count, 0); in COMPAT_SYSCALL_DEFINE4()
1357 return do_sendfile(out_fd, in_fd, NULL, count, 0); in COMPAT_SYSCALL_DEFINE4()
1404 uint64_t count = *req_count; in generic_copy_file_checks() local
1440 if (pos_in + count < pos_in || pos_out + count < pos_out) in generic_copy_file_checks()
1446 count = 0; in generic_copy_file_checks()
1448 count = min(count, size_in - (uint64_t)pos_in); in generic_copy_file_checks()
1450 ret = generic_write_check_limits(file_out, pos_out, &count); in generic_copy_file_checks()
1456 pos_out + count > pos_in && in generic_copy_file_checks()
1457 pos_out < pos_in + count) in generic_copy_file_checks()
1460 *req_count = count; in generic_copy_file_checks()
1623 int generic_write_check_limits(struct file *file, loff_t pos, loff_t *count) in generic_write_check_limits() argument
1634 *count = min(*count, limit - pos); in generic_write_check_limits()
1643 *count = min(*count, max_size - pos); in generic_write_check_limits()
1659 loff_t count; in generic_write_checks() local
1675 count = iov_iter_count(from); in generic_write_checks()
1676 ret = generic_write_check_limits(file, iocb->ki_pos, &count); in generic_write_checks()
1680 iov_iter_truncate(from, count); in generic_write_checks()