Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
[sfrench/cifs-2.6.git] / arch / alpha / kernel / osf_sys.c
index ea405f5713ce0e75e72a18fb960955f02153c28b..8c71daf94a59ce0f27537a4c8352ab362152dbbe 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/ptrace.h>
 #include <linux/slab.h>
 #include <linux/user.h>
-#include <linux/a.out.h>
 #include <linux/utsname.h>
 #include <linux/time.h>
 #include <linux/timex.h>
@@ -260,8 +259,8 @@ osf_statfs(char __user *path, struct osf_statfs __user *buffer, unsigned long bu
 
        retval = user_path_walk(path, &nd);
        if (!retval) {
-               retval = do_osf_statfs(nd.dentry, buffer, bufsiz);
-               path_release(&nd);
+               retval = do_osf_statfs(nd.path.dentry, buffer, bufsiz);
+               path_put(&nd.path);
        }
        return retval;
 }
@@ -430,7 +429,7 @@ sys_getpagesize(void)
 asmlinkage unsigned long
 sys_getdtablesize(void)
 {
-       return NR_OPEN;
+       return sysctl_nr_open;
 }
 
 /*
@@ -715,7 +714,7 @@ osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
                /* 
                 * Alpha Architecture Handbook 4.7.7.3:
                 * To be fully IEEE compiant, we must track the current IEEE
-                * exception state in software, because spurrious bits can be
+                * exception state in software, because spurious bits can be
                 * set in the trap shadow of a software-complete insn.
                 */
 
@@ -953,15 +952,25 @@ osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __use
 asmlinkage int
 osf_utimes(char __user *filename, struct timeval32 __user *tvs)
 {
-       struct timeval ktvs[2];
+       struct timespec tv[2];
 
        if (tvs) {
+               struct timeval ktvs[2];
                if (get_tv32(&ktvs[0], &tvs[0]) ||
                    get_tv32(&ktvs[1], &tvs[1]))
                        return -EFAULT;
+
+               if (ktvs[0].tv_usec < 0 || ktvs[0].tv_usec >= 1000000 ||
+                   ktvs[1].tv_usec < 0 || ktvs[1].tv_usec >= 1000000)
+                       return -EINVAL;
+
+               tv[0].tv_sec = ktvs[0].tv_sec;
+               tv[0].tv_nsec = 1000 * ktvs[0].tv_usec;
+               tv[1].tv_sec = ktvs[1].tv_sec;
+               tv[1].tv_nsec = 1000 * ktvs[1].tv_usec;
        }
 
-       return do_utimes(AT_FDCWD, filename, tvs ? ktvs : NULL);
+       return do_utimes(AT_FDCWD, filename, tvs ? tv : NULL, 0);
 }
 
 #define MAX_SELECT_SECONDS \