Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: move kernel_read to fs/read_write.c

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Christoph Hellwig and committed by
Al Viro
c41fbad0 ac452aca

+16 -17
-17
fs/exec.c
··· 885 885 } 886 886 EXPORT_SYMBOL(open_exec); 887 887 888 - int kernel_read(struct file *file, loff_t offset, 889 - char *addr, unsigned long count) 890 - { 891 - mm_segment_t old_fs; 892 - loff_t pos = offset; 893 - int result; 894 - 895 - old_fs = get_fs(); 896 - set_fs(get_ds()); 897 - /* The cast to a user pointer is valid due to the set_fs() */ 898 - result = vfs_read(file, (void __user *)addr, count, &pos); 899 - set_fs(old_fs); 900 - return result; 901 - } 902 - 903 - EXPORT_SYMBOL(kernel_read); 904 - 905 888 int kernel_read_file(struct file *file, void **buf, loff_t *size, 906 889 loff_t max_size, enum kernel_read_file_id id) 907 890 {
+16
fs/read_write.c
··· 415 415 } 416 416 EXPORT_SYMBOL(__vfs_read); 417 417 418 + int kernel_read(struct file *file, loff_t offset, char *addr, 419 + unsigned long count) 420 + { 421 + mm_segment_t old_fs; 422 + loff_t pos = offset; 423 + int result; 424 + 425 + old_fs = get_fs(); 426 + set_fs(get_ds()); 427 + /* The cast to a user pointer is valid due to the set_fs() */ 428 + result = vfs_read(file, (void __user *)addr, count, &pos); 429 + set_fs(old_fs); 430 + return result; 431 + } 432 + EXPORT_SYMBOL(kernel_read); 433 + 418 434 ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) 419 435 { 420 436 ssize_t ret;