nfsd: NFSD_FILE_KEY_INODE only needs to find GC'ed entries
Subsystems (2)
Jeff Layton
maintainerPATCH v2 1/1 nfsd: NFSD_FILE_KEY_INODE only needs to find GC'ed entries
Since v4 files are expected to be long-lived, there's little value in closing them out of the cache when there is conflicting access.
Change the comparator to also match the gc value in the key. Change both of the current users of that key to set the gc value in the key to "true".
Signed-off-by Jeff Layton <[email protected]>
--- fs/nfsd/filecache.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/nfsd/filecache.c +4 -0
@@ -175,6 +175,8 @@ static int nfsd_file_obj_cmpfn(struct rhashtable_compare_arg *arg,switch (key->type) {case NFSD_FILE_KEY_INODE : +if (test_bit (NFSD_FILE_GC , &nf->nf_flags) != key->gc) +return 1 ;if (nf->nf_inode != key->inode)return 1 ;break ;
@@ -683,6 +685,7 @@ nfsd_file_queue_for_close(struct inode *inode, struct list_head *dispose)struct nfsd_file_lookup_key key = { .type =NFSD_FILE_KEY_INODE , .inode = inode, + .gc = true, };struct nfsd_file *nf;
@@ -1059,6 +1062,7 @@ nfsd_file_is_cached(struct inode *inode)struct nfsd_file_lookup_key key = { .type =NFSD_FILE_KEY_INODE , .inode = inode, + .gc = true, };bool ret = false;
Signature · 1 line
2.39.0
Jeff Layton
maintainerPATCH v2 1/1 nfsd: simplify test_bit return in NFSD_FILE_KEY_FULL comparator
test_bit returns bool, so we can just compare the result of that to the key->gc value without the "!!".
Signed-off-by Jeff Layton <[email protected]>
--- fs/nfsd/filecache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/filecache.c +1 -1
@@ -189,7 +189,7 @@ static int nfsd_file_obj_cmpfn(struct rhashtable_compare_arg *arg,return 1 ;if (!nfsd_match_cred (nf->nf_cred, key->cred))return 1 ; -if (!!test_bit (NFSD_FILE_GC , &nf->nf_flags) != key->gc) +if (test_bit (NFSD_FILE_GC , &nf->nf_flags) != key->gc)return 1 ;if (test_bit (NFSD_FILE_HASHED , &nf->nf_flags) ==0 )return 1 ;
Signature · 1 line
2.39.0