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
nexedi
linux
Commits
913a70fc
Commit
913a70fc
authored
Oct 27, 2005
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Convert cache_change_attribute into a jiffy-based value
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
0e574af1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
fs/nfs/inode.c
fs/nfs/inode.c
+4
-4
include/linux/nfs_fs.h
include/linux/nfs_fs.h
+1
-1
No files found.
fs/nfs/inode.c
View file @
913a70fc
...
...
@@ -1135,7 +1135,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
* We may need to keep the attributes marked as invalid if
* we raced with nfs_end_attr_update().
*/
if
(
verifier
==
nfsi
->
cache_change_attribute
)
if
(
time_after_eq
(
verifier
,
nfsi
->
cache_change_attribute
)
)
nfsi
->
cache_validity
&=
~
(
NFS_INO_INVALID_ATTR
|
NFS_INO_INVALID_ATIME
);
spin_unlock
(
&
inode
->
i_lock
);
...
...
@@ -1202,7 +1202,7 @@ void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
if
(
S_ISDIR
(
inode
->
i_mode
))
{
memset
(
nfsi
->
cookieverf
,
0
,
sizeof
(
nfsi
->
cookieverf
));
/* This ensures we revalidate child dentries */
nfsi
->
cache_change_attribute
++
;
nfsi
->
cache_change_attribute
=
jiffies
;
}
spin_unlock
(
&
inode
->
i_lock
);
...
...
@@ -1242,7 +1242,7 @@ void nfs_end_data_update(struct inode *inode)
nfsi
->
cache_validity
|=
NFS_INO_INVALID_DATA
;
spin_unlock
(
&
inode
->
i_lock
);
}
nfsi
->
cache_change_attribute
++
;
nfsi
->
cache_change_attribute
=
jiffies
;
atomic_dec
(
&
nfsi
->
data_updates
);
}
...
...
@@ -1391,7 +1391,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign
/* Do we perhaps have any outstanding writes? */
if
(
nfsi
->
npages
==
0
)
{
/* No, but did we race with nfs_end_data_update()? */
if
(
verifier
==
nfsi
->
cache_change_attribute
)
{
if
(
time_after_eq
(
verifier
,
nfsi
->
cache_change_attribute
)
)
{
inode
->
i_size
=
new_isize
;
invalid
|=
NFS_INO_INVALID_DATA
;
}
...
...
include/linux/nfs_fs.h
View file @
913a70fc
...
...
@@ -280,7 +280,7 @@ static inline long nfs_save_change_attribute(struct inode *inode)
static
inline
int
nfs_verify_change_attribute
(
struct
inode
*
inode
,
unsigned
long
chattr
)
{
return
!
nfs_caches_unstable
(
inode
)
&&
chattr
==
NFS_I
(
inode
)
->
cache_change_attribute
;
&&
time_after_eq
(
chattr
,
NFS_I
(
inode
)
->
cache_change_attribute
)
;
}
/*
...
...
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