]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nfsd: allow filecache to hold S_IFDIR files
authorJeff Layton <jlayton@kernel.org>
Tue, 11 Nov 2025 14:12:55 +0000 (09:12 -0500)
committerChristian Brauner <brauner@kernel.org>
Wed, 12 Nov 2025 08:38:36 +0000 (09:38 +0100)
commit544a0ee152f0591dc689927007306fb9f09a175f
tree59008a04be479675b84526dcd3929c3163621923
parentd0eab9fc104730982a9ef5eff5989b7c871cd104
nfsd: allow filecache to hold S_IFDIR files

The filecache infrastructure will only handle S_IFREG files at the
moment. Directory delegations will require adding support for opening
S_IFDIR inodes.

Plumb a "type" argument into nfsd_file_do_acquire() and have all of the
existing callers set it to S_IFREG. Add a new nfsd_file_acquire_dir()
wrapper that nfsd can call to request a nfsd_file that holds a directory
open.

For now, there is no need for a fsnotify_mark for directories, as
CB_NOTIFY is not yet supported. Change nfsd_file_do_acquire() to avoid
allocating one for non-S_IFREG inodes.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20251111-dir-deleg-ro-v6-14-52f3feebb2f2@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/nfsd/filecache.c
fs/nfsd/filecache.h
fs/nfsd/vfs.c
fs/nfsd/vfs.h