aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-13 11:09:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-13 11:09:29 -0400
commit12e36b2f41b6cbc67386fcb9c59c32a3e2033905 (patch)
treeec1794bae2f96eef6cc2afb2fa5c48e6fd346316 /fs/cifs/readdir.c
parent1baaf0b424fe611a99cf3e2e59e84df0561d679a (diff)
parent1a4e15a04ec69cb3552f4120079f5472377df5f7 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (27 commits) [CIFS] Missing flags2 for DFS [CIFS] Workaround incomplete byte length returned by some [CIFS] cifs Kconfig: don't select CONNECTOR [CIFS] Level 1 QPathInfo needed for proper OS2 support [CIFS] fix typo in previous patch [CIFS] Fix old DOS time conversion to handle timezone [CIFS] Do not need to adjust for Jan/Feb for leap day [CIFS] Fix leaps year calculation for years after 2100 [CIFS] readdir (ffirst) enablement of accurate timestamps from legacy servers [CIFS] Fix compiler warning with previous patch [CIFS] Fix typo [CIFS] Allow for 15 minute TZs (e.g. Nepal) and be more explicit about [CIFS] Fix readdir of large directories for backlevel servers [CIFS] Allow LANMAN21 support even in both POSIX non-POSIX path [CIFS] Make use of newer QFSInfo dependent on capability bit instead of [CIFS] Do not send newer QFSInfo to legacy servers which can not support it [CIFS] Fix typo in name of new cifs_show_stats [CIFS] Rename server time zone field [CIFS] Handle legacy servers which return undefined time zone [CIFS] CIFS support for /proc/<pid>/mountstats part 1 ... Manual conflict resolution in fs/cifs/connect.c
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r--fs/cifs/readdir.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index b27b34537bf2..b5b0a2a41bef 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -106,6 +106,17 @@ static int construct_dentry(struct qstr *qstring, struct file *file,
106 return rc; 106 return rc;
107} 107}
108 108
109static void AdjustForTZ(struct cifsTconInfo * tcon, struct inode * inode)
110{
111 if((tcon) && (tcon->ses) && (tcon->ses->server)) {
112 inode->i_ctime.tv_sec += tcon->ses->server->timeAdj;
113 inode->i_mtime.tv_sec += tcon->ses->server->timeAdj;
114 inode->i_atime.tv_sec += tcon->ses->server->timeAdj;
115 }
116 return;
117}
118
119
109static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, 120static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
110 char * buf, int *pobject_type, int isNewInode) 121 char * buf, int *pobject_type, int isNewInode)
111{ 122{
@@ -135,16 +146,23 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
135 tmp_inode->i_ctime = 146 tmp_inode->i_ctime =
136 cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime)); 147 cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));
137 } else { /* legacy, OS2 and DOS style */ 148 } else { /* legacy, OS2 and DOS style */
149/* struct timespec ts;*/
138 FIND_FILE_STANDARD_INFO * pfindData = 150 FIND_FILE_STANDARD_INFO * pfindData =
139 (FIND_FILE_STANDARD_INFO *)buf; 151 (FIND_FILE_STANDARD_INFO *)buf;
140 152
153 tmp_inode->i_mtime = cnvrtDosUnixTm(
154 le16_to_cpu(pfindData->LastWriteDate),
155 le16_to_cpu(pfindData->LastWriteTime));
156 tmp_inode->i_atime = cnvrtDosUnixTm(
157 le16_to_cpu(pfindData->LastAccessDate),
158 le16_to_cpu(pfindData->LastAccessTime));
159 tmp_inode->i_ctime = cnvrtDosUnixTm(
160 le16_to_cpu(pfindData->LastWriteDate),
161 le16_to_cpu(pfindData->LastWriteTime));
162 AdjustForTZ(cifs_sb->tcon, tmp_inode);
141 attr = le16_to_cpu(pfindData->Attributes); 163 attr = le16_to_cpu(pfindData->Attributes);
142 allocation_size = le32_to_cpu(pfindData->AllocationSize); 164 allocation_size = le32_to_cpu(pfindData->AllocationSize);
143 end_of_file = le32_to_cpu(pfindData->DataSize); 165 end_of_file = le32_to_cpu(pfindData->DataSize);
144 tmp_inode->i_atime = CURRENT_TIME;
145 /* tmp_inode->i_mtime = BB FIXME - add dos time handling
146 tmp_inode->i_ctime = 0; BB FIXME */
147
148 } 166 }
149 167
150 /* Linux can not store file creation time unfortunately so ignore it */ 168 /* Linux can not store file creation time unfortunately so ignore it */
@@ -938,6 +956,7 @@ static int cifs_save_resume_key(const char *current_entry,
938 filename = &pFindData->FileName[0]; 956 filename = &pFindData->FileName[0];
939 /* one byte length, no name conversion */ 957 /* one byte length, no name conversion */
940 len = (unsigned int)pFindData->FileNameLength; 958 len = (unsigned int)pFindData->FileNameLength;
959 cifsFile->srch_inf.resume_key = pFindData->ResumeKey;
941 } else { 960 } else {
942 cFYI(1,("Unknown findfirst level %d",level)); 961 cFYI(1,("Unknown findfirst level %d",level));
943 return -EINVAL; 962 return -EINVAL;