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_{rmdir_,}depopulate(): use simple_recursive_removal() instead

no need to give an exact list of objects to be remove when it's
simply every child of the victim directory.

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

+3 -41
+3 -41
net/sunrpc/rpc_pipe.c
··· 678 678 } 679 679 } 680 680 681 - static void rpc_depopulate(struct dentry *parent, 682 - const struct rpc_filelist *files, 683 - int start, int eof) 684 - { 685 - struct inode *dir = d_inode(parent); 686 - 687 - inode_lock_nested(dir, I_MUTEX_CHILD); 688 - __rpc_depopulate(parent, files, start, eof); 689 - inode_unlock(dir); 690 - } 691 - 692 681 static int rpc_populate(struct dentry *parent, 693 682 const struct rpc_filelist *files, 694 683 int start, int eof, ··· 749 760 out_err: 750 761 dentry = ERR_PTR(error); 751 762 goto out; 752 - } 753 - 754 - static int rpc_rmdir_depopulate(struct dentry *dentry, 755 - void (*depopulate)(struct dentry *)) 756 - { 757 - struct dentry *parent; 758 - struct inode *dir; 759 - int error; 760 - 761 - parent = dget_parent(dentry); 762 - dir = d_inode(parent); 763 - inode_lock_nested(dir, I_MUTEX_PARENT); 764 - if (depopulate != NULL) 765 - depopulate(dentry); 766 - error = __rpc_rmdir(dir, dentry); 767 - inode_unlock(dir); 768 - dput(parent); 769 - return error; 770 763 } 771 764 772 765 /** ··· 1001 1030 private); 1002 1031 } 1003 1032 1004 - static void rpc_clntdir_depopulate(struct dentry *dentry) 1005 - { 1006 - rpc_depopulate(dentry, authfiles, RPCAUTH_info, RPCAUTH_EOF); 1007 - } 1008 - 1009 1033 /** 1010 1034 * rpc_create_client_dir - Create a new rpc_client directory in rpc_pipefs 1011 1035 * @dentry: the parent of new directory ··· 1039 1073 return 0; 1040 1074 rpc_destroy_pipe_dir_objects(&rpc_client->cl_pipedir_objects); 1041 1075 rpc_client->cl_pipedir_objects.pdh_dentry = NULL; 1042 - return rpc_rmdir_depopulate(dentry, rpc_clntdir_depopulate); 1076 + simple_recursive_removal(dentry, NULL); 1077 + return 0; 1043 1078 } 1044 1079 1045 1080 static const struct rpc_filelist cache_pipefs_files[3] = { ··· 1068 1101 private); 1069 1102 } 1070 1103 1071 - static void rpc_cachedir_depopulate(struct dentry *dentry) 1072 - { 1073 - rpc_depopulate(dentry, cache_pipefs_files, 0, 3); 1074 - } 1075 - 1076 1104 struct dentry *rpc_create_cache_dir(struct dentry *parent, const char *name, 1077 1105 umode_t umode, struct cache_detail *cd) 1078 1106 { ··· 1077 1115 1078 1116 void rpc_remove_cache_dir(struct dentry *dentry) 1079 1117 { 1080 - rpc_rmdir_depopulate(dentry, rpc_cachedir_depopulate); 1118 + simple_recursive_removal(dentry, NULL); 1081 1119 } 1082 1120 1083 1121 /*