From patchwork Thu Jun 26 19:12:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4430461 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 C019E9F402 for ; Thu, 26 Jun 2014 19:14:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCCA52028D for ; Thu, 26 Jun 2014 19:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D1BB52024D for ; Thu, 26 Jun 2014 19:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751770AbaFZTOf (ORCPT ); Thu, 26 Jun 2014 15:14:35 -0400 Received: from mail-qa0-f52.google.com ([209.85.216.52]:46947 "EHLO mail-qa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751764AbaFZTOd (ORCPT ); Thu, 26 Jun 2014 15:14:33 -0400 Received: by mail-qa0-f52.google.com with SMTP id w8so3139567qac.25 for ; Thu, 26 Jun 2014 12:14:32 -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=EY0kMlxKQyxzAdYstkGjAssB4W3z5/izgyfri6vIfDQ=; b=TR2LUY8vhNvtkHtxC9KN7qSbN2C1PmoKaEGvlUBDa+P+34gJm1vOlbJESSm8bhm611 yZGhseza4z9TxrdsB/4bbu36hhSdqBeZvY8SWhSpdCWOfxty7RE9INOf3ECBB2ENlrU/ UT8cqMF7dGZh2AHluBmskm3u8Hj4+rPpP22sarHUHer3x+98VhmycW8Za2AZimmAYaAi tdgLAbnkZL5hllHZ8GJZDbw2tXOCueJriHMCJiostLuIa1enI22JA7CtnA3yJgYAhKIz loTjw7MWTVmMYqxVpoBQp+Hh1Te49VZKB0ACLYcdqNBzEyrM4PEAY9NDf3Q6R3ERWXgc eXpg== X-Gm-Message-State: ALoCoQmOHREKh36pCxXswuNoUH3AyKCUhbskat27m2QEsl7WZhv9TT5niGJZLS99BVUC30AWtUno X-Received: by 10.140.27.108 with SMTP id 99mr371283qgw.77.1403810072626; Thu, 26 Jun 2014 12:14:32 -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.14.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jun 2014 12:14:31 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 034/117] nfsd: cleanup nfs4_check_open Date: Thu, 26 Jun 2014 15:12:14 -0400 Message-Id: <1403810017-16062-35-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 Rename it to better describe what it does, and have it just return the stateid instead of a __be32 (which is now always nfs_ok). Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 93d175661c8d..e75cb6da1e64 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3269,10 +3269,10 @@ out: return nfs_ok; } -static __be32 -nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_ol_stateid **stpp) +static struct nfs4_ol_stateid * +nfsd4_find_existing_open(struct nfs4_file *fp, struct nfsd4_open *open) { - struct nfs4_ol_stateid *local; + struct nfs4_ol_stateid *local, *ret = NULL; struct nfs4_openowner *oo = open->op_openowner; lockdep_assert_held(&fp->fi_lock); @@ -3283,11 +3283,11 @@ nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_ol_st continue; /* remember if we have seen this open owner */ if (local->st_stateowner == &oo->oo_owner) { - *stpp = local; + ret = local; break; } } - return nfs_ok; + return ret; } static inline int nfs4_access_to_access(u32 nfs4_access) @@ -3623,7 +3623,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf spin_lock(&fp->fi_lock); status = nfs4_file_check_deny(fp, 0, open->op_share_deny); if (status == nfs_ok) - status = nfs4_check_open(fp, open, &stp); + stp = nfsd4_find_existing_open(fp, open); spin_unlock(&fp->fi_lock); if (status) goto out;