diff options
author | David S. Miller <davem@davemloft.net> | 2008-05-05 15:32:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-05 15:32:39 -0400 |
commit | 8376005ea471762e7a5957d5b9e788121c0ba726 (patch) | |
tree | fdb47dc37b0f9db8283ff89e751068991dd7f2f8 /arch/sparc64/kernel/sys_sparc32.c | |
parent | 0a6db7dc49b91875ff015934df3e85b8785f2294 (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/kernel/sys_sparc32.c')
-rw-r--r-- | arch/sparc64/kernel/sys_sparc32.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index 161ce4710fe7..1aa4288125f2 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 | ||
239 | static 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 | |||
246 | static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i) | 239 | static 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 | ||
760 | asmlinkage 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. */ |
785 | asmlinkage long sys32_pause(void) | 754 | asmlinkage long sys32_pause(void) |
786 | { | 755 | { |