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_unlink(): use simple_recursive_removal()

note that the callback of simple_recursive_removal() is called with
the parent locked; the victim isn't locked by the caller.

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

+4 -20
+4 -20
net/sunrpc/rpc_pipe.c
··· 168 168 } 169 169 170 170 static void 171 - rpc_close_pipes(struct inode *inode) 171 + rpc_close_pipes(struct dentry *dentry) 172 172 { 173 + struct inode *inode = dentry->d_inode; 173 174 struct rpc_pipe *pipe = RPC_I(inode)->pipe; 174 175 int need_release; 175 176 LIST_HEAD(free_list); ··· 620 619 return ret; 621 620 } 622 621 623 - static int __rpc_rmpipe(struct inode *dir, struct dentry *dentry) 624 - { 625 - struct inode *inode = d_inode(dentry); 626 - 627 - rpc_close_pipes(inode); 628 - return __rpc_unlink(dir, dentry); 629 - } 630 - 631 622 static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent, 632 623 const char *name) 633 624 { ··· 807 814 int 808 815 rpc_unlink(struct dentry *dentry) 809 816 { 810 - struct dentry *parent; 811 - struct inode *dir; 812 - int error = 0; 813 - 814 - parent = dget_parent(dentry); 815 - dir = d_inode(parent); 816 - inode_lock_nested(dir, I_MUTEX_PARENT); 817 - error = __rpc_rmpipe(dir, dentry); 818 - inode_unlock(dir); 819 - dput(parent); 820 - return error; 817 + simple_recursive_removal(dentry, rpc_close_pipes); 818 + return 0; 821 819 } 822 820 EXPORT_SYMBOL_GPL(rpc_unlink); 823 821