From patchwork Thu Jun 26 19:20:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4431411 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 D29639F2C8 for ; Thu, 26 Jun 2014 19:22:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04E0320251 for ; Thu, 26 Jun 2014 19:22:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27F6220154 for ; Thu, 26 Jun 2014 19:22:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751964AbaFZTWa (ORCPT ); Thu, 26 Jun 2014 15:22:30 -0400 Received: from mail-qa0-f43.google.com ([209.85.216.43]:56417 "EHLO mail-qa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbaFZTVl (ORCPT ); Thu, 26 Jun 2014 15:21:41 -0400 Received: by mail-qa0-f43.google.com with SMTP id k15so3186734qaq.16 for ; Thu, 26 Jun 2014 12:21:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=B6Ws6vWZ9FouOu4mMkcjOF88T0bwAdQqkhjYwgziQLY=; b=GvOSMitgCQ3iwX2iXAAfuQe8zuEkApl5ohOf/IgYTqCIfuC6KX076xW0Q1xBJh5nlU 29YqSiQemtu1mDiG0d2Ksj3Nowduols3NtgmPc16z8xJoCyt3DR5xofz2dVOqRAOezpE JbPeYwv7bNVgv7t9RRp0VL+EN71KDTObIaqfv2pFo8LnTfrXjsRzrFs72vOVTHt7+x7W SltdLC9WuPVP6pEt2BIfpEB8l7b+DVUpjufwQkSbOhNqJk1x1mWtG6MA/T5h7BQhq+QD P8NKoemmk54b5sKjqkNCbQ6OA7jvuPOEeJxLOy74iD4JVahcw+vV3s/wR7XYd9j0MiJI 8Pyw== X-Gm-Message-State: ALoCoQk/j3aLLMiCipNwcVLipZHpJGiDnfvTSp17NZK6prJHDc4pp6gWdMn3BVSfgIndIw1/PS7L X-Received: by 10.224.20.10 with SMTP id d10mr25624074qab.16.1403810500608; Thu, 26 Jun 2014 12:21:40 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id k76sm4765555qgd.38.2014.06.26.12.21.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jun 2014 12:21:39 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 091/117] nfsd: move unhash_client_locked call into mark_client_expired_locked Date: Thu, 26 Jun 2014 15:20:59 -0400 Message-Id: <1403810485-16497-8-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1403810017-16062-1-git-send-email-jlayton@primarydata.com> References: <1403810017-16062-1-git-send-email-jlayton@primarydata.com> 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, T_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 All the callers except for the fault injection code call it directly afterward, and in the fault injection case it won't hurt to do so anyway. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index e9daa2649275..3bd24d5b973e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -70,6 +70,7 @@ static u64 current_sessionid = 1; #define CURRENT_STATEID(stateid) (!memcmp((stateid), ¤tstateid, sizeof(stateid_t))) /* forward declarations */ +static void unhash_client_locked(struct nfs4_client *clp); static int check_for_locks(struct nfs4_file *filp, struct nfs4_lockowner *lowner); static void nfs4_free_generic_stateid(struct nfs4_stid *stid); static struct nfs4_openowner *find_openstateowner_str_locked( @@ -140,7 +141,7 @@ static __be32 mark_client_expired_locked(struct nfs4_client *clp) { if (atomic_read(&clp->cl_refcount)) return nfserr_jukebox; - clp->cl_time = 0; + unhash_client_locked(clp); return nfs_ok; } @@ -2448,7 +2449,6 @@ nfsd4_create_session(struct svc_rqst *rqstp, status = mark_client_expired_locked(old); if (status) goto out_free_conn; - unhash_client_locked(old); } move_to_confirmed(unconf); conf = unconf; @@ -2994,7 +2994,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, status = mark_client_expired_locked(old); if (status) goto out; - unhash_client_locked(old); } move_to_confirmed(unconf); conf = unconf; @@ -4144,7 +4143,6 @@ nfs4_laundromat(struct nfsd_net *nn) clp->cl_clientid.cl_id); continue; } - unhash_client_locked(clp); list_add(&clp->cl_lru, &reaplist); } spin_unlock(&nn->client_lock);