Lines Matching refs:pos

368 	loff_t pos;  in rw_verify_area()  local
374 pos = *ppos; in rw_verify_area()
375 if (unlikely(pos < 0)) { in rw_verify_area()
378 if (count >= -pos) /* both values are in 0..LLONG_MAX */ in rw_verify_area()
380 } else if (unlikely((loff_t) (pos + count) < 0)) { in rw_verify_area()
386 retval = locks_mandatory_area(inode, file, pos, pos + count - 1, in rw_verify_area()
413 loff_t *pos) in __vfs_read() argument
416 return file->f_op->read(file, buf, count, pos); in __vfs_read()
418 return new_sync_read(file, buf, count, pos); in __vfs_read()
423 ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) in kernel_read() argument
431 result = vfs_read(file, (void __user *)buf, count, pos); in kernel_read()
437 ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) in vfs_read() argument
448 ret = rw_verify_area(READ, file, pos, count); in vfs_read()
452 ret = __vfs_read(file, buf, count, pos); in vfs_read()
482 loff_t *pos) in __vfs_write() argument
485 return file->f_op->write(file, p, count, pos); in __vfs_write()
487 return new_sync_write(file, p, count, pos); in __vfs_write()
492 ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos) in __kernel_write() argument
506 ret = __vfs_write(file, p, count, pos); in __kernel_write()
518 loff_t *pos) in kernel_write() argument
526 res = vfs_write(file, (__force const char __user *)buf, count, pos); in kernel_write()
533 ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) in vfs_write() argument
544 ret = rw_verify_area(WRITE, file, pos, count); in vfs_write()
549 ret = __vfs_write(file, buf, count, pos); in vfs_write()
566 static inline void file_pos_write(struct file *file, loff_t pos) in file_pos_write() argument
569 file->f_pos = pos; in file_pos_write()
578 loff_t pos = file_pos_read(f.file); in ksys_read() local
579 ret = vfs_read(f.file, buf, count, &pos); in ksys_read()
581 file_pos_write(f.file, pos); in ksys_read()
598 loff_t pos = file_pos_read(f.file); in ksys_write() local
599 ret = vfs_write(f.file, buf, count, &pos); in ksys_write()
601 file_pos_write(f.file, pos); in ksys_write()
615 loff_t pos) in ksys_pread64() argument
620 if (pos < 0) in ksys_pread64()
627 ret = vfs_read(f.file, buf, count, &pos); in ksys_pread64()
635 size_t, count, loff_t, pos) in SYSCALL_DEFINE4() argument
637 return ksys_pread64(fd, buf, count, pos); in SYSCALL_DEFINE4()
641 size_t count, loff_t pos) in ksys_pwrite64() argument
646 if (pos < 0) in ksys_pwrite64()
653 ret = vfs_write(f.file, buf, count, &pos); in ksys_pwrite64()
661 size_t, count, loff_t, pos) in SYSCALL_DEFINE4() argument
663 return ksys_pwrite64(fd, buf, count, pos); in SYSCALL_DEFINE4()
905 loff_t *pos, rwf_t flags) in do_iter_read() argument
918 ret = rw_verify_area(READ, file, pos, tot_len); in do_iter_read()
923 ret = do_iter_readv_writev(file, iter, pos, READ, flags); in do_iter_read()
925 ret = do_loop_readv_writev(file, iter, pos, READ, flags); in do_iter_read()
942 loff_t *pos, rwf_t flags) in do_iter_write() argument
955 ret = rw_verify_area(WRITE, file, pos, tot_len); in do_iter_write()
960 ret = do_iter_readv_writev(file, iter, pos, WRITE, flags); in do_iter_write()
962 ret = do_loop_readv_writev(file, iter, pos, WRITE, flags); in do_iter_write()
978 unsigned long vlen, loff_t *pos, rwf_t flags) in vfs_readv() argument
987 ret = do_iter_read(file, &iter, pos, flags); in vfs_readv()
995 unsigned long vlen, loff_t *pos, rwf_t flags) in vfs_writev() argument
1005 ret = do_iter_write(file, &iter, pos, flags); in vfs_writev()
1019 loff_t pos = file_pos_read(f.file); in do_readv() local
1020 ret = vfs_readv(f.file, vec, vlen, &pos, flags); in do_readv()
1022 file_pos_write(f.file, pos); in do_readv()
1039 loff_t pos = file_pos_read(f.file); in do_writev() local
1040 ret = vfs_writev(f.file, vec, vlen, &pos, flags); in do_writev()
1042 file_pos_write(f.file, pos); in do_writev()
1059 unsigned long vlen, loff_t pos, rwf_t flags) in do_preadv() argument
1064 if (pos < 0) in do_preadv()
1071 ret = vfs_readv(f.file, vec, vlen, &pos, flags); in do_preadv()
1082 unsigned long vlen, loff_t pos, rwf_t flags) in do_pwritev() argument
1087 if (pos < 0) in do_pwritev()
1094 ret = vfs_writev(f.file, vec, vlen, &pos, flags); in do_pwritev()
1119 loff_t pos = pos_from_hilo(pos_h, pos_l); in SYSCALL_DEFINE5() local
1121 return do_preadv(fd, vec, vlen, pos, 0); in SYSCALL_DEFINE5()
1128 loff_t pos = pos_from_hilo(pos_h, pos_l); in SYSCALL_DEFINE6() local
1130 if (pos == -1) in SYSCALL_DEFINE6()
1133 return do_preadv(fd, vec, vlen, pos, flags); in SYSCALL_DEFINE6()
1139 loff_t pos = pos_from_hilo(pos_h, pos_l); in SYSCALL_DEFINE5() local
1141 return do_pwritev(fd, vec, vlen, pos, 0); in SYSCALL_DEFINE5()
1148 loff_t pos = pos_from_hilo(pos_h, pos_l); in SYSCALL_DEFINE6() local
1150 if (pos == -1) in SYSCALL_DEFINE6()
1153 return do_pwritev(fd, vec, vlen, pos, flags); in SYSCALL_DEFINE6()
1159 unsigned long vlen, loff_t *pos, rwf_t flags) in compat_readv() argument
1168 ret = do_iter_read(file, &iter, pos, flags); in compat_readv()
1183 loff_t pos; in do_compat_readv() local
1187 pos = f.file->f_pos; in do_compat_readv()
1188 ret = compat_readv(f.file, vec, vlen, &pos, flags); in do_compat_readv()
1190 f.file->f_pos = pos; in do_compat_readv()
1205 unsigned long vlen, loff_t pos, rwf_t flags) in do_compat_preadv64() argument
1210 if (pos < 0) in do_compat_preadv64()
1217 ret = compat_readv(f.file, vec, vlen, &pos, flags); in do_compat_preadv64()
1225 unsigned long, vlen, loff_t, pos) in COMPAT_SYSCALL_DEFINE4() argument
1227 return do_compat_preadv64(fd, vec, vlen, pos, 0); in COMPAT_SYSCALL_DEFINE4()
1235 loff_t pos = ((loff_t)pos_high << 32) | pos_low; in COMPAT_SYSCALL_DEFINE5() local
1237 return do_compat_preadv64(fd, vec, vlen, pos, 0); in COMPAT_SYSCALL_DEFINE5()
1243 unsigned long, vlen, loff_t, pos, rwf_t, flags) in COMPAT_SYSCALL_DEFINE5() argument
1245 if (pos == -1) in COMPAT_SYSCALL_DEFINE5()
1248 return do_compat_preadv64(fd, vec, vlen, pos, flags); in COMPAT_SYSCALL_DEFINE5()
1257 loff_t pos = ((loff_t)pos_high << 32) | pos_low; in COMPAT_SYSCALL_DEFINE6() local
1259 if (pos == -1) in COMPAT_SYSCALL_DEFINE6()
1262 return do_compat_preadv64(fd, vec, vlen, pos, flags); in COMPAT_SYSCALL_DEFINE6()
1267 unsigned long vlen, loff_t *pos, rwf_t flags) in compat_writev() argument
1277 ret = do_iter_write(file, &iter, pos, flags); in compat_writev()
1293 loff_t pos; in do_compat_writev() local
1297 pos = f.file->f_pos; in do_compat_writev()
1298 ret = compat_writev(f.file, vec, vlen, &pos, flags); in do_compat_writev()
1300 f.file->f_pos = pos; in do_compat_writev()
1314 unsigned long vlen, loff_t pos, rwf_t flags) in do_compat_pwritev64() argument
1319 if (pos < 0) in do_compat_pwritev64()
1326 ret = compat_writev(f.file, vec, vlen, &pos, flags); in do_compat_pwritev64()
1334 unsigned long, vlen, loff_t, pos) in COMPAT_SYSCALL_DEFINE4() argument
1336 return do_compat_pwritev64(fd, vec, vlen, pos, 0); in COMPAT_SYSCALL_DEFINE4()
1344 loff_t pos = ((loff_t)pos_high << 32) | pos_low; in COMPAT_SYSCALL_DEFINE5() local
1346 return do_compat_pwritev64(fd, vec, vlen, pos, 0); in COMPAT_SYSCALL_DEFINE5()
1352 unsigned long, vlen, loff_t, pos, rwf_t, flags) in COMPAT_SYSCALL_DEFINE5() argument
1354 if (pos == -1) in COMPAT_SYSCALL_DEFINE5()
1357 return do_compat_pwritev64(fd, vec, vlen, pos, flags); in COMPAT_SYSCALL_DEFINE5()
1365 loff_t pos = ((loff_t)pos_high << 32) | pos_low; in COMPAT_SYSCALL_DEFINE6() local
1367 if (pos == -1) in COMPAT_SYSCALL_DEFINE6()
1370 return do_compat_pwritev64(fd, vec, vlen, pos, flags); in COMPAT_SYSCALL_DEFINE6()
1380 loff_t pos; in do_sendfile() local
1396 pos = in.file->f_pos; in do_sendfile()
1398 pos = *ppos; in do_sendfile()
1402 retval = rw_verify_area(READ, in.file, &pos, count); in do_sendfile()
1428 if (unlikely(pos + count > max)) { in do_sendfile()
1430 if (pos >= max) in do_sendfile()
1432 count = max - pos; in do_sendfile()
1447 retval = do_splice_direct(in.file, &pos, out.file, &out_pos, count, fl); in do_sendfile()
1457 *ppos = pos; in do_sendfile()
1459 in.file->f_pos = pos; in do_sendfile()
1464 if (pos > max) in do_sendfile()
1477 loff_t pos; in SYSCALL_DEFINE4() local
1484 pos = off; in SYSCALL_DEFINE4()
1485 ret = do_sendfile(out_fd, in_fd, &pos, count, MAX_NON_LFS); in SYSCALL_DEFINE4()
1486 if (unlikely(put_user(pos, offset))) in SYSCALL_DEFINE4()
1496 loff_t pos; in SYSCALL_DEFINE4() local
1500 if (unlikely(copy_from_user(&pos, offset, sizeof(loff_t)))) in SYSCALL_DEFINE4()
1502 ret = do_sendfile(out_fd, in_fd, &pos, count, 0); in SYSCALL_DEFINE4()
1503 if (unlikely(put_user(pos, offset))) in SYSCALL_DEFINE4()
1515 loff_t pos; in COMPAT_SYSCALL_DEFINE4() local
1522 pos = off; in COMPAT_SYSCALL_DEFINE4()
1523 ret = do_sendfile(out_fd, in_fd, &pos, count, MAX_NON_LFS); in COMPAT_SYSCALL_DEFINE4()
1524 if (unlikely(put_user(pos, offset))) in COMPAT_SYSCALL_DEFINE4()
1535 loff_t pos; in COMPAT_SYSCALL_DEFINE4() local
1539 if (unlikely(copy_from_user(&pos, offset, sizeof(loff_t)))) in COMPAT_SYSCALL_DEFINE4()
1541 ret = do_sendfile(out_fd, in_fd, &pos, count, 0); in COMPAT_SYSCALL_DEFINE4()
1542 if (unlikely(put_user(pos, offset))) in COMPAT_SYSCALL_DEFINE4()
1696 static int clone_verify_area(struct file *file, loff_t pos, u64 len, bool write) in clone_verify_area() argument
1700 if (unlikely(pos < 0)) in clone_verify_area()
1703 if (unlikely((loff_t) (pos + len) < 0)) in clone_verify_area()
1707 loff_t end = len ? pos + len - 1 : OFFSET_MAX; in clone_verify_area()
1710 retval = locks_mandatory_area(inode, file, pos, end, in clone_verify_area()