From patchwork Sun Dec 1 13:14:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 3262231 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BE98C9F373 for ; Sun, 1 Dec 2013 13:20:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD3CD203AD for ; Sun, 1 Dec 2013 13:20:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1254D20382 for ; Sun, 1 Dec 2013 13:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900Ab3LANUV (ORCPT ); Sun, 1 Dec 2013 08:20:21 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:59542 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751723Ab3LANUV (ORCPT ); Sun, 1 Dec 2013 08:20:21 -0500 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vn6wU-0003gU-Fn; Sun, 01 Dec 2013 13:20:10 +0000 Message-Id: <20131201132010.351939817@bombadil.infradead.org> User-Agent: quilt/0.60-1 Date: Sun, 01 Dec 2013 05:14:45 -0800 From: Christoph Hellwig To: linux-nfs@vger.kernel.org, viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH 04/11] sunrpc: no need to have a lock or superblock for rpc_unlink References: <20131201131441.790963326@bombadil.infradead.org> Content-Disposition: inline; filename=0004-sunrpc-no-need-to-have-a-lock-or-superblock-for-rpc_.patch X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It translates to simple dcache operations that have their own synchronization. Signed-off-by: Christoph Hellwig --- fs/nfs/blocklayout/blocklayout.c | 22 ++-------------------- fs/nfsd/nfs4recover.c | 22 ++-------------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 17088b9..d5950aa 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -1308,13 +1308,6 @@ static struct dentry *nfs4blocklayout_register_sb(struct super_block *sb, return dentry; } -static void nfs4blocklayout_unregister_sb(struct super_block *sb, - struct rpc_pipe *pipe) -{ - if (pipe->dentry) - rpc_unlink(pipe->dentry); -} - static struct dentry *nfs4blocklayout_register_net(struct net *net, struct rpc_pipe *pipe) { @@ -1329,18 +1322,6 @@ static struct dentry *nfs4blocklayout_register_net(struct net *net, return dentry; } -static void nfs4blocklayout_unregister_net(struct net *net, - struct rpc_pipe *pipe) -{ - struct super_block *pipefs_sb; - - pipefs_sb = rpc_get_sb_net(net); - if (pipefs_sb) { - nfs4blocklayout_unregister_sb(pipefs_sb, pipe); - rpc_put_sb_net(net); - } -} - static int nfs4blocklayout_net_init(struct net *net) { struct nfs_net *nn = net_generic(net, nfs_net_id); @@ -1363,7 +1344,8 @@ static void nfs4blocklayout_net_exit(struct net *net) { struct nfs_net *nn = net_generic(net, nfs_net_id); - nfs4blocklayout_unregister_net(net, nn->bl_device_pipe); + if (nn->bl_device_pipe->dentry) + rpc_unlink(nn->bl_device_pipe->dentry); rpc_destroy_pipe_data(nn->bl_device_pipe); nn->bl_device_pipe = NULL; } diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index d9a03e4..f4fe7d6 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -774,13 +774,6 @@ nfsd4_cld_register_sb(struct super_block *sb, struct rpc_pipe *pipe) return dentry; } -static void -nfsd4_cld_unregister_sb(struct rpc_pipe *pipe) -{ - if (pipe->dentry) - rpc_unlink(pipe->dentry); -} - static struct dentry * nfsd4_cld_register_net(struct net *net, struct rpc_pipe *pipe) { @@ -795,18 +788,6 @@ nfsd4_cld_register_net(struct net *net, struct rpc_pipe *pipe) return dentry; } -static void -nfsd4_cld_unregister_net(struct net *net, struct rpc_pipe *pipe) -{ - struct super_block *sb; - - sb = rpc_get_sb_net(net); - if (sb) { - nfsd4_cld_unregister_sb(pipe); - rpc_put_sb_net(net); - } -} - /* Initialize rpc_pipefs pipe for communication with client tracking daemon */ static int nfsd4_init_cld_pipe(struct net *net) @@ -858,7 +839,8 @@ nfsd4_remove_cld_pipe(struct net *net) struct nfsd_net *nn = net_generic(net, nfsd_net_id); struct cld_net *cn = nn->cld_net; - nfsd4_cld_unregister_net(net, cn->cn_pipe); + if (cn->cn_pipe->dentry) + rpc_unlink(cn->cn_pipe->dentry); rpc_destroy_pipe_data(cn->cn_pipe); kfree(nn->cld_net); nn->cld_net = NULL;