]> git.ipfire.org Git - thirdparty/linux.git/commit
nfsd: hash nfs4_files by inode number
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 16 Apr 2021 18:00:15 +0000 (14:00 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 19 Apr 2021 20:41:33 +0000 (16:41 -0400)
commitf9b60e2209213fdfcc504ba25a404977c5d08b77
treec57ae4561eb0adf4731cd245667fee5022fa2341
parent217fd6f625af591e2866bebb8cda778cf85bea2e
nfsd: hash nfs4_files by inode number

The nfs4_file structure is per-filehandle, not per-inode, because the
spec requires open and other state to be per filehandle.

But it will turn out to be convenient for nfs4_files associated with the
same inode to be hashed to the same bucket, so let's hash on the inode
instead of the filehandle.

Filehandle aliasing is rare, so that shouldn't have much performance
impact.

(If you have a ton of exported filesystems, though, and all of them have
a root with inode number 2, could that get you an overlong hash chain?
Perhaps this (and the v4 open file cache) should be hashed on the inode
pointer instead.)

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c
fs/nfsd/state.h