From patchwork Thu Jun 19 14:50:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4384331 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 84CBEBEEAA for ; Thu, 19 Jun 2014 14:52:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AFF5C20384 for ; Thu, 19 Jun 2014 14:52:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0CD82038F for ; Thu, 19 Jun 2014 14:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757787AbaFSOwv (ORCPT ); Thu, 19 Jun 2014 10:52:51 -0400 Received: from mail-qg0-f54.google.com ([209.85.192.54]:39132 "EHLO mail-qg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757899AbaFSOwu (ORCPT ); Thu, 19 Jun 2014 10:52:50 -0400 Received: by mail-qg0-f54.google.com with SMTP id q107so2217954qgd.13 for ; Thu, 19 Jun 2014 07:52:49 -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=95bQ+JpOR+MtSvKqHlt4WHClJxZwfolTDNhg/8hlZ0o=; b=eVO9Po9hSyutQKsL02EISFnLyypjV5HPIcRY8GTSliyqdNYvCr6XAV1R7YWl5iE4NS cJccOKswHGDykaCgUjRuuV9L+2KdW8m7mUCxcoT8DAmV2DB8/t3qPj5P3nvPpz/mqegZ kTJKaP0A/uMUhlza9Bhaskhnu/8n+xu/FIw/DtXExSOuWXGZnucLeayb00p32Mm8UVLH GlSw9JUmQcAqJ2wJYZOF/GHPNBYAiP5+fGK9xjL8CvkP1UN8SO5t3S35Zt0CmAFnzRPE w5KoMa5q9RzssQo4YxgrpkwRhv2AWqer7nBdcBW0I2eTtjR0lvgbzVIUBz9w+go1GkqM C8GA== X-Gm-Message-State: ALoCoQmQFk3wUdycnR29kydVbsR+mScsVjsNga+A5AuH+rHmqYHVEHxpd2uUVGDaG9DuTI9r7Jr6 X-Received: by 10.140.102.79 with SMTP id v73mr7645286qge.8.1403189569760; Thu, 19 Jun 2014 07:52:49 -0700 (PDT) Received: from tlielax.poochiereds.net (cpe-107-015-124-230.nc.res.rr.com. [107.15.124.230]) by mx.google.com with ESMTPSA id r60sm3364044qgd.26.2014.06.19.07.52.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jun 2014 07:52:49 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 078/104] nfsd: move unhash_client_locked call into mark_client_expired_locked Date: Thu, 19 Jun 2014 10:50:24 -0400 Message-Id: <1403189450-18729-79-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1403189450-18729-1-git-send-email-jlayton@primarydata.com> References: <1403189450-18729-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 8267531ed455..cfb090b9bb21 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -69,6 +69,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( @@ -139,7 +140,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; } @@ -2323,7 +2324,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; @@ -2869,7 +2869,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; @@ -4008,7 +4007,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);