Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1880737rdb; Sun, 19 Nov 2023 14:46:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IE56h/DTQvw5VhvXlspcYLVecDQ0a8kCzVnJJr6iLo2L65KMRbfN4yuL68Zkvci0A8GADWA X-Received: by 2002:a05:6a20:3c9e:b0:187:f706:7cca with SMTP id b30-20020a056a203c9e00b00187f7067ccamr7872427pzj.16.1700433963655; Sun, 19 Nov 2023 14:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700433963; cv=none; d=google.com; s=arc-20160816; b=OGVfNKHsj1L474PJj1DhdlTiPft+hCKkUpSzdQaMVSr7whcZedXVHCPIlbj6dZS9V0 JX2UhiC642kbRlRDsP16VKczWdQ0SJXF0kpNJdZmKvaASB19adfEngexdDpfm4uJ/dQk VMj4LWMPY5DfCR+5YNPvxNVXnevnmmW0h0Fh2DgkWpOQaysFxRrMWbmw+e/DkCAKRpVg 5wgabisVZ3/clog2u+avuGzYs1AjcXn+N3yG0vLsV9XwV3NnLo61sTVtBPeV7BDNZ35u CEsDCitDC/3ixnT+jHI0iywVJom2Gckd9XByErnQKuaILwgbVLI8/WEi/xHpHUH7YY1S 1cgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=71kfZrbImrhOUXNEGJs/dh09RJf3EuELs7HIwgSQGx8=; fh=3cVUqrBlCYKHDH/sVHASgoDP1h1US1q68V5dOsonqkA=; b=EiaOfPu0xkOCzHq9abf0u0jfsLNGuSaCHPAjnB5mtuEx5lvDNh3O1mUqzeb6cLBueI BhFEt2RSSfZrv9cTnbTG2+fmjuvUQ/cAzfn9HNHte9c003Fzh0VJsdmYpT8edBMNJ1w8 px3RSv3vpaPvVJbVn8/vJoYbTItt/6jfMRYJyX48MrTe27unSWemU327+rrQqi8QbMh9 Mg/TYU0UIO8cM1DPimURUNamgT9k2CAlKd5PEIlHykX71qtO5uEUPc2u7Aij8ns2CVCd 0NHX1nTVGNw/kYLDmB56N35R1+i0zH0ZEpvUS4ZTLzFP1pv33Gheo63s1jxKJWwO3hJr LYVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Msy6fKvM; dkim=neutral (no key) header.i=@suse.de header.b=Ss+sMch9; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id i18-20020a17090332d200b001bf5c12ea06si7505612plr.404.2023.11.19.14.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 14:46:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Msy6fKvM; dkim=neutral (no key) header.i=@suse.de header.b=Ss+sMch9; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 205F18089E73; Sun, 19 Nov 2023 14:46:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231542AbjKSWf0 (ORCPT + 99 others); Sun, 19 Nov 2023 17:35:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231474AbjKSWfZ (ORCPT ); Sun, 19 Nov 2023 17:35:25 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2125412D for ; Sun, 19 Nov 2023 14:35:22 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BEB271F381; Sun, 19 Nov 2023 22:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1700433320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=71kfZrbImrhOUXNEGJs/dh09RJf3EuELs7HIwgSQGx8=; b=Msy6fKvMBWaqvNaJGhuzAnIa6EZb3Pu3vnms6FBoKo3QKZFzgZoD8ZmN5aQN7nfNSU6DbP 2hYA1VKT2MNO5H8vu6d2vyFHVdCUaAVIfYtVu2VAboxvao8hjTbBdVoS3DHceLWVKPnbpr 9eD/lhx45msRhRsNJu+FJhLt72cH6n8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1700433320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=71kfZrbImrhOUXNEGJs/dh09RJf3EuELs7HIwgSQGx8=; b=Ss+sMch9zYwm6zrTAgn5qFKo08Q+bDq9blYn2JuypvBFxrTqz0tGaLz5wMVuki8gNcwgJ4 weFnlOeudRuXaOCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 952F8139B7; Sun, 19 Nov 2023 22:35:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id D3MeEqaNWmVAXwAAMHmgww (envelope-from ); Sun, 19 Nov 2023 22:35:18 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever" Cc: "Jeff Layton" , linux-nfs@vger.kernel.org, "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" Subject: Re: [PATCH 3/9] nfsd: split sc_status out of sc_type In-reply-to: References: <20231117022121.23310-1-neilb@suse.de>, <20231117022121.23310-4-neilb@suse.de>, Date: Mon, 20 Nov 2023 09:35:15 +1100 Message-id: <170043331552.19300.14124734701560396770@noble.neil.brown.name> Authentication-Results: smtp-out2.suse.de; none X-Spam-Score: 6.39 X-Spamd-Result: default: False [6.39 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(3.00)[0.999]; MIME_GOOD(-0.10)[text/plain]; CLAM_VIRUS_FAIL(0.00)[failed to scan and retransmits exceed]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_SPAM_LONG(3.50)[1.000]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[44.47%] X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 19 Nov 2023 14:46:01 -0800 (PST) On Sat, 18 Nov 2023, Chuck Lever wrote: > On Fri, Nov 17, 2023 at 01:18:49PM +1100, NeilBrown wrote: > > sc_type identifies the type of a state - open, lock, deleg, layout - and > > also the status of a state - closed or revoked. > >=20 > > This is a bit untidy and could get worse when "admin-revoked" states are > > added. So clean it up. > >=20 > > With this patch, the type is now all that is stored in sc_type. This is > > zero when the state is first added to ->cl_stateids (causing it to be > > ignored), and is then set appropriately once it is fully initialised. > > It is set under ->cl_lock to ensure atomicity w.r.t lookup. It is now > > never cleared. > >=20 > > sc_type is still a bit-set even though at most one bit is set. This allo= ws > > lookup functions to be given a bitmap of acceptable types. > >=20 > > cl_type is now an unsigned short rather than char. There is no value in >=20 > s/cl_type/sc_type >=20 >=20 > > restricting to just 8 bits. When passed to a function or stored in local > > variable, "unsigned int" is used. >=20 > This seems confusing, and I'd prefer not to introduce implicit type > conversions where they aren't truly necessary. Why not use "unsigned > short" or even "unsigned int" everywhere? >=20 Not really a type conversion - just a size change. Maybe I could use unsigned int sc_type:16, sc_stats:16; and use unsigned int everywhere? Maybe it is confusing... maybe I'll just make it unsigned short everywhere.=20 Thanks, NeilBrown