1 diff -urNp linux-860/arch/i386/kernel/entry.S linux-880/arch/i386/kernel/entry.S
2 --- linux-860/arch/i386/kernel/entry.S
3 +++ linux-880/arch/i386/kernel/entry.S
4 @@ -651,7 +651,7 @@ ENTRY(sys_call_table)
5 .long SYMBOL_NAME(sys_lremovexattr)
6 .long SYMBOL_NAME(sys_fremovexattr)
7 .long SYMBOL_NAME(sys_tkill)
8 - .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sendfile64 */
9 + .long SYMBOL_NAME(sys_sendfile64) /* reserved for sendfile64 */
10 .long SYMBOL_NAME(sys_ni_syscall) /* 240 reserved for futex */
11 .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_setaffinity */
12 .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_getaffinity */
13 diff -urNp linux-860/mm/filemap.c linux-880/mm/filemap.c
14 --- linux-860/mm/filemap.c
15 +++ linux-880/mm/filemap.c
16 @@ -1755,7 +1755,7 @@ int file_send_actor(read_descriptor_t *
20 -asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
21 +static ssize_t common_sendfile(int out_fd, int in_fd, loff_t *offset, size_t count)
24 struct file * in_file, * out_file;
25 @@ -1800,27 +1800,19 @@ asmlinkage ssize_t sys_sendfile(int out_
28 read_descriptor_t desc;
29 - loff_t pos = 0, *ppos;
32 - ppos = &in_file->f_pos;
34 - if (get_user(pos, offset))
40 + offset = &in_file->f_pos;
44 desc.buf = (char *) out_file;
46 - do_generic_file_read(in_file, ppos, &desc, file_send_actor);
47 + do_generic_file_read(in_file, offset, &desc, file_send_actor);
49 retval = desc.written;
53 - put_user(pos, offset);
57 @@ -1831,6 +1823,38 @@ out:
61 +asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
63 + loff_t pos, *ppos = NULL;
67 + if (unlikely(get_user(off, offset)))
72 + ret = common_sendfile(out_fd, in_fd, ppos, count);
74 + put_user((off_t)pos, offset);
78 +asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count)
80 + loff_t pos, *ppos = NULL;
83 + if (unlikely(copy_from_user(&pos, offset, sizeof(loff_t))))
87 + ret = common_sendfile(out_fd, in_fd, ppos, count);
89 + put_user(pos, offset);
93 static ssize_t do_readahead(struct file *file, unsigned long index, unsigned long nr)
95 struct address_space *mapping = file->f_dentry->d_inode->i_mapping;