Skip to content

Commit db83fa9

Browse files
author
Al Viro
committed
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>
1 parent 805060a commit db83fa9

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

net/sunrpc/rpc_pipe.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,7 @@ static int rpc_new_file(struct dentry *parent,
552552

553553
static struct dentry *rpc_new_dir(struct dentry *parent,
554554
const char *name,
555-
umode_t mode,
556-
void *private)
555+
umode_t mode)
557556
{
558557
struct dentry *dentry = simple_start_creating(parent, name);
559558
struct inode *dir = parent->d_inode;
@@ -570,7 +569,6 @@ static struct dentry *rpc_new_dir(struct dentry *parent,
570569
}
571570

572571
inode->i_ino = iunique(dir->i_sb, 100);
573-
rpc_inode_setowner(inode, private);
574572
inc_nlink(dir);
575573
d_instantiate(dentry, inode);
576574
fsnotify_mkdir(dir, dentry);
@@ -603,8 +601,7 @@ static int rpc_populate(struct dentry *parent,
603601
case S_IFDIR:
604602
dentry = rpc_new_dir(parent,
605603
files[i].name,
606-
files[i].mode,
607-
private);
604+
files[i].mode);
608605
if (IS_ERR(dentry)) {
609606
err = PTR_ERR(dentry);
610607
goto out_bad;
@@ -886,7 +883,7 @@ struct dentry *rpc_create_client_dir(struct dentry *dentry,
886883
struct dentry *ret;
887884
int error;
888885

889-
ret = rpc_new_dir(dentry, name, 0555, NULL);
886+
ret = rpc_new_dir(dentry, name, 0555);
890887
if (IS_ERR(ret))
891888
return ret;
892889
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,
939936
{
940937
struct dentry *dentry;
941938

942-
dentry = rpc_new_dir(parent, name, umode, NULL);
939+
dentry = rpc_new_dir(parent, name, umode);
943940
if (!IS_ERR(dentry)) {
944941
int error = rpc_populate(dentry, cache_pipefs_files, 0, 3, cd);
945942
if (error) {
@@ -1115,11 +1112,11 @@ rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data)
11151112
struct dentry *gssd_dentry, *clnt_dentry;
11161113
int err;
11171114

1118-
gssd_dentry = rpc_new_dir(root, "gssd", 0555, NULL);
1115+
gssd_dentry = rpc_new_dir(root, "gssd", 0555);
11191116
if (IS_ERR(gssd_dentry))
11201117
return -ENOENT;
11211118

1122-
clnt_dentry = rpc_new_dir(gssd_dentry, "clntXX", 0555, NULL);
1119+
clnt_dentry = rpc_new_dir(gssd_dentry, "clntXX", 0555);
11231120
if (IS_ERR(clnt_dentry))
11241121
return -ENOENT;
11251122

0 commit comments

Comments
 (0)