From patchwork Fri Oct 19 15:29:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10649651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B0CC13A4 for ; Fri, 19 Oct 2018 15:29:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7994527F91 for ; Fri, 19 Oct 2018 15:29:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64A6D27F98; Fri, 19 Oct 2018 15:29:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0B1427F91 for ; Fri, 19 Oct 2018 15:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727081AbeJSXf7 (ORCPT ); Fri, 19 Oct 2018 19:35:59 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:38032 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727050AbeJSXf7 (ORCPT ); Fri, 19 Oct 2018 19:35:59 -0400 Received: by mail-qk1-f195.google.com with SMTP id p3-v6so858822qkb.5 for ; Fri, 19 Oct 2018 08:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CCb67kIsyZRRvEcQdWDG9DSN55lGTaaO+OuYFSY9mlY=; b=aVxD69b2/X8kcRahWtBFZ8NYXFy0p7Zk0U4KliLqoN3wGFBBsMIM+H1h4TnE5NZEZk aF/HlAANUVBwZqs3RF9mooFKq0amB/pWEo+ZhQp4CqCBMt450MZ2smikOl44jiGepOTK 5H1sRB8GncigHE4h0MnyX25aXhy+oShINjNy0D4A4Ve6u1WBkJhFXKlr/wgi/LfruRYo ZAkb7qyv6gfnb3gaYV661HOzTat9yhKawPxC05EvoCGkOupF950dA46LWmfBoipprwEI QbONR+pXj7QZeg7SlQweErP+JbbNnSRuB1KKbhoPjt6rMBkfSuKxelatw1BmaHDACMCH yKwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CCb67kIsyZRRvEcQdWDG9DSN55lGTaaO+OuYFSY9mlY=; b=Jdmft692mQyOud8i/3MY2tUlKnov9qZNeP0tqU1wkyTmyA9607p/m2nDwuXQ5XUyPg b5pDKRykohwNm6WcyP1FV0Na78/cPCKFnKhBHmLpArewOAtZLuUWHy8dwFXTtF+vwVDo lOZ19ngdSPa7vsLBhw9N8nwfBH2ak7hksNC12qOROBQNDB9eSvhFrvps9m8Btv9BV9Qr EcwNjAuxfNt/z/8PMqVsupP6lYC8hExS2vG8bXQX/jPmgGhdQJ58zXYOiB8wA+UMPM9r 1h0a41KegrCVgw/vD5Ah0sQ6r5/ZFpg/Li10uM676WqhyxOLZsWMu84m9QyzQQRgOmgR mztg== X-Gm-Message-State: AGRZ1gK+5uaQRa/lALc1qCn+o1fLo0UbMjloKhqxnsautk4s23gFqjog VM9189WZKipH+zPnaEuedUCORyYX X-Google-Smtp-Source: AJdET5eaTOkc+EV6AaIKJU7AFR5qlMrQieHLq8J9zkX6OYBVjMqlSHSPJcBhtu83GfL3TNEpxSmbfQ== X-Received: by 2002:ae9:f211:: with SMTP id m17-v6mr1036468qkg.215.1539962964083; Fri, 19 Oct 2018 08:29:24 -0700 (PDT) Received: from Olgas-MBP-195.attlocal.net (172-10-226-31.lightspeed.livnmi.sbcglobal.net. [172.10.226.31]) by smtp.gmail.com with ESMTPSA id s17-v6sm18126231qtj.31.2018.10.19.08.29.22 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 19 Oct 2018 08:29:23 -0700 (PDT) From: Olga Kornievskaia To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 11/13] NFSD generalize nfsd4_compound_state flag names Date: Fri, 19 Oct 2018 11:29:03 -0400 Message-Id: <20181019152905.32418-12-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20181019152905.32418-1-olga.kornievskaia@gmail.com> References: <20181019152905.32418-1-olga.kornievskaia@gmail.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Olga Kornievskaia Allow for sid_flag field non-stateid use. Signed-off-by: Andy Adamson --- fs/nfsd/nfs4proc.c | 8 ++++---- fs/nfsd/nfs4state.c | 7 ++++--- fs/nfsd/xdr4.h | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 999c8cb..43a83c7 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -530,9 +530,9 @@ static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_stat return nfserr_restorefh; fh_dup2(&cstate->current_fh, &cstate->save_fh); - if (HAS_STATE_ID(cstate, SAVED_STATE_ID_FLAG)) { + if (HAS_CSTATE_FLAG(cstate, SAVED_STATE_ID_FLAG)) { memcpy(&cstate->current_stateid, &cstate->save_stateid, sizeof(stateid_t)); - SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); + SET_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG); } return nfs_ok; } @@ -542,9 +542,9 @@ static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_stat union nfsd4_op_u *u) { fh_dup2(&cstate->save_fh, &cstate->current_fh); - if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) { + if (HAS_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG)) { memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); - SET_STATE_ID(cstate, SAVED_STATE_ID_FLAG); + SET_CSTATE_FLAG(cstate, SAVED_STATE_ID_FLAG); } return nfs_ok; } diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 16359de..a39a581 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -7424,7 +7424,8 @@ static int nfs4_state_create_net(struct net *net) static void get_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid) { - if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG) && CURRENT_STATEID(stateid)) + if (HAS_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG) && + CURRENT_STATEID(stateid)) memcpy(stateid, &cstate->current_stateid, sizeof(stateid_t)); } @@ -7433,14 +7434,14 @@ static int nfs4_state_create_net(struct net *net) { if (cstate->minorversion) { memcpy(&cstate->current_stateid, stateid, sizeof(stateid_t)); - SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); + SET_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG); } } void clear_current_stateid(struct nfsd4_compound_state *cstate) { - CLEAR_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); + CLEAR_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG); } /* diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 4557f15..4a1e53d 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -46,9 +46,9 @@ #define CURRENT_STATE_ID_FLAG (1<<0) #define SAVED_STATE_ID_FLAG (1<<1) -#define SET_STATE_ID(c, f) ((c)->sid_flags |= (f)) -#define HAS_STATE_ID(c, f) ((c)->sid_flags & (f)) -#define CLEAR_STATE_ID(c, f) ((c)->sid_flags &= ~(f)) +#define SET_CSTATE_FLAG(c, f) ((c)->sid_flags |= (f)) +#define HAS_CSTATE_FLAG(c, f) ((c)->sid_flags & (f)) +#define CLEAR_CSTATE_FLAG(c, f) ((c)->sid_flags &= ~(f)) struct nfsd4_compound_state { struct svc_fh current_fh;