diff options
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r-- | fs/cifs/readdir.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 964e097c8203..86d0055dc529 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -115,17 +115,6 @@ construct_dentry(struct qstr *qstring, struct file *file, | |||
115 | return rc; | 115 | return rc; |
116 | } | 116 | } |
117 | 117 | ||
118 | static void AdjustForTZ(struct cifsTconInfo *tcon, struct inode *inode) | ||
119 | { | ||
120 | if ((tcon) && (tcon->ses) && (tcon->ses->server)) { | ||
121 | inode->i_ctime.tv_sec += tcon->ses->server->timeAdj; | ||
122 | inode->i_mtime.tv_sec += tcon->ses->server->timeAdj; | ||
123 | inode->i_atime.tv_sec += tcon->ses->server->timeAdj; | ||
124 | } | ||
125 | return; | ||
126 | } | ||
127 | |||
128 | |||
129 | static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, | 118 | static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, |
130 | char *buf, unsigned int *pobject_type, int isNewInode) | 119 | char *buf, unsigned int *pobject_type, int isNewInode) |
131 | { | 120 | { |
@@ -150,26 +139,25 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, | |||
150 | allocation_size = le64_to_cpu(pfindData->AllocationSize); | 139 | allocation_size = le64_to_cpu(pfindData->AllocationSize); |
151 | end_of_file = le64_to_cpu(pfindData->EndOfFile); | 140 | end_of_file = le64_to_cpu(pfindData->EndOfFile); |
152 | tmp_inode->i_atime = | 141 | tmp_inode->i_atime = |
153 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastAccessTime)); | 142 | cifs_NTtimeToUnix(pfindData->LastAccessTime); |
154 | tmp_inode->i_mtime = | 143 | tmp_inode->i_mtime = |
155 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastWriteTime)); | 144 | cifs_NTtimeToUnix(pfindData->LastWriteTime); |
156 | tmp_inode->i_ctime = | 145 | tmp_inode->i_ctime = |
157 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime)); | 146 | cifs_NTtimeToUnix(pfindData->ChangeTime); |
158 | } else { /* legacy, OS2 and DOS style */ | 147 | } else { /* legacy, OS2 and DOS style */ |
159 | /* struct timespec ts;*/ | 148 | int offset = cifs_sb->tcon->ses->server->timeAdj; |
160 | FIND_FILE_STANDARD_INFO *pfindData = | 149 | FIND_FILE_STANDARD_INFO *pfindData = |
161 | (FIND_FILE_STANDARD_INFO *)buf; | 150 | (FIND_FILE_STANDARD_INFO *)buf; |
162 | 151 | ||
163 | tmp_inode->i_mtime = cnvrtDosUnixTm( | 152 | tmp_inode->i_mtime = cnvrtDosUnixTm(pfindData->LastWriteDate, |
164 | le16_to_cpu(pfindData->LastWriteDate), | 153 | pfindData->LastWriteTime, |
165 | le16_to_cpu(pfindData->LastWriteTime)); | 154 | offset); |
166 | tmp_inode->i_atime = cnvrtDosUnixTm( | 155 | tmp_inode->i_atime = cnvrtDosUnixTm(pfindData->LastAccessDate, |
167 | le16_to_cpu(pfindData->LastAccessDate), | 156 | pfindData->LastAccessTime, |
168 | le16_to_cpu(pfindData->LastAccessTime)); | 157 | offset); |
169 | tmp_inode->i_ctime = cnvrtDosUnixTm( | 158 | tmp_inode->i_ctime = cnvrtDosUnixTm(pfindData->LastWriteDate, |
170 | le16_to_cpu(pfindData->LastWriteDate), | 159 | pfindData->LastWriteTime, |
171 | le16_to_cpu(pfindData->LastWriteTime)); | 160 | offset); |
172 | AdjustForTZ(cifs_sb->tcon, tmp_inode); | ||
173 | attr = le16_to_cpu(pfindData->Attributes); | 161 | attr = le16_to_cpu(pfindData->Attributes); |
174 | allocation_size = le32_to_cpu(pfindData->AllocationSize); | 162 | allocation_size = le32_to_cpu(pfindData->AllocationSize); |
175 | end_of_file = le32_to_cpu(pfindData->DataSize); | 163 | end_of_file = le32_to_cpu(pfindData->DataSize); |
@@ -331,11 +319,11 @@ static void unix_fill_in_inode(struct inode *tmp_inode, | |||
331 | local_size = tmp_inode->i_size; | 319 | local_size = tmp_inode->i_size; |
332 | 320 | ||
333 | tmp_inode->i_atime = | 321 | tmp_inode->i_atime = |
334 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastAccessTime)); | 322 | cifs_NTtimeToUnix(pfindData->LastAccessTime); |
335 | tmp_inode->i_mtime = | 323 | tmp_inode->i_mtime = |
336 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastModificationTime)); | 324 | cifs_NTtimeToUnix(pfindData->LastModificationTime); |
337 | tmp_inode->i_ctime = | 325 | tmp_inode->i_ctime = |
338 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastStatusChange)); | 326 | cifs_NTtimeToUnix(pfindData->LastStatusChange); |
339 | 327 | ||
340 | tmp_inode->i_mode = le64_to_cpu(pfindData->Permissions); | 328 | tmp_inode->i_mode = le64_to_cpu(pfindData->Permissions); |
341 | /* since we set the inode type below we need to mask off type | 329 | /* since we set the inode type below we need to mask off type |