|
@@ -926,6 +926,7 @@ cifs_NTtimeToUnix(__le64 ntutc)
|
|
|
|
|
|
/* Subtract the NTFS time offset, then convert to 1s intervals. */
|
|
/* Subtract the NTFS time offset, then convert to 1s intervals. */
|
|
s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
|
|
s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
|
|
|
|
+ u64 abs_t;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Unfortunately can not use normal 64 bit division on 32 bit arch, but
|
|
* Unfortunately can not use normal 64 bit division on 32 bit arch, but
|
|
@@ -933,13 +934,14 @@ cifs_NTtimeToUnix(__le64 ntutc)
|
|
* to special case them
|
|
* to special case them
|
|
*/
|
|
*/
|
|
if (t < 0) {
|
|
if (t < 0) {
|
|
- t = -t;
|
|
|
|
- ts.tv_nsec = (long)(do_div(t, 10000000) * 100);
|
|
|
|
|
|
+ abs_t = -t;
|
|
|
|
+ ts.tv_nsec = (long)(do_div(abs_t, 10000000) * 100);
|
|
ts.tv_nsec = -ts.tv_nsec;
|
|
ts.tv_nsec = -ts.tv_nsec;
|
|
- ts.tv_sec = -t;
|
|
|
|
|
|
+ ts.tv_sec = -abs_t;
|
|
} else {
|
|
} else {
|
|
- ts.tv_nsec = (long)do_div(t, 10000000) * 100;
|
|
|
|
- ts.tv_sec = t;
|
|
|
|
|
|
+ abs_t = t;
|
|
|
|
+ ts.tv_nsec = (long)do_div(abs_t, 10000000) * 100;
|
|
|
|
+ ts.tv_sec = abs_t;
|
|
}
|
|
}
|
|
|
|
|
|
return ts;
|
|
return ts;
|