From patchwork Mon Nov 26 12:22:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislav Kinsbursky X-Patchwork-Id: 1802041 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DEBE33FC54 for ; Mon, 26 Nov 2012 12:20:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755336Ab2KZMT6 (ORCPT ); Mon, 26 Nov 2012 07:19:58 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:24897 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755166Ab2KZMT4 (ORCPT ); Mon, 26 Nov 2012 07:19:56 -0500 Received: from localhost.localdomain ([10.30.21.131]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id qAQCJjPa030783; Mon, 26 Nov 2012 16:19:45 +0400 (MSK) Subject: [PATCH 3/5] nfsd: cleanup NFSd state shutdown a bit To: bfields@fieldses.org From: Stanislav Kinsbursky Cc: linux-nfs@vger.kernel.org, Trond.Myklebust@netapp.com, linux-kernel@vger.kernel.org, devel@openvz.org Date: Mon, 26 Nov 2012 15:22:08 +0300 Message-ID: <20121126122208.955.49674.stgit@localhost.localdomain> In-Reply-To: <20121126121907.955.25349.stgit@localhost.localdomain> References: <20121126121907.955.25349.stgit@localhost.localdomain> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This patch renames __nfs4_state_shutdown_net() into nfs4_state_shutdown_net(), __nfs4_state_shutdown() into nfs4_state_shutdown_net() and moves all network related shutdown operations to nfs4_state_shutdown_net(). Signed-off-by: Stanislav Kinsbursky --- fs/nfsd/nfs4state.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 149f7b1..edff2cc 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4825,7 +4825,7 @@ err: } static void -__nfs4_state_shutdown_net(struct net *net) +nfs4_state_destroy_net(struct net *net) { int i; struct nfs4_client *clp = NULL; @@ -4853,6 +4853,7 @@ __nfs4_state_shutdown_net(struct net *net) kfree(nn->ownerstr_hashtbl); kfree(nn->unconf_id_hashtbl); kfree(nn->conf_id_hashtbl); + put_net(net); } /* initialization to perform when the nfsd service is started: */ @@ -4902,19 +4903,20 @@ out_free_laundry: destroy_workqueue(laundry_wq); out_recovery: nfsd4_client_tracking_exit(net); - __nfs4_state_shutdown_net(net); - put_net(net); + nfs4_state_destroy_net(net); return ret; } /* should be called with the state lock held */ static void -__nfs4_state_shutdown(struct net *net) +nfs4_state_shutdown_net(struct net *net) { struct nfs4_delegation *dp = NULL; struct list_head *pos, *next, reaplist; + struct nfsd_net *nn = net_generic(net, nfsd_net_id); - __nfs4_state_shutdown_net(net); + cancel_delayed_work_sync(&nn->laundromat_work); + locks_end_grace(&nn->nfsd4_manager); INIT_LIST_HEAD(&reaplist); spin_lock(&recall_lock); @@ -4931,19 +4933,16 @@ __nfs4_state_shutdown(struct net *net) } nfsd4_client_tracking_exit(net); - put_net(net); + nfs4_state_destroy_net(net); } void nfs4_state_shutdown(void) { struct net *net = &init_net; - struct nfsd_net *nn = net_generic(net, nfsd_net_id); - cancel_delayed_work_sync(&nn->laundromat_work); + nfs4_state_shutdown_net(net); destroy_workqueue(laundry_wq); - locks_end_grace(&nn->nfsd4_manager); - __nfs4_state_shutdown(net); nfsd4_destroy_callback_queue(); }