Skip to content

Commit 6c31e4c

Browse files
jtlaytonchucklever
authored andcommitted
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 <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent b8bea9f commit 6c31e4c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/nfsd/filecache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ static int nfsd_file_obj_cmpfn(struct rhashtable_compare_arg *arg,
175175

176176
switch (key->type) {
177177
case NFSD_FILE_KEY_INODE:
178+
if (test_bit(NFSD_FILE_GC, &nf->nf_flags) != key->gc)
179+
return 1;
178180
if (nf->nf_inode != key->inode)
179181
return 1;
180182
break;
@@ -695,6 +697,7 @@ nfsd_file_queue_for_close(struct inode *inode, struct list_head *dispose)
695697
struct nfsd_file_lookup_key key = {
696698
.type = NFSD_FILE_KEY_INODE,
697699
.inode = inode,
700+
.gc = true,
698701
};
699702
struct nfsd_file *nf;
700703

@@ -1049,6 +1052,7 @@ nfsd_file_is_cached(struct inode *inode)
10491052
struct nfsd_file_lookup_key key = {
10501053
.type = NFSD_FILE_KEY_INODE,
10511054
.inode = inode,
1055+
.gc = true,
10521056
};
10531057
bool ret = false;
10541058

0 commit comments

Comments
 (0)