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

parisc: fix fallocate syscall

fallocate(off_t) gets redirected by glibc to fallocate64(loff_t)
where the 64bit loff_t values get splitted into two 32bit (hi/lo)
values. This patch fixes this syscall for the 32- and 64bit kernel.

Signed-off-by: Helge Deller <deller@gmx.de>

+8 -8
+7
arch/parisc/kernel/sys_parisc.c
··· 213 213 (loff_t)hi_nbytes << 32 | lo_nbytes, flags); 214 214 } 215 215 216 + asmlinkage long parisc_fallocate(int fd, int mode, u32 offhi, u32 offlo, 217 + u32 lenhi, u32 lenlo) 218 + { 219 + return sys_fallocate(fd, mode, ((u64)offhi << 32) | offlo, 220 + ((u64)lenhi << 32) | lenlo); 221 + } 222 + 216 223 asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag) 217 224 { 218 225 return -ENOMEM;
-7
arch/parisc/kernel/sys_parisc32.c
··· 142 142 buf, len); 143 143 } 144 144 145 - asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo, 146 - u32 lenhi, u32 lenlo) 147 - { 148 - return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo, 149 - ((loff_t)lenhi << 32) | lenlo); 150 - } 151 - 152 145 asmlinkage long compat_sys_fanotify_mark(int fan_fd, int flags, u32 mask_hi, 153 146 u32 mask_lo, int fd, 154 147 const char __user *pathname)
+1 -1
arch/parisc/kernel/syscall_table.S
··· 403 403 ENTRY_COMP(signalfd) 404 404 ENTRY_SAME(ni_syscall) /* was timerfd */ 405 405 ENTRY_SAME(eventfd) 406 - ENTRY_COMP(fallocate) /* 305 */ 406 + ENTRY_OURS(fallocate) /* 305 */ 407 407 ENTRY_SAME(timerfd_create) 408 408 ENTRY_COMP(timerfd_settime) 409 409 ENTRY_COMP(timerfd_gettime)