From patchwork Thu Jun 26 19:12:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4430701 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 D13389F402 for ; Thu, 26 Jun 2014 19:15:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B42012024D for ; Thu, 26 Jun 2014 19:15:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF8942028D for ; Thu, 26 Jun 2014 19:15:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751823AbaFZTPG (ORCPT ); Thu, 26 Jun 2014 15:15:06 -0400 Received: from mail-qg0-f41.google.com ([209.85.192.41]:33158 "EHLO mail-qg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751511AbaFZTPE (ORCPT ); Thu, 26 Jun 2014 15:15:04 -0400 Received: by mail-qg0-f41.google.com with SMTP id i50so3525644qgf.0 for ; Thu, 26 Jun 2014 12:15:03 -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=1KtMjfpwwaIWz/btOzR1qtWuZeGSEi3qVUHO802Q7MY=; b=KbWfF3FSfroDQbxMdGE/iqJSn44Ihj5Oy8ARxnQ7eMDhfQbTjVUj4DpOh508g23EGO 93fvWmFZ2+aUIX6CKsXBwH9OQRsA3NG8FAX/KBhdYwMZgzkkdvUU8fg55TawhgsdDnig 31b/wvZXNiZy4o5y741Gp+A4UGfTSkWOjZq3bC5D/4+vBVTSu2weC9RDbEU2va2s8/k8 CoXBE9cMaKHhaAypt/oeJXDNQ6ayUS32oEcFsQyXbRImIRE6pvSOAhEjwR/GFUcm+pMR dcsjOng/nytv2VoGUPUT1BHukUpcNSOGc/Y0xitWEHbYUk54code3Qfi211d+kamlbBO OykA== X-Gm-Message-State: ALoCoQm//Y1uvE/+s9jJW1CLoAhnXZNb1OOgOAdIiZEA12+S9XbPrxXC7sGJYZF8iZi4reW6OwWa X-Received: by 10.140.22.42 with SMTP id 39mr24363331qgm.63.1403810103406; Thu, 26 Jun 2014 12:15:03 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id 88sm4763039qgh.5.2014.06.26.12.15.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jun 2014 12:15:02 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, Trond Myklebust Subject: [PATCH v2 057/117] nfsd: Prepare nfsd4_close() for open stateid referencing Date: Thu, 26 Jun 2014 15:12:37 -0400 Message-Id: <1403810017-16062-58-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 From: Trond Myklebust Prepare nfsd4_close for a future where nfs4_preprocess_seqid_op() hands it a fully referenced open stateid. Necessary step toward client_mutex removal. Signed-off-by: Trond Myklebust --- fs/nfsd/nfs4state.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index bb0676051b6b..828205fabd3e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4556,10 +4556,15 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, nfsd4_bump_seqid(cstate, status); if (status) goto out; + /* FIXME: move into nfs4_preprocess_seqid_op */ + atomic_inc(&stp->st_stid.sc_count); update_stateid(&stp->st_stid.sc_stateid); memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); nfsd4_close_open_stateid(stp); + + /* put reference from nfs4_preprocess_seqid_op */ + put_generic_stateid(stp); out: nfs4_unlock_state(); return status;