]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
convert nfsctl
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 26 Feb 2024 06:37:54 +0000 (01:37 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 18 Nov 2025 04:59:27 +0000 (23:59 -0500)
commit0c9a266868f5b8174b7a0c56ff1b8a948e0786d4
tree6c47fb58720b4b14dd6ce101270fd74b925e2a9d
parent946e2256775e50cc0d60f588ecfee60cf3b86b45
convert nfsctl

One instance per net-ns.  There's a fixed subset (several files in root,
an optional symlink in root + initially empty /clients/) + per-client
subdirectory in /clients/.  Clients can appear only after the filesystem
is there and they are all gone before it gets through ->kill_sb().

Fixed subset created in fill_super(), regular files by simple_fill_super(),
then a subdirectory and a symlink - manually.  It is removed by
kill_litter_super().

Per-client subdirectories are created by nfsd_client_mkdir() (populated
with client-supplied list of files in them).  Removed by nfsd_client_rmdir(),
which is simple_recursive_removal().

All dentries except for the ones from simple_fill_super() come from
* nfsd_mkdir() (subdirectory, dentry from simple_start_creating()).
  Called from fill_super() (creates initially empty /clients)
  and from nfsd_client_mkdir (creates a per-client subdirectory
  in /clients).
* _nfsd_symlink() (symlink, dentry from simple_start_creating()), called
  from fill_super().
* nfsdfs_create_files() (regulars, dentry from simple_start_creating()),
  called only from nfsd_client_mkdir().

Turn d_instatiate() + inode_unlock() into d_make_persistent() + simple_done_creating()
in nfsd_mkdir(), _nfsd_symlink() and nfsdfs_create_files() and we are done.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/nfsd/nfsctl.c