diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-05-27 09:37:33 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-05-28 10:57:20 -0400 |
commit | c4a2c08db7d976c2e23a97da5d69ec7c9701034d (patch) | |
tree | 803c588c4f60a50bbc3cf6465cb380c8ee95e3cd /fs/cifs/netmisc.c | |
parent | 07119a4df8c8c77d888f2f46964ea9512ea84ff8 (diff) |
cifs: make cnvrtDosUnixTm take a little-endian args and an offset
The callers primarily end up converting the args from le anyway. Also,
most of the callers end up needing to add an offset to the result. The
exception to these rules is cnvrtDosCifsTm, but there are no callers of
that function, so we might as well remove it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r-- | fs/cifs/netmisc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index d3ba75ef014f..32d6baa0a54f 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c | |||
@@ -883,16 +883,12 @@ cifs_UnixTimeToNT(struct timespec t) | |||
883 | static int total_days_of_prev_months[] = | 883 | static int total_days_of_prev_months[] = |
884 | {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; | 884 | {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; |
885 | 885 | ||
886 | 886 | struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset) | |
887 | __le64 cnvrtDosCifsTm(__u16 date, __u16 time) | ||
888 | { | ||
889 | return cpu_to_le64(cifs_UnixTimeToNT(cnvrtDosUnixTm(date, time))); | ||
890 | } | ||
891 | |||
892 | struct timespec cnvrtDosUnixTm(__u16 date, __u16 time) | ||
893 | { | 887 | { |
894 | struct timespec ts; | 888 | struct timespec ts; |
895 | int sec, min, days, month, year; | 889 | int sec, min, days, month, year; |
890 | u16 date = le16_to_cpu(le_date); | ||
891 | u16 time = le16_to_cpu(le_time); | ||
896 | SMB_TIME *st = (SMB_TIME *)&time; | 892 | SMB_TIME *st = (SMB_TIME *)&time; |
897 | SMB_DATE *sd = (SMB_DATE *)&date; | 893 | SMB_DATE *sd = (SMB_DATE *)&date; |
898 | 894 | ||
@@ -933,7 +929,7 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time) | |||
933 | days -= ((year & 0x03) == 0) && (month < 2 ? 1 : 0); | 929 | days -= ((year & 0x03) == 0) && (month < 2 ? 1 : 0); |
934 | sec += 24 * 60 * 60 * days; | 930 | sec += 24 * 60 * 60 * days; |
935 | 931 | ||
936 | ts.tv_sec = sec; | 932 | ts.tv_sec = sec + offset; |
937 | 933 | ||
938 | /* cFYI(1,("sec after cnvrt dos to unix time %d",sec)); */ | 934 | /* cFYI(1,("sec after cnvrt dos to unix time %d",sec)); */ |
939 | 935 | ||