]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rpc_new_dir(): the last argument is always NULL
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 21 Feb 2024 04:38:36 +0000 (23:38 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 3 Jul 2025 02:44:55 +0000 (22:44 -0400)
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>
net/sunrpc/rpc_pipe.c

index 15ec770bb7fbbf2f9e9da164da19bbc76eef48f6..c14425d2d0d3ed0733559cd252f03a6feb9ce8b7 100644 (file)
@@ -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;