Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rpc_create_client_dir(): don't bother with rpc_populate()

not for a single file...

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

Al Viro 3ee735ef db83fa91

+7 -18
+7 -18
net/sunrpc/rpc_pipe.c
··· 852 852 pdo->pdo_ops->destroy(dir, pdo); 853 853 } 854 854 855 - enum { 856 - RPCAUTH_info, 857 - RPCAUTH_EOF 858 - }; 859 - 860 - static const struct rpc_filelist authfiles[] = { 861 - [RPCAUTH_info] = { 862 - .name = "info", 863 - .i_fop = &rpc_info_operations, 864 - .mode = S_IFREG | 0400, 865 - }, 866 - }; 867 - 868 855 /** 869 856 * rpc_create_client_dir - Create a new rpc_client directory in rpc_pipefs 870 857 * @dentry: the parent of new directory ··· 868 881 struct rpc_clnt *rpc_client) 869 882 { 870 883 struct dentry *ret; 871 - int error; 884 + int err; 872 885 873 886 ret = rpc_new_dir(dentry, name, 0555); 874 887 if (IS_ERR(ret)) 875 888 return ret; 876 - error = rpc_populate(ret, authfiles, RPCAUTH_info, RPCAUTH_EOF, 877 - rpc_client); 878 - if (unlikely(error)) { 889 + err = rpc_new_file(ret, "info", S_IFREG | 0400, 890 + &rpc_info_operations, rpc_client); 891 + if (err) { 892 + pr_warn("%s failed to populate directory %pd\n", 893 + __func__, ret); 879 894 simple_recursive_removal(ret, NULL); 880 - return ERR_PTR(error); 895 + return ERR_PTR(err); 881 896 } 882 897 rpc_client->cl_pipedir_objects.pdh_dentry = ret; 883 898 rpc_create_pipe_dir_objects(&rpc_client->cl_pipedir_objects);