Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
268f3be1
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
268f3be1
编写于
10月 06, 2006
作者:
S
Steve French
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CIFS] readdir (ffirst) enablement of accurate timestamps from legacy servers
Signed-off-by:
N
Steve French
<
sfrench@us.ibm.com
>
上级
1a70d652
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
27 addition
and
30 deletion
+27
-30
fs/cifs/netmisc.c
fs/cifs/netmisc.c
+18
-21
fs/cifs/readdir.c
fs/cifs/readdir.c
+9
-9
未找到文件。
fs/cifs/netmisc.c
浏览文件 @
268f3be1
...
...
@@ -918,45 +918,42 @@ __le64 cnvrtDosCifsTm(__u16 date, __u16 time)
{
return
cpu_to_le64
(
cifs_UnixTimeToNT
(
cnvrtDosUnixTm
(
date
,
time
)));
}
struct
timespec
cnvrtDosUnixTm
(
__u16
date
,
__u16
time
)
{
__u8
dt
[
2
];
__u8
tm
[
2
];
struct
timespec
ts
;
int
sec
,
min
,
days
,
month
,
year
;
struct
timespec
removeme
;
/* BB removeme BB */
/* SMB_TIME * st = (SMB_TIME *)&time;*/
int
sec
,
min
,
days
,
month
,
year
;
SMB_TIME
*
st
=
(
SMB_TIME
*
)
&
time
;
SMB_DATE
*
sd
=
(
SMB_DATE
*
)
&
date
;
cFYI
(
1
,(
"date %d time %d"
,
date
,
time
));
dt
[
0
]
=
date
&
0xFF
;
dt
[
1
]
=
(
date
&
0xFF00
)
>>
8
;
tm
[
0
]
=
time
&
0xFF
;
tm
[
1
]
=
(
time
&
0xFF00
)
>>
8
;
sec
=
tm
[
0
]
&
0x1F
;
sec
=
2
*
sec
;
min
=
((
tm
[
0
]
>>
5
)
&
0xFF
)
+
((
tm
[
1
]
&
0x7
)
<<
3
);
sec
=
2
*
st
->
TwoSeconds
;
min
=
st
->
Minutes
;
if
((
sec
>
59
)
||
(
min
>
59
))
cERROR
(
1
,(
"illegal time min %d sec %d"
,
min
,
sec
));
sec
+=
(
min
*
60
);
sec
+=
60
*
60
*
((
tm
[
1
]
>>
3
)
&
0xFF
)
/* hours */
;
days
=
(
dt
[
0
]
&
0x1F
)
-
1
;
month
=
((
dt
[
0
]
>>
5
)
&
0xFF
)
+
((
dt
[
1
]
&
0x1
)
<<
3
);
if
(
month
>
12
)
cERROR
(
1
,(
"illegal month %d in date"
,
month
));
sec
+=
60
*
60
*
st
->
Hours
;
if
(
st
->
Hours
>
24
)
cERROR
(
1
,(
"illegal hours %d"
,
st
->
Hours
));
days
=
sd
->
Day
;
month
=
sd
->
Month
;
if
((
days
>
31
)
||
(
month
>
12
))
cERROR
(
1
,(
"illegal date, month %d day: %d"
,
month
,
days
));
month
-=
1
;
days
+=
total_days_of_prev_months
[
month
];
days
+=
3653
;
/* account for difference in days between 1980 and 1970 */
year
=
(
dt
[
1
]
>>
1
)
&
0xFF
;
year
=
sd
->
Year
;
days
+=
year
*
365
;
days
+=
(
year
/
4
);
/* leap year */
/* adjust for leap year where we are still before leap day */
days
-=
((
year
&
0x03
)
==
0
)
&&
(
month
<
2
?
1
:
0
);
sec
+=
24
*
60
*
60
*
days
;
removeme
=
CURRENT_TIME
;
/* BB removeme BB */
ts
.
tv_sec
=
sec
;
/* cFYI(1,("sec after cnvrt dos to unix time %d",sec)); */
ts
.
tv_nsec
=
0
;
return
ts
;
}
fs/cifs/readdir.c
浏览文件 @
268f3be1
...
...
@@ -139,19 +139,19 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
FIND_FILE_STANDARD_INFO
*
pfindData
=
(
FIND_FILE_STANDARD_INFO
*
)
buf
;
/* ts
= cnvrtDosUnixTm(
tmp_inode
->
i_mtime
=
cnvrtDosUnixTm
(
le16_to_cpu
(
pfindData
->
LastWriteDate
),
le16_to_cpu(pfindData->LastWriteTime));*/
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
));
attr
=
le16_to_cpu
(
pfindData
->
Attributes
);
allocation_size
=
le32_to_cpu
(
pfindData
->
AllocationSize
);
end_of_file
=
le32_to_cpu
(
pfindData
->
DataSize
);
/* do not need to use current_fs_time helper function since
time not stored for this case so atime can not "go backwards"
by pulling newer older from disk when inode refrenshed */
tmp_inode
->
i_atime
=
CURRENT_TIME
;
/* tmp_inode->i_mtime = BB FIXME - add dos time handling
tmp_inode->i_ctime = 0; BB FIXME */
}
/* Linux can not store file creation time unfortunately so ignore it */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录