linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Wire up sys_sync_file_range() on powerpc
@ 2007-06-16 11:18 David Woodhouse
  2007-06-16 18:20 ` David Woodhouse
  0 siblings, 1 reply; 5+ messages in thread
From: David Woodhouse @ 2007-06-16 11:18 UTC (permalink / raw)
  To: paulus, akpm; +Cc: linuxppc-dev

Every time I build a ppc kernel it bitches at me that
sys_sync_file_range is unimplemented. Shut it up...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

---
The compat bit is untested although the assembly looks right, when
compared with 32-bit calls to sys_sync_file_range(). Test kernel
building now, although I leave for the airport within 24 hours and may
not get round to actually testing it.

diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 047246a..14a2654 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -810,3 +810,13 @@ asmlinkage long compat_sys_request_key(const char __user *_type,
 	return sys_request_key(_type, _description, _callout_info, destringid);
 }
 
+asmlinkage long compat_sys_sync_file_range(int fd, int dummy,
+				   unsigned offset_hi, unsigned offset_lo,
+				   unsigned nbytes_hi, unsigned nbytes_lo,
+				   int flags)
+{
+	loff_t offset = ((loff_t)offset_hi << 32) | offset_lo;
+	loff_t nbytes = ((loff_t)nbytes_hi << 32) | nbytes_lo;
+
+	return sys_sync_file_range(fd, offset, nbytes, flags);
+}
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 700ca59..b75ce1c 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -311,3 +311,4 @@ COMPAT_SYS_SPU(utimensat)
 COMPAT_SYS_SPU(signalfd)
 COMPAT_SYS_SPU(timerfd)
 SYSCALL_SPU(eventfd)
+COMPAT_SYS_SPU(sync_file_range)
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index e3c28dc..a4f8e7f 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -330,10 +330,11 @@
 #define __NR_signalfd		305
 #define __NR_timerfd		306
 #define __NR_eventfd		307
+#define __NR_sync_file_range	308
 
 #ifdef __KERNEL__
 
-#define __NR_syscalls		308
+#define __NR_syscalls		309
 
 #define __NR__exit __NR_exit
 #define NR_syscalls	__NR_syscalls

-- 
dwmw2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-18  9:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-16 11:18 [PATCH] Wire up sys_sync_file_range() on powerpc David Woodhouse
2007-06-16 18:20 ` David Woodhouse
2007-06-18  5:37   ` Paul Mackerras
2007-06-18  9:25     ` David Woodhouse
2007-06-18  9:41       ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).