Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146459
b: refs/heads/master
c: c4a2c08
h: refs/heads/master
i:
  146457: 75dbce4
  146455: 52eb003
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed May 28, 2009
1 parent fbc73c8 commit fa385de
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07119a4df8c8c77d888f2f46964ea9512ea84ff8
refs/heads/master: c4a2c08db7d976c2e23a97da5d69ec7c9701034d
4 changes: 2 additions & 2 deletions trunk/fs/cifs/cifsproto.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ extern void DeleteOplockQEntry(struct oplock_q_entry *);
extern void DeleteTconOplockQEntries(struct cifsTconInfo *);
extern struct timespec cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601);
extern u64 cifs_UnixTimeToNT(struct timespec);
extern __le64 cnvrtDosCifsTm(__u16 date, __u16 time);
extern struct timespec cnvrtDosUnixTm(__u16 date, __u16 time);
extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
int offset);

extern int cifs_posix_open(char *full_path, struct inode **pinode,
struct super_block *sb, int mode, int oflags,
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
int val, seconds, remain, result;
struct timespec ts, utc;
utc = CURRENT_TIME;
ts = cnvrtDosUnixTm(le16_to_cpu(rsp->SrvTime.Date),
le16_to_cpu(rsp->SrvTime.Time));
ts = cnvrtDosUnixTm(rsp->SrvTime.Date,
rsp->SrvTime.Time, 0);
cFYI(1, ("SrvTime %d sec since 1970 (utc: %d) diff: %d",
(int)ts.tv_sec, (int)utc.tv_sec,
(int)(utc.tv_sec - ts.tv_sec)));
Expand Down
12 changes: 4 additions & 8 deletions trunk/fs/cifs/netmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)); */

Expand Down
32 changes: 10 additions & 22 deletions trunk/fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,6 @@ construct_dentry(struct qstr *qstring, struct file *file,
return rc;
}

static void AdjustForTZ(struct cifsTconInfo *tcon, struct inode *inode)
{
if ((tcon) && (tcon->ses) && (tcon->ses->server)) {
inode->i_ctime.tv_sec += tcon->ses->server->timeAdj;
inode->i_mtime.tv_sec += tcon->ses->server->timeAdj;
inode->i_atime.tv_sec += tcon->ses->server->timeAdj;
}
return;
}


static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
char *buf, unsigned int *pobject_type, int isNewInode)
{
Expand Down Expand Up @@ -156,20 +145,19 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
tmp_inode->i_ctime =
cifs_NTtimeToUnix(pfindData->ChangeTime);
} else { /* legacy, OS2 and DOS style */
/* struct timespec ts;*/
int offset = cifs_sb->tcon->ses->server->timeAdj;
FIND_FILE_STANDARD_INFO *pfindData =
(FIND_FILE_STANDARD_INFO *)buf;

tmp_inode->i_mtime = cnvrtDosUnixTm(
le16_to_cpu(pfindData->LastWriteDate),
le16_to_cpu(pfindData->LastWriteTime));
tmp_inode->i_atime = cnvrtDosUnixTm(
le16_to_cpu(pfindData->LastAccessDate),
le16_to_cpu(pfindData->LastAccessTime));
tmp_inode->i_ctime = cnvrtDosUnixTm(
le16_to_cpu(pfindData->LastWriteDate),
le16_to_cpu(pfindData->LastWriteTime));
AdjustForTZ(cifs_sb->tcon, tmp_inode);
tmp_inode->i_mtime = cnvrtDosUnixTm(pfindData->LastWriteDate,
pfindData->LastWriteTime,
offset);
tmp_inode->i_atime = cnvrtDosUnixTm(pfindData->LastAccessDate,
pfindData->LastAccessTime,
offset);
tmp_inode->i_ctime = cnvrtDosUnixTm(pfindData->LastWriteDate,
pfindData->LastWriteTime,
offset);
attr = le16_to_cpu(pfindData->Attributes);
allocation_size = le32_to_cpu(pfindData->AllocationSize);
end_of_file = le32_to_cpu(pfindData->DataSize);
Expand Down

0 comments on commit fa385de

Please sign in to comment.