From patchwork Fri Nov 30 20:03:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10707129 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 2AFA214D6 for ; Fri, 30 Nov 2018 20:04:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E4EB2C041 for ; Fri, 30 Nov 2018 20:04:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12B3330100; Fri, 30 Nov 2018 20:04:09 +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=unavailable 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 AF5842C041 for ; Fri, 30 Nov 2018 20:04:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726773AbeLAHOb (ORCPT ); Sat, 1 Dec 2018 02:14:31 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:39964 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbeLAHOb (ORCPT ); Sat, 1 Dec 2018 02:14:31 -0500 Received: by mail-oi1-f193.google.com with SMTP id t204so5772959oie.7; Fri, 30 Nov 2018 12:04:06 -0800 (PST) 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=QqhAMMIdOepyiUKnkFdrR5tgFJjvwo8ZlYPRjNqTO9k=; b=tFqLWRFTQ6hF5ZIIWn8PRTb2eF3VLspYCJ1hPJ1mcCvjEq7T+yuncCQJRJOhgwaqMO 37296v3UNZejYM5Qzomiq9EYslpVFuqfH7jjcQeAfPjVEUbhkEsfd2odk23zYGz5YBun qy0Z8TgUhh0XS7bc0nVBpWDfm9s0a+1+/pIRuFjOyPBdqBfnbYBbrXYFVsk6Iq2IJbdP rW7KCUbK/psVMf9/LeYiwnBZmXvyBueH6GU2gDgFXHIBbKsI7jE0TUc0PhG8p68zYZvZ YxB5QOKoI6nrqh+a3FlzNcMQH9orPd9YOutsr8TbLrtAgR3avhxsdUCMZjkVauD4rER6 Fxag== 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=QqhAMMIdOepyiUKnkFdrR5tgFJjvwo8ZlYPRjNqTO9k=; b=sRPb1tuH216Hy2BvT8lH5CIycX3giqlMUHcz/4carVVNLQgr8bZipCylxybFoJyIM2 prCBf2rCfDAPVLQMdMGcW/bWOuCyMU+sJmS5uVM844CK//dxrtDlYKv5SlhOfj7CTKTU PRoBzklb5+SjsLh0sTFrJe3jyKMc7qOhdWqQqyMlfDtB8PWwr1Tl5zhE8VVyWkXX0won IXVoWOoYybpcomZ/LvSHprwpHzN/FGPEQnzM0f9PzFIvWzqCDl7mt3SmrQIoqhOod/0r CIHwbTyu9wNrYQ1g1VSJzdqBh9VCjaj58JGsU+LhyNlSG0cJ9sEhRWymVGDYbg1hUjVd x7XQ== X-Gm-Message-State: AA+aEWZl3JzKq1z4thB0gPa14xKdyeCUbMO0Y6p8B2ZPUhNo3TdqiixI C0GowJ0WLJYNSK0I5l7d6YQ= X-Google-Smtp-Source: AFSGD/Wn1z9UUL44CplTn1Cc7CVUcTI5DrqsxVlcdpCmLKk22ndMeHXcBL0N9O0vitT/hu6vCmzbRg== X-Received: by 2002:a54:488b:: with SMTP id r11mr4316968oic.80.1543608246428; Fri, 30 Nov 2018 12:04:06 -0800 (PST) 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 q10sm2065289otl.15.2018.11.30.12.04.04 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 30 Nov 2018 12:04:05 -0800 (PST) From: Olga Kornievskaia To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v2 08/10] NFSD generalize nfsd4_compound_state flag names Date: Fri, 30 Nov 2018 15:03:46 -0500 Message-Id: <20181130200348.59524-9-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20181130200348.59524-1-olga.kornievskaia@gmail.com> References: <20181130200348.59524-1-olga.kornievskaia@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 51fca9e..70d03e9 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 7b3586ab..3f5fb0b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -7423,7 +7423,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)); } @@ -7432,14 +7433,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 bade8e5..9d7318c 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;