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
02a2779f
Commit
02a2779f
authored
Jun 11, 2019
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cache_consistency'
parents
41adafa0
1c341b77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
fs/nfs/dir.c
fs/nfs/dir.c
+4
-0
fs/nfs/inode.c
fs/nfs/inode.c
+11
-4
include/linux/nfs_fs.h
include/linux/nfs_fs.h
+2
-0
No files found.
fs/nfs/dir.c
View file @
02a2779f
...
...
@@ -80,6 +80,10 @@ static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct inode *dir
ctx
->
dup_cookie
=
0
;
ctx
->
cred
=
get_cred
(
cred
);
spin_lock
(
&
dir
->
i_lock
);
if
(
list_empty
(
&
nfsi
->
open_files
)
&&
(
nfsi
->
cache_validity
&
NFS_INO_DATA_INVAL_DEFER
))
nfsi
->
cache_validity
|=
NFS_INO_INVALID_DATA
|
NFS_INO_REVAL_FORCED
;
list_add
(
&
ctx
->
list
,
&
nfsi
->
open_files
);
spin_unlock
(
&
dir
->
i_lock
);
return
ctx
;
...
...
fs/nfs/inode.c
View file @
02a2779f
...
...
@@ -208,7 +208,7 @@ static void nfs_set_cache_invalid(struct inode *inode, unsigned long flags)
}
if
(
inode
->
i_mapping
->
nrpages
==
0
)
flags
&=
~
NFS_INO_INVALID_DATA
;
flags
&=
~
(
NFS_INO_INVALID_DATA
|
NFS_INO_DATA_INVAL_DEFER
)
;
nfsi
->
cache_validity
|=
flags
;
if
(
flags
&
NFS_INO_INVALID_DATA
)
nfs_fscache_invalidate
(
inode
);
...
...
@@ -652,7 +652,8 @@ static int nfs_vmtruncate(struct inode * inode, loff_t offset)
i_size_write
(
inode
,
offset
);
/* Optimisation */
if
(
offset
==
0
)
NFS_I
(
inode
)
->
cache_validity
&=
~
NFS_INO_INVALID_DATA
;
NFS_I
(
inode
)
->
cache_validity
&=
~
(
NFS_INO_INVALID_DATA
|
NFS_INO_DATA_INVAL_DEFER
);
NFS_I
(
inode
)
->
cache_validity
&=
~
NFS_INO_INVALID_SIZE
;
spin_unlock
(
&
inode
->
i_lock
);
...
...
@@ -1032,6 +1033,10 @@ void nfs_inode_attach_open_context(struct nfs_open_context *ctx)
struct
nfs_inode
*
nfsi
=
NFS_I
(
inode
);
spin_lock
(
&
inode
->
i_lock
);
if
(
list_empty
(
&
nfsi
->
open_files
)
&&
(
nfsi
->
cache_validity
&
NFS_INO_DATA_INVAL_DEFER
))
nfsi
->
cache_validity
|=
NFS_INO_INVALID_DATA
|
NFS_INO_REVAL_FORCED
;
list_add_tail_rcu
(
&
ctx
->
list
,
&
nfsi
->
open_files
);
spin_unlock
(
&
inode
->
i_lock
);
}
...
...
@@ -1313,7 +1318,8 @@ int nfs_revalidate_mapping(struct inode *inode,
set_bit
(
NFS_INO_INVALIDATING
,
bitlock
);
smp_wmb
();
nfsi
->
cache_validity
&=
~
NFS_INO_INVALID_DATA
;
nfsi
->
cache_validity
&=
~
(
NFS_INO_INVALID_DATA
|
NFS_INO_DATA_INVAL_DEFER
);
spin_unlock
(
&
inode
->
i_lock
);
trace_nfs_invalidate_mapping_enter
(
inode
);
ret
=
nfs_invalidate_mapping
(
inode
,
mapping
);
...
...
@@ -1871,7 +1877,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
);
}
}
else
if
(
!
have_delegation
)
nfsi
->
cache_validity
|=
NFS_INO_DATA_INVAL_DEFER
;
inode_set_iversion_raw
(
inode
,
fattr
->
change_attr
);
attr_changed
=
true
;
}
...
...
include/linux/nfs_fs.h
View file @
02a2779f
...
...
@@ -223,6 +223,8 @@ struct nfs4_copy_state {
#define NFS_INO_INVALID_MTIME BIT(10)
/* cached mtime is invalid */
#define NFS_INO_INVALID_SIZE BIT(11)
/* cached size is invalid */
#define NFS_INO_INVALID_OTHER BIT(12)
/* other attrs are invalid */
#define NFS_INO_DATA_INVAL_DEFER \
BIT(13)
/* Deferred cache invalidation */
#define NFS_INO_INVALID_ATTR (NFS_INO_INVALID_CHANGE \
| NFS_INO_INVALID_CTIME \
...
...
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