summaryrefslogtreecommitdiffstats
path: root/fs/cifs/netmisc.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2009-05-27 09:37:33 -0400
committerSteve French <sfrench@us.ibm.com>2009-05-28 14:57:20 +0000
commitc4a2c08db7d976c2e23a97da5d69ec7c9701034d (patch)
tree803c588c4f60a50bbc3cf6465cb380c8ee95e3cd /fs/cifs/netmisc.c
parent07119a4df8c8c77d888f2f46964ea9512ea84ff8 (diff)
downloadop-kernel-dev-c4a2c08db7d976c2e23a97da5d69ec7c9701034d.zip
op-kernel-dev-c4a2c08db7d976c2e23a97da5d69ec7c9701034d.tar.gz
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.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index d3ba75e..32d6baa 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -883,16 +883,12 @@ cifs_UnixTimeToNT(struct timespec t)
static int total_days_of_prev_months[] =
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
-
-__le64 cnvrtDosCifsTm(__u16 date, __u16 time)
-{
- return cpu_to_le64(cifs_UnixTimeToNT(cnvrtDosUnixTm(date, time)));
-}
-
-struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
+struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
{
struct timespec ts;
int sec, min, days, month, year;
+ u16 date = le16_to_cpu(le_date);
+ u16 time = le16_to_cpu(le_time);
SMB_TIME *st = (SMB_TIME *)&time;
SMB_DATE *sd = (SMB_DATE *)&date;
@@ -933,7 +929,7 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
days -= ((year & 0x03) == 0) && (month < 2 ? 1 : 0);
sec += 24 * 60 * 60 * days;
- ts.tv_sec = sec;
+ ts.tv_sec = sec + offset;
/* cFYI(1,("sec after cnvrt dos to unix time %d",sec)); */
OpenPOWER on IntegriCloud