aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-05 15:32:39 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-05 15:32:39 -0400
commit8376005ea471762e7a5957d5b9e788121c0ba726 (patch)
treefdb47dc37b0f9db8283ff89e751068991dd7f2f8 /arch/sparc64
parent0a6db7dc49b91875ff015934df3e85b8785f2294 (diff)
sparc64: use compat_sys_utimes instead of home-grown local copy.
Noticed by Christoph Hellwig. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c31
-rw-r--r--arch/sparc64/kernel/systbls.S2
2 files changed, 1 insertions, 32 deletions
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 161ce4710fe..1aa4288125f 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -236,13 +236,6 @@ asmlinkage long sys32_getegid16(void)
236 236
237/* 32-bit timeval and related flotsam. */ 237/* 32-bit timeval and related flotsam. */
238 238
239static long get_tv32(struct timeval *o, struct compat_timeval __user *i)
240{
241 return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
242 (__get_user(o->tv_sec, &i->tv_sec) |
243 __get_user(o->tv_usec, &i->tv_usec)));
244}
245
246static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i) 239static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i)
247{ 240{
248 return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || 241 return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
@@ -757,30 +750,6 @@ asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv,
757 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); 750 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
758} 751}
759 752
760asmlinkage long sys32_utimes(char __user *filename,
761 struct compat_timeval __user *tvs)
762{
763 struct timespec tv[2];
764
765 if (tvs) {
766 struct timeval ktvs[2];
767 if (get_tv32(&ktvs[0], tvs) ||
768 get_tv32(&ktvs[1], 1+tvs))
769 return -EFAULT;
770
771 if (ktvs[0].tv_usec < 0 || ktvs[0].tv_usec >= 1000000 ||
772 ktvs[1].tv_usec < 0 || ktvs[1].tv_usec >= 1000000)
773 return -EINVAL;
774
775 tv[0].tv_sec = ktvs[0].tv_sec;
776 tv[0].tv_nsec = 1000 * ktvs[0].tv_usec;
777 tv[1].tv_sec = ktvs[1].tv_sec;
778 tv[1].tv_nsec = 1000 * ktvs[1].tv_usec;
779 }
780
781 return do_utimes(AT_FDCWD, filename, tvs ? tv : NULL, 0);
782}
783
784/* These are here just in case some old sparc32 binary calls it. */ 753/* These are here just in case some old sparc32 binary calls it. */
785asmlinkage long sys32_pause(void) 754asmlinkage long sys32_pause(void)
786{ 755{
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index a4fef2ba1ae..8b5282d433c 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -45,7 +45,7 @@ sys_call_table32:
45/*120*/ .word compat_sys_readv, compat_sys_writev, sys32_settimeofday, sys32_fchown16, sys_fchmod 45/*120*/ .word compat_sys_readv, compat_sys_writev, sys32_settimeofday, sys32_fchown16, sys_fchmod
46 .word sys_nis_syscall, sys32_setreuid16, sys32_setregid16, sys_rename, sys_truncate 46 .word sys_nis_syscall, sys32_setreuid16, sys32_setregid16, sys_rename, sys_truncate
47/*130*/ .word sys_ftruncate, sys_flock, compat_sys_lstat64, sys_nis_syscall, sys_nis_syscall 47/*130*/ .word sys_ftruncate, sys_flock, compat_sys_lstat64, sys_nis_syscall, sys_nis_syscall
48 .word sys_nis_syscall, sys32_mkdir, sys_rmdir, sys32_utimes, compat_sys_stat64 48 .word sys_nis_syscall, sys32_mkdir, sys_rmdir, compat_sys_utimes, compat_sys_stat64
49/*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit 49/*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit
50 .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write 50 .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write
51/*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 51/*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64