From patchwork Wed Jul 30 01:34:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4644421 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 59581C0338 for ; Wed, 30 Jul 2014 01:36:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E2112012B for ; Wed, 30 Jul 2014 01:36:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8D202012D for ; Wed, 30 Jul 2014 01:36:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753918AbaG3Bgo (ORCPT ); Tue, 29 Jul 2014 21:36:44 -0400 Received: from mail-qg0-f48.google.com ([209.85.192.48]:53430 "EHLO mail-qg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754706AbaG3BfN (ORCPT ); Tue, 29 Jul 2014 21:35:13 -0400 Received: by mail-qg0-f48.google.com with SMTP id i50so638480qgf.21 for ; Tue, 29 Jul 2014 18:35:12 -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=CRVxf7u+ai+qUxFBmCuiJAeROeiIXGd9D4SajQlG9Iw=; b=XLrRID6qSAw5HHhvpbMaebbyHN+z9WX/60c5xxOxoR4yUissiRcU39UiCLXPrvhC1o 8z37Xnj0CzlIjOsu/geQyVERybcTqzXdHyyfckZ0YJyvO97MTSUOdibPnENhwNGob9eU SW/Z6b7rZiBkNdLFjoK0MPTRelrCWv1Cxf12AeNNIcYcGNTyIV6WjyfgMTCWcD0bO0l2 +sMbYC5fACC5ADNQ3WFZzAv/ntYY72i4YKgaysUiOAo9+nV1luIaFQf6XK73pXXWCGVt Rr6vQ9EQpLYO4+eY/v+yXIHGr6C+z1sgmmoQnAcPHMfRIeaN7I3qyEHI4AyXtWvcp660 m2tw== X-Gm-Message-State: ALoCoQkMCxKmXxAW+6gbEsZN4qlAzRkcRsdAXnDCUR58a1CMxCe520puiPkt30jJ/g1T2YM0yo6a X-Received: by 10.140.80.2 with SMTP id b2mr1016990qgd.75.1406684112393; Tue, 29 Jul 2014 18:35:12 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id 81sm860946qgw.21.2014.07.29.18.35.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jul 2014 18:35:11 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, hch@infradead.org, Trond Myklebust Subject: [PATCH v3 15/38] nfsd: Prepare nfsd4_close() for open stateid referencing Date: Tue, 29 Jul 2014 21:34:20 -0400 Message-Id: <1406684083-19736-16-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1406684083-19736-1-git-send-email-jlayton@primarydata.com> References: <1406684083-19736-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=-7.6 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 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 f3018cb26769..4e50f14f5bc1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4579,10 +4579,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 */ + nfs4_put_stid(&stp->st_stid); out: if (!cstate->replay_owner) nfs4_unlock_state();