Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
bfc69a45
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bfc69a45
编写于
10月 15, 2007
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: define a function to update nfsi->cache_change_attribute
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
5cce428d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
3 deletion
+21
-3
fs/nfs/dir.c
fs/nfs/dir.c
+15
-0
fs/nfs/inode.c
fs/nfs/inode.c
+4
-2
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+1
-1
include/linux/nfs_fs.h
include/linux/nfs_fs.h
+1
-0
未找到文件。
fs/nfs/dir.c
浏览文件 @
bfc69a45
...
...
@@ -638,6 +638,21 @@ static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
return
0
;
}
/**
* nfs_force_lookup_revalidate - Mark the directory as having changed
* @dir - pointer to directory inode
*
* This forces the revalidation code in nfs_lookup_revalidate() to do a
* full lookup on all child dentries of 'dir' whenever a change occurs
* on the server that might have invalidated our dcache.
*
* The caller should be holding dir->i_lock
*/
void
nfs_force_lookup_revalidate
(
struct
inode
*
dir
)
{
NFS_I
(
dir
)
->
cache_change_attribute
=
jiffies
;
}
/*
* A check for whether or not the parent directory has changed.
* In the case it has, we assume that the dentries are untrustworthy
...
...
fs/nfs/inode.c
浏览文件 @
bfc69a45
...
...
@@ -1029,7 +1029,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
dprintk
(
"NFS: mtime change on server for file %s/%ld
\n
"
,
inode
->
i_sb
->
s_id
,
inode
->
i_ino
);
invalid
|=
NFS_INO_INVALID_ATTR
|
NFS_INO_INVALID_DATA
;
nfsi
->
cache_change_attribute
=
now
;
if
(
S_ISDIR
(
inode
->
i_mode
))
nfs_force_lookup_revalidate
(
inode
);
}
/* If ctime has changed we should definitely clear access+acl caches */
if
(
!
timespec_equal
(
&
inode
->
i_ctime
,
&
fattr
->
ctime
))
...
...
@@ -1038,7 +1039,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
dprintk
(
"NFS: change_attr change on server for file %s/%ld
\n
"
,
inode
->
i_sb
->
s_id
,
inode
->
i_ino
);
invalid
|=
NFS_INO_INVALID_ATTR
|
NFS_INO_INVALID_DATA
|
NFS_INO_INVALID_ACCESS
|
NFS_INO_INVALID_ACL
;
nfsi
->
cache_change_attribute
=
now
;
if
(
S_ISDIR
(
inode
->
i_mode
))
nfs_force_lookup_revalidate
(
inode
);
}
/* Check if our cached file size is stale */
...
...
fs/nfs/nfs4proc.c
浏览文件 @
bfc69a45
...
...
@@ -210,7 +210,7 @@ static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo)
spin_lock
(
&
dir
->
i_lock
);
nfsi
->
cache_validity
|=
NFS_INO_INVALID_ATTR
|
NFS_INO_REVAL_PAGECACHE
|
NFS_INO_INVALID_DATA
;
if
(
!
cinfo
->
atomic
||
cinfo
->
before
!=
nfsi
->
change_attr
)
nfs
i
->
cache_change_attribute
=
jiffies
;
nfs
_force_lookup_revalidate
(
dir
)
;
nfsi
->
change_attr
=
cinfo
->
after
;
spin_unlock
(
&
dir
->
i_lock
);
}
...
...
include/linux/nfs_fs.h
浏览文件 @
bfc69a45
...
...
@@ -366,6 +366,7 @@ extern const struct inode_operations nfs3_dir_inode_operations;
extern
const
struct
file_operations
nfs_dir_operations
;
extern
struct
dentry_operations
nfs_dentry_operations
;
extern
void
nfs_force_lookup_revalidate
(
struct
inode
*
dir
);
extern
int
nfs_instantiate
(
struct
dentry
*
dentry
,
struct
nfs_fh
*
fh
,
struct
nfs_fattr
*
fattr
);
extern
int
nfs_may_open
(
struct
inode
*
inode
,
struct
rpc_cred
*
cred
,
int
openflags
);
extern
void
nfs_access_zap_cache
(
struct
inode
*
inode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录