]> 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)
commit6bf05a130bba7a961587a55a5dcc1c8f3e69b57a
treec57ae4561eb0adf4731cd245667fee5022fa2341
parent29f82c07a2dbf2c63cb54ae34ac3af3d0f5080dd
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