Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
533f90af
Commit
533f90af
authored
Oct 12, 2006
by
Steve French
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CIFS] Fix old DOS time conversion to handle timezone
Signed-off-by:
Steve French
<
sfrench@us.ibm.com
>
parent
70903ca0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
fs/cifs/netmisc.c
fs/cifs/netmisc.c
+1
-1
fs/cifs/readdir.c
fs/cifs/readdir.c
+12
-1
No files found.
fs/cifs/netmisc.c
View file @
533f90af
...
...
@@ -942,7 +942,7 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
cERROR
(
1
,(
"illegal date, month %d day: %d"
,
month
,
days
));
month
-=
1
;
days
+=
total_days_of_prev_months
[
month
];
days
+=
365
3
;
/* account for difference in days between 1980 and 1970 */
days
+=
365
2
;
/* account for difference in days between 1980 and 1970 */
year
=
sd
->
Year
;
days
+=
year
*
365
;
days
+=
(
year
/
4
);
/* leap year */
...
...
fs/cifs/readdir.c
View file @
533f90af
...
...
@@ -106,6 +106,17 @@ static int 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
,
int
*
pobject_type
,
int
isNewInode
)
{
...
...
@@ -148,7 +159,7 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
tmp_inode
->
i_ctime
=
cnvrtDosUnixTm
(
le16_to_cpu
(
pfindData
->
LastWriteDate
),
le16_to_cpu
(
pfindData
->
LastWriteTime
));
AdjustForTZ
(
cifs_sb
->
tcon
,
tmp_inode
);
attr
=
le16_to_cpu
(
pfindData
->
Attributes
);
allocation_size
=
le32_to_cpu
(
pfindData
->
AllocationSize
);
end_of_file
=
le32_to_cpu
(
pfindData
->
DataSize
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment