diff options
Diffstat (limited to 'fs/cifs/netmisc.c')
| -rw-r--r-- | fs/cifs/netmisc.c | 19 | 
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index d7ad0dfe4e68..fdd908e4a26b 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c @@ -918,10 +918,10 @@ smbCalcSize(void *buf, struct TCP_Server_Info *server)   * Convert the NT UTC (based 1601-01-01, in hundred nanosecond units)   * into Unix UTC (based 1970-01-01, in seconds).   */ -struct timespec +struct timespec64  cifs_NTtimeToUnix(__le64 ntutc)  { -	struct timespec ts; +	struct timespec64 ts;  	/* BB what about the timezone? BB */  	/* Subtract the NTFS time offset, then convert to 1s intervals. */ @@ -935,12 +935,12 @@ cifs_NTtimeToUnix(__le64 ntutc)  	 */  	if (t < 0) {  		abs_t = -t; -		ts.tv_nsec = (long)(do_div(abs_t, 10000000) * 100); +		ts.tv_nsec = (time64_t)(do_div(abs_t, 10000000) * 100);  		ts.tv_nsec = -ts.tv_nsec;  		ts.tv_sec = -abs_t;  	} else {  		abs_t = t; -		ts.tv_nsec = (long)do_div(abs_t, 10000000) * 100; +		ts.tv_nsec = (time64_t)do_div(abs_t, 10000000) * 100;  		ts.tv_sec = abs_t;  	} @@ -949,7 +949,7 @@ cifs_NTtimeToUnix(__le64 ntutc)  /* Convert the Unix UTC into NT UTC. */  u64 -cifs_UnixTimeToNT(struct timespec t) +cifs_UnixTimeToNT(struct timespec64 t)  {  	/* Convert to 100ns intervals and then add the NTFS time offset. */  	return (u64) t.tv_sec * 10000000 + t.tv_nsec/100 + NTFS_TIME_OFFSET; @@ -959,10 +959,11 @@ static const int total_days_of_prev_months[] = {  	0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334  }; -struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset) +struct timespec64 cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)  { -	struct timespec ts; -	int sec, min, days, month, year; +	struct timespec64 ts; +	time64_t sec; +	int min, days, month, year;  	u16 date = le16_to_cpu(le_date);  	u16 time = le16_to_cpu(le_time);  	SMB_TIME *st = (SMB_TIME *)&time; @@ -973,7 +974,7 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)  	sec = 2 * st->TwoSeconds;  	min = st->Minutes;  	if ((sec > 59) || (min > 59)) -		cifs_dbg(VFS, "illegal time min %d sec %d\n", min, sec); +		cifs_dbg(VFS, "illegal time min %d sec %lld\n", min, sec);  	sec += (min * 60);  	sec += 60 * 60 * st->Hours;  	if (st->Hours > 24)  |