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
bfc69a45
Commit
bfc69a45
authored
Oct 15, 2007
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: define a function to update nfsi->cache_change_attribute
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
5cce428d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
3 deletions
+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
No files found.
fs/nfs/dir.c
View file @
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
View file @
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
View file @
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
View file @
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
);
...
...
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