]> git.baikalelectronics.ru Git - kernel.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)
commitccef78b824de149b0ac6661cc44af81de2587a3d
treec57ae4561eb0adf4731cd245667fee5022fa2341
parent5d963275e22703d336955643706c5ca6bc54cbf1
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