Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ca62b9c3
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ca62b9c3
编写于
3月 20, 2006
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Don't invalidate cached attributes if change attribute is unchanged
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
755c1e20
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
24 addition
and
20 deletion
+24
-20
fs/nfs/inode.c
fs/nfs/inode.c
+24
-20
未找到文件。
fs/nfs/inode.c
浏览文件 @
ca62b9c3
...
...
@@ -1299,34 +1299,35 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
if
((
fattr
->
valid
&
NFS_ATTR_FATTR
)
==
0
)
return
0
;
/* Has the inode gone and changed behind our back? */
if
(
nfsi
->
fileid
!=
fattr
->
fileid
||
(
inode
->
i_mode
&
S_IFMT
)
!=
(
fattr
->
mode
&
S_IFMT
))
{
return
-
EIO
;
}
/* Are we in the process of updating data on the server? */
data_unstable
=
nfs_caches_unstable
(
inode
);
/* Do atomic weak cache consistency updates */
nfs_wcc_update_inode
(
inode
,
fattr
);
if
((
fattr
->
valid
&
NFS_ATTR_FATTR_V4
)
!=
0
&&
nfsi
->
change_attr
!=
fattr
->
change_attr
)
{
if
((
fattr
->
valid
&
NFS_ATTR_FATTR_V4
)
!=
0
)
{
if
(
nfsi
->
change_attr
==
fattr
->
change_attr
)
goto
out
;
nfsi
->
cache_validity
|=
NFS_INO_INVALID_ATTR
;
if
(
!
data_unstable
)
nfsi
->
cache_validity
|=
NFS_INO_REVAL_PAGECACHE
;
}
/* Has the inode gone and changed behind our back? */
if
(
nfsi
->
fileid
!=
fattr
->
fileid
||
(
inode
->
i_mode
&
S_IFMT
)
!=
(
fattr
->
mode
&
S_IFMT
))
{
return
-
EIO
;
}
cur_size
=
i_size_read
(
inode
);
new_isize
=
nfs_size_to_loff_t
(
fattr
->
size
);
/* Verify a few of the more important attributes */
if
(
!
timespec_equal
(
&
inode
->
i_mtime
,
&
fattr
->
mtime
))
{
nfsi
->
cache_validity
|=
NFS_INO_INVALID_ATTR
;
if
(
!
data_unstable
)
nfsi
->
cache_validity
|=
NFS_INO_REVAL_PAGECACHE
;
}
cur_size
=
i_size_read
(
inode
);
new_isize
=
nfs_size_to_loff_t
(
fattr
->
size
);
if
(
cur_size
!=
new_isize
)
{
nfsi
->
cache_validity
|=
NFS_INO_INVALID_ATTR
;
if
(
nfsi
->
npages
==
0
)
...
...
@@ -1343,6 +1344,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
if
(
inode
->
i_nlink
!=
fattr
->
nlink
)
nfsi
->
cache_validity
|=
NFS_INO_INVALID_ATTR
;
out:
if
(
!
timespec_equal
(
&
inode
->
i_atime
,
&
fattr
->
atime
))
nfsi
->
cache_validity
|=
NFS_INO_INVALID_ATIME
;
...
...
@@ -1481,15 +1483,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
nfsi
->
cache_change_attribute
=
jiffies
;
}
if
((
fattr
->
valid
&
NFS_ATTR_FATTR_V4
)
&&
nfsi
->
change_attr
!=
fattr
->
change_attr
)
{
dprintk
(
"NFS: change_attr change on server for file %s/%ld
\n
"
,
inode
->
i_sb
->
s_id
,
inode
->
i_ino
);
nfsi
->
change_attr
=
fattr
->
change_attr
;
invalid
|=
NFS_INO_INVALID_ATTR
|
NFS_INO_INVALID_DATA
|
NFS_INO_INVALID_ACCESS
|
NFS_INO_INVALID_ACL
;
nfsi
->
cache_change_attribute
=
jiffies
;
}
/* If ctime has changed we should definitely clear access+acl caches */
if
(
!
timespec_equal
(
&
inode
->
i_ctime
,
&
fattr
->
ctime
))
{
invalid
|=
NFS_INO_INVALID_ACCESS
|
NFS_INO_INVALID_ACL
;
...
...
@@ -1519,6 +1512,17 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
inode
->
i_blksize
=
fattr
->
du
.
nfs2
.
blocksize
;
}
if
((
fattr
->
valid
&
NFS_ATTR_FATTR_V4
))
{
if
(
nfsi
->
change_attr
!=
fattr
->
change_attr
)
{
dprintk
(
"NFS: change_attr change on server for file %s/%ld
\n
"
,
inode
->
i_sb
->
s_id
,
inode
->
i_ino
);
nfsi
->
change_attr
=
fattr
->
change_attr
;
invalid
|=
NFS_INO_INVALID_ATTR
|
NFS_INO_INVALID_DATA
|
NFS_INO_INVALID_ACCESS
|
NFS_INO_INVALID_ACL
;
nfsi
->
cache_change_attribute
=
jiffies
;
}
else
invalid
&=
~
(
NFS_INO_INVALID_ATTR
|
NFS_INO_INVALID_DATA
);
}
/* Update attrtimeo value if we're out of the unstable period */
if
(
invalid
&
NFS_INO_INVALID_ATTR
)
{
nfsi
->
attrtimeo
=
NFS_MINATTRTIMEO
(
inode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录