]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rpc_pipe: saner primitive for creating subdirectories
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 22 Mar 2025 23:50:20 +0000 (19:50 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 3 Jul 2025 02:44:55 +0000 (22:44 -0400)
commitfc1abdca51ed7ddfe3fa8090a5b1f9ef9a792a22
tree4b20e596b1ac6a96bf0779cc6fedb1a9abda2d74
parent41a6b9e52b21544c334830bfe68fb78d6677caa0
rpc_pipe: saner primitive for creating subdirectories

All users of __rpc_mkdir() have the same form - start_creating(),
followed, in case of success, by __rpc_mkdir() and unlocking parent.

Combine that into a single helper, expanding __rpc_mkdir() into it,
along with the call of __rpc_create_common() in it.

Don't mess with d_drop() + d_add() - just d_instantiate() and be
done with that.  The reason __rpc_create_common() goes for that
dance is that dentry it gets might or might not be hashed; here
we know it's hashed.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
net/sunrpc/rpc_pipe.c