Lines Matching refs:pos

460 		loff_t pos = *ppos;  in rw_verify_area()  local
462 if (unlikely(pos < 0)) { in rw_verify_area()
465 if (count >= -pos) /* both values are in 0..LLONG_MAX */ in rw_verify_area()
467 } else if (unlikely((loff_t) (pos + count) < 0)) { in rw_verify_area()
506 ssize_t __kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) in __kernel_read() argument
528 kiocb.ki_pos = pos ? *pos : 0; in __kernel_read()
532 if (pos) in __kernel_read()
533 *pos = kiocb.ki_pos; in __kernel_read()
541 ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) in kernel_read() argument
545 ret = rw_verify_area(READ, file, pos, count); in kernel_read()
548 return __kernel_read(file, buf, count, pos); in kernel_read()
552 ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) in vfs_read() argument
563 ret = rw_verify_area(READ, file, pos, count); in vfs_read()
570 ret = file->f_op->read(file, buf, count, pos); in vfs_read()
572 ret = new_sync_read(file, buf, count, pos); in vfs_read()
601 ssize_t __kernel_write_iter(struct file *file, struct iov_iter *from, loff_t *pos) in __kernel_write_iter() argument
618 kiocb.ki_pos = pos ? *pos : 0; in __kernel_write_iter()
621 if (pos) in __kernel_write_iter()
622 *pos = kiocb.ki_pos; in __kernel_write_iter()
631 ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos) in __kernel_write() argument
639 return __kernel_write_iter(file, &iter, pos); in __kernel_write()
651 loff_t *pos) in kernel_write() argument
655 ret = rw_verify_area(WRITE, file, pos, count); in kernel_write()
660 ret = __kernel_write(file, buf, count, pos); in kernel_write()
666 ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) in vfs_write() argument
677 ret = rw_verify_area(WRITE, file, pos, count); in vfs_write()
684 ret = file->f_op->write(file, buf, count, pos); in vfs_write()
686 ret = new_sync_write(file, buf, count, pos); in vfs_write()
710 loff_t pos, *ppos = file_ppos(fd_file(f)); in ksys_read() local
712 pos = *ppos; in ksys_read()
713 ppos = &pos; in ksys_read()
717 fd_file(f)->f_pos = pos; in ksys_read()
733 loff_t pos, *ppos = file_ppos(fd_file(f)); in ksys_write() local
735 pos = *ppos; in ksys_write()
736 ppos = &pos; in ksys_write()
740 fd_file(f)->f_pos = pos; in ksys_write()
753 loff_t pos) in ksys_pread64() argument
755 if (pos < 0) in ksys_pread64()
763 return vfs_read(fd_file(f), buf, count, &pos); in ksys_pread64()
769 size_t, count, loff_t, pos) in SYSCALL_DEFINE4() argument
771 return ksys_pread64(fd, buf, count, pos); in SYSCALL_DEFINE4()
776 size_t, count, compat_arg_u64_dual(pos)) in COMPAT_SYSCALL_DEFINE5() argument
778 return ksys_pread64(fd, buf, count, compat_arg_u64_glue(pos)); in COMPAT_SYSCALL_DEFINE5()
783 size_t count, loff_t pos) in ksys_pwrite64() argument
785 if (pos < 0) in ksys_pwrite64()
793 return vfs_write(fd_file(f), buf, count, &pos); in ksys_pwrite64()
799 size_t, count, loff_t, pos) in SYSCALL_DEFINE4() argument
801 return ksys_pwrite64(fd, buf, count, pos); in SYSCALL_DEFINE4()
806 size_t, count, compat_arg_u64_dual(pos)) in COMPAT_SYSCALL_DEFINE5() argument
808 return ksys_pwrite64(fd, buf, count, compat_arg_u64_glue(pos)); in COMPAT_SYSCALL_DEFINE5()
991 unsigned long vlen, loff_t *pos, rwf_t flags) in vfs_readv() argument
1013 ret = rw_verify_area(READ, file, pos, tot_len); in vfs_readv()
1018 ret = do_iter_readv_writev(file, &iter, pos, READ, flags); in vfs_readv()
1020 ret = do_loop_readv_writev(file, &iter, pos, READ, flags); in vfs_readv()
1029 unsigned long vlen, loff_t *pos, rwf_t flags) in vfs_writev() argument
1051 ret = rw_verify_area(WRITE, file, pos, tot_len); in vfs_writev()
1057 ret = do_iter_readv_writev(file, &iter, pos, WRITE, flags); in vfs_writev()
1059 ret = do_loop_readv_writev(file, &iter, pos, WRITE, flags); in vfs_writev()
1075 loff_t pos, *ppos = file_ppos(fd_file(f)); in do_readv() local
1077 pos = *ppos; in do_readv()
1078 ppos = &pos; in do_readv()
1082 fd_file(f)->f_pos = pos; in do_readv()
1098 loff_t pos, *ppos = file_ppos(fd_file(f)); in do_writev() local
1100 pos = *ppos; in do_writev()
1101 ppos = &pos; in do_writev()
1105 fd_file(f)->f_pos = pos; in do_writev()
1121 unsigned long vlen, loff_t pos, rwf_t flags) in do_preadv() argument
1125 if (pos < 0) in do_preadv()
1132 ret = vfs_readv(fd_file(f), vec, vlen, &pos, flags); in do_preadv()
1142 unsigned long vlen, loff_t pos, rwf_t flags) in do_pwritev() argument
1146 if (pos < 0) in do_pwritev()
1153 ret = vfs_writev(fd_file(f), vec, vlen, &pos, flags); in do_pwritev()
1177 loff_t pos = pos_from_hilo(pos_h, pos_l); in SYSCALL_DEFINE5() local
1179 return do_preadv(fd, vec, vlen, pos, 0); in SYSCALL_DEFINE5()
1186 loff_t pos = pos_from_hilo(pos_h, pos_l); in SYSCALL_DEFINE6() local
1188 if (pos == -1) in SYSCALL_DEFINE6()
1191 return do_preadv(fd, vec, vlen, pos, flags); in SYSCALL_DEFINE6()
1197 loff_t pos = pos_from_hilo(pos_h, pos_l); in SYSCALL_DEFINE5() local
1199 return do_pwritev(fd, vec, vlen, pos, 0); in SYSCALL_DEFINE5()
1206 loff_t pos = pos_from_hilo(pos_h, pos_l); in SYSCALL_DEFINE6() local
1208 if (pos == -1) in SYSCALL_DEFINE6()
1211 return do_pwritev(fd, vec, vlen, pos, flags); in SYSCALL_DEFINE6()
1223 unsigned long, vlen, loff_t, pos) in COMPAT_SYSCALL_DEFINE4() argument
1225 return do_preadv(fd, vec, vlen, pos, 0); in COMPAT_SYSCALL_DEFINE4()
1233 loff_t pos = ((loff_t)pos_high << 32) | pos_low; in COMPAT_SYSCALL_DEFINE5() local
1235 return do_preadv(fd, vec, vlen, pos, 0); in COMPAT_SYSCALL_DEFINE5()
1241 unsigned long, vlen, loff_t, pos, rwf_t, flags) in COMPAT_SYSCALL_DEFINE5() argument
1243 if (pos == -1) in COMPAT_SYSCALL_DEFINE5()
1245 return do_preadv(fd, vec, vlen, pos, flags); in COMPAT_SYSCALL_DEFINE5()
1254 loff_t pos = ((loff_t)pos_high << 32) | pos_low; in COMPAT_SYSCALL_DEFINE6() local
1256 if (pos == -1) in COMPAT_SYSCALL_DEFINE6()
1258 return do_preadv(fd, vec, vlen, pos, flags); in COMPAT_SYSCALL_DEFINE6()
1264 unsigned long, vlen, loff_t, pos) in COMPAT_SYSCALL_DEFINE4() argument
1266 return do_pwritev(fd, vec, vlen, pos, 0); in COMPAT_SYSCALL_DEFINE4()
1274 loff_t pos = ((loff_t)pos_high << 32) | pos_low; in COMPAT_SYSCALL_DEFINE5() local
1276 return do_pwritev(fd, vec, vlen, pos, 0); in COMPAT_SYSCALL_DEFINE5()
1282 unsigned long, vlen, loff_t, pos, rwf_t, flags) in COMPAT_SYSCALL_DEFINE5() argument
1284 if (pos == -1) in COMPAT_SYSCALL_DEFINE5()
1286 return do_pwritev(fd, vec, vlen, pos, flags); in COMPAT_SYSCALL_DEFINE5()
1294 loff_t pos = ((loff_t)pos_high << 32) | pos_low; in COMPAT_SYSCALL_DEFINE6() local
1296 if (pos == -1) in COMPAT_SYSCALL_DEFINE6()
1298 return do_pwritev(fd, vec, vlen, pos, flags); in COMPAT_SYSCALL_DEFINE6()
1307 loff_t pos; in do_sendfile() local
1321 pos = fd_file(in)->f_pos; in do_sendfile()
1323 pos = *ppos; in do_sendfile()
1327 retval = rw_verify_area(READ, fd_file(in), &pos, count); in do_sendfile()
1348 if (unlikely(pos + count > max)) { in do_sendfile()
1349 if (pos >= max) in do_sendfile()
1351 count = max - pos; in do_sendfile()
1370 retval = do_splice_direct(fd_file(in), &pos, fd_file(out), &out_pos, in do_sendfile()
1376 retval = splice_file_to_pipe(fd_file(in), opipe, &pos, count, fl); in do_sendfile()
1386 *ppos = pos; in do_sendfile()
1388 fd_file(in)->f_pos = pos; in do_sendfile()
1393 if (pos > max) in do_sendfile()
1400 loff_t pos; in SYSCALL_DEFINE4() local
1407 pos = off; in SYSCALL_DEFINE4()
1408 ret = do_sendfile(out_fd, in_fd, &pos, count, MAX_NON_LFS); in SYSCALL_DEFINE4()
1409 if (unlikely(put_user(pos, offset))) in SYSCALL_DEFINE4()
1419 loff_t pos; in SYSCALL_DEFINE4() local
1423 if (unlikely(copy_from_user(&pos, offset, sizeof(loff_t)))) in SYSCALL_DEFINE4()
1425 ret = do_sendfile(out_fd, in_fd, &pos, count, 0); in SYSCALL_DEFINE4()
1426 if (unlikely(put_user(pos, offset))) in SYSCALL_DEFINE4()
1438 loff_t pos; in COMPAT_SYSCALL_DEFINE4() local
1445 pos = off; in COMPAT_SYSCALL_DEFINE4()
1446 ret = do_sendfile(out_fd, in_fd, &pos, count, MAX_NON_LFS); in COMPAT_SYSCALL_DEFINE4()
1447 if (unlikely(put_user(pos, offset))) in COMPAT_SYSCALL_DEFINE4()
1458 loff_t pos; in COMPAT_SYSCALL_DEFINE4() local
1462 if (unlikely(copy_from_user(&pos, offset, sizeof(loff_t)))) in COMPAT_SYSCALL_DEFINE4()
1464 ret = do_sendfile(out_fd, in_fd, &pos, count, 0); in COMPAT_SYSCALL_DEFINE4()
1465 if (unlikely(put_user(pos, offset))) in COMPAT_SYSCALL_DEFINE4()
1705 int generic_write_check_limits(struct file *file, loff_t pos, loff_t *count) in generic_write_check_limits() argument
1712 if (pos >= limit) { in generic_write_check_limits()
1716 *count = min(*count, limit - pos); in generic_write_check_limits()
1722 if (unlikely(pos >= max_size)) in generic_write_check_limits()
1725 *count = min(*count, max_size - pos); in generic_write_check_limits()