]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
uml: fix hostfs tv_usec calculations
authorDominique Quatravaux <dominique@quatravaux.org>
Tue, 5 Feb 2008 06:31:15 +0000 (22:31 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 5 Feb 2008 17:44:30 +0000 (09:44 -0800)
To convert from tv_nsec to tv_usec, one needs to divide by 1000, not multiply.

Signed-off-by: Dominique Quatravaux <dominique@quatravaux.org>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/hostfs/hostfs_user.c

index 35c1a9f33f47895958cb68aff7e449c06ce08f3a..53fd0a67c11abf148a76cea7820a1a3c782adc26 100644 (file)
@@ -285,17 +285,17 @@ int set_attr(const char *file, struct hostfs_iattr *attrs, int fd)
                        return err;
 
                times[0].tv_sec = atime_ts.tv_sec;
-               times[0].tv_usec = atime_ts.tv_nsec * 1000;
+               times[0].tv_usec = atime_ts.tv_nsec / 1000;
                times[1].tv_sec = mtime_ts.tv_sec;
-               times[1].tv_usec = mtime_ts.tv_nsec * 1000;
+               times[1].tv_usec = mtime_ts.tv_nsec / 1000;
 
                if (attrs->ia_valid & HOSTFS_ATTR_ATIME_SET) {
                        times[0].tv_sec = attrs->ia_atime.tv_sec;
-                       times[0].tv_usec = attrs->ia_atime.tv_nsec * 1000;
+                       times[0].tv_usec = attrs->ia_atime.tv_nsec / 1000;
                }
                if (attrs->ia_valid & HOSTFS_ATTR_MTIME_SET) {
                        times[1].tv_sec = attrs->ia_mtime.tv_sec;
-                       times[1].tv_usec = attrs->ia_mtime.tv_nsec * 1000;
+                       times[1].tv_usec = attrs->ia_mtime.tv_nsec / 1000;
                }
 
                if (fd >= 0) {