summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-02-20 23:38:36 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2025-07-02 22:44:55 -0400
commitdb83fa912ef26f1ce3f4aa55a09fd7ce94730a4d (patch)
tree1da1ba77cd4a10ba65616ac1e81758191c9e62d9
parent805060a69c3e5961c55dc5e53bcdcec323a2aa4c (diff)
rpc_new_dir(): the last argument is always NULL
All callers except the one in rpc_populate() pass explicit NULL there; rpc_populate() passes its last argument ('private') instead, but in the only call of rpc_populate() that creates any subdirectories (when creating fixed subdirectories of root) private itself is NULL. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--net/sunrpc/rpc_pipe.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 15ec770bb7fbb..c14425d2d0d3e 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -552,8 +552,7 @@ static int rpc_new_file(struct dentry *parent,
static struct dentry *rpc_new_dir(struct dentry *parent,
const char *name,
- umode_t mode,
- void *private)
+ umode_t mode)
{
struct dentry *dentry = simple_start_creating(parent, name);
struct inode *dir = parent->d_inode;
@@ -570,7 +569,6 @@ static struct dentry *rpc_new_dir(struct dentry *parent,
}
inode->i_ino = iunique(dir->i_sb, 100);
- rpc_inode_setowner(inode, private);
inc_nlink(dir);
d_instantiate(dentry, inode);
fsnotify_mkdir(dir, dentry);
@@ -603,8 +601,7 @@ static int rpc_populate(struct dentry *parent,
case S_IFDIR:
dentry = rpc_new_dir(parent,
files[i].name,
- files[i].mode,
- private);
+ files[i].mode);
if (IS_ERR(dentry)) {
err = PTR_ERR(dentry);
goto out_bad;
@@ -886,7 +883,7 @@ struct dentry *rpc_create_client_dir(struct dentry *dentry,
struct dentry *ret;
int error;
- ret = rpc_new_dir(dentry, name, 0555, NULL);
+ ret = rpc_new_dir(dentry, name, 0555);
if (IS_ERR(ret))
return ret;
error = rpc_populate(ret, authfiles, RPCAUTH_info, RPCAUTH_EOF,
@@ -939,7 +936,7 @@ struct dentry *rpc_create_cache_dir(struct dentry *parent, const char *name,
{
struct dentry *dentry;
- dentry = rpc_new_dir(parent, name, umode, NULL);
+ dentry = rpc_new_dir(parent, name, umode);
if (!IS_ERR(dentry)) {
int error = rpc_populate(dentry, cache_pipefs_files, 0, 3, cd);
if (error) {
@@ -1115,11 +1112,11 @@ rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data)
struct dentry *gssd_dentry, *clnt_dentry;
int err;
- gssd_dentry = rpc_new_dir(root, "gssd", 0555, NULL);
+ gssd_dentry = rpc_new_dir(root, "gssd", 0555);
if (IS_ERR(gssd_dentry))
return -ENOENT;
- clnt_dentry = rpc_new_dir(gssd_dentry, "clntXX", 0555, NULL);
+ clnt_dentry = rpc_new_dir(gssd_dentry, "clntXX", 0555);
if (IS_ERR(clnt_dentry))
return -ENOENT;