From patchwork Thu Jun 19 14:50:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4384211 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 221AE9F390 for ; Thu, 19 Jun 2014 14:52:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3EBA120395 for ; Thu, 19 Jun 2014 14:52:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C33B20394 for ; Thu, 19 Jun 2014 14:52:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932184AbaFSOwe (ORCPT ); Thu, 19 Jun 2014 10:52:34 -0400 Received: from mail-qc0-f169.google.com ([209.85.216.169]:45955 "EHLO mail-qc0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932213AbaFSOwd (ORCPT ); Thu, 19 Jun 2014 10:52:33 -0400 Received: by mail-qc0-f169.google.com with SMTP id c9so2284513qcz.14 for ; Thu, 19 Jun 2014 07:52:33 -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=6WfCOUBcSEMWJIG+lbf/3ZZvYLBVlD6ibBGBe2etni8=; b=IJ6m/8Gy//ry9HdcCvcz7f2lRmux2/V3QVd+Hw5LsTLEiUZEDZEbmZyPaFjW3nx46u KqE0AIEf4bhaz7H4IwFrsKH+3xu88OFERJdMh05oLKNfiiaUYgVxvLwzmLkA//hP7Pv/ qrxiDEpcNyZr4GSgudE0OIIOoWnXMSqF9QXn7LtHPeH2p1VXAAGLN5IM1cmwI89Mct6d slXxERomgVkam77Aby9DlvvoWKrMkbeuYO4UaoLj+PnvniwwTpBI7WMKRotEcKqtej6N 9pTnsrWY1F/BHW+H2i4PuS3MYPsZI7WsPuQQ57mRBro4PA0q6RTYnMdqTWo6yb4D3cG9 9wyA== X-Gm-Message-State: ALoCoQly0rN9KMvXj5ShIaf7nj1N7J0dLw3BIjPdObKxvI0yCQLjrJCg6bWPzIs+b+nejZDEha+i X-Received: by 10.140.26.196 with SMTP id 62mr7275620qgv.37.1403189553368; Thu, 19 Jun 2014 07:52:33 -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.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jun 2014 07:52:32 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 066/104] NFSd: Convert nfs4_check_open_reclaim() to work with lookup_clientid() Date: Thu, 19 Jun 2014 10:50:12 -0400 Message-Id: <1403189450-18729-67-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 From: Trond Myklebust Signed-off-by: Trond Myklebust --- fs/nfsd/nfs4proc.c | 3 +-- fs/nfsd/nfs4state.c | 13 ++++++++----- fs/nfsd/state.h | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 72e673781e6b..833c753e4775 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -431,8 +431,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, break; case NFS4_OPEN_CLAIM_PREVIOUS: status = nfs4_check_open_reclaim(&open->op_clientid, - cstate->minorversion, - nn); + cstate, nn); if (status) goto out; open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED; diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 7bb7dd19e275..dd436ebf1123 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5446,16 +5446,19 @@ nfsd4_find_reclaim_client(const char *recdir, struct nfsd_net *nn) * Called from OPEN. Look for clientid in reclaim list. */ __be32 -nfs4_check_open_reclaim(clientid_t *clid, bool sessions, struct nfsd_net *nn) +nfs4_check_open_reclaim(clientid_t *clid, + struct nfsd4_compound_state *cstate, + struct nfsd_net *nn) { - struct nfs4_client *clp; + __be32 status; /* find clientid in conf_id_hashtbl */ - clp = find_confirmed_client(clid, sessions, nn); - if (clp == NULL) + status = lookup_clientid(clid, cstate, nn); + if (status) return nfserr_reclaim_bad; - return nfsd4_client_record_check(clp) ? nfserr_reclaim_bad : nfs_ok; + return nfsd4_client_record_check(cstate->clp) ? + nfserr_reclaim_bad : nfs_ok; } #ifdef CONFIG_NFSD_FAULT_INJECTION diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 747ab44b806a..880b5acd05f3 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -440,7 +440,8 @@ void nfs4_remove_reclaim_record(struct nfs4_client_reclaim *, struct nfsd_net *) extern void nfs4_release_reclaim(struct nfsd_net *); extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir, struct nfsd_net *nn); -extern __be32 nfs4_check_open_reclaim(clientid_t *clid, bool sessions, struct nfsd_net *nn); +extern __be32 nfs4_check_open_reclaim(clientid_t *clid, + struct nfsd4_compound_state *cstate, struct nfsd_net *nn); extern int set_callback_cred(void); extern void nfsd4_init_callback(struct nfsd4_callback *); extern void nfsd4_probe_callback(struct nfs4_client *clp);