X-Received: by 2002:a17:902:b201:b0:14d:66b5:5d69 with SMTP id t1-20020a170902b20100b0014d66b55d69mr1631699plr.95.1645654852388; Wed, 23 Feb 2022 14:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645654852; cv=none; d=google.com; s=arc-20160816; b=w19WCR+oWDhf36HF+YUb7reapSlJveeucIqK9nroeQBQnTyfuhQ1K6JcycltuzwslO IqCUEK2pgZd/qaiKGktP9FM/RiQ7eIjrHhX8WudXv15BUrh1aLYZIFD0HdW+RpiEHx+s +yMe4jgkTclpih5/FKx6biqTiOxyVl+1dP3ttrOyNZw/I/cf5VkHHCvFjwi7AsZYzIVb upCQXBq+TBapm8cC1C6bf5uSUiS9dde60FmturL5RX+Hb+Ua7S8G0FvCykRyw/ks9PJu jq+oxWcx6//G5J35HFyXNvsUyI2/sasp2iBoQ7kIVBUK94Ce5f+KCkcvPpxrDzl6fjIJ hZhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cScDC19ah8ZHx3gQEwTbfWR0sPCxVKvs7xfVOtyUWM8=; b=dhN4wNGb/L+q0urjfCultQteIYbBiuQ+bh6oZRNTHU/j95nIxW+c72k93qoKhkFllt nZ9Zwqy7AKm3fnDF7mIq4ZQYyym6aqupSU2h8MxvO9i/OFqNa4EnJf+CxNaPuBqf3Hn8 8a8PTrIjXPZjlA2H2iEra/cuh+uJSrYpFLFfgP94GgbWm7HE4NVKmpSDlEIyuvpWmpJ9 NePpadcN9rIqVEWmY0flyAAAjJEAjPqCh1AojuwOP9R9AvSbQGroFe1YAxmZJDRS13EY t+qJ2unMh6YI8Ie2nC2jWU5sHjDoxol6s7ioMZsjXa/cO90n9NQRlVoNZC4TV3EbhN6/ uVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dFgTlhEu; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7si746899plo.100.2022.02.23.14.20.26; Wed, 23 Feb 2022 14:20:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dFgTlhEu; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234100AbiBWVXh (ORCPT + 99 others); Wed, 23 Feb 2022 16:23:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242435AbiBWVUE (ORCPT ); Wed, 23 Feb 2022 16:20:04 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD4974EA0A for ; Wed, 23 Feb 2022 13:19:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4B3A3B821A2 for ; Wed, 23 Feb 2022 21:19:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7DC5C340EC for ; Wed, 23 Feb 2022 21:19:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645651172; bh=Y1ipazY3pl3WZgPz62B3OLONuRP4E1z7/Fuod/m3bP0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dFgTlhEu3uJxCrH8ZkH31iWJqPsYd8fRMOgva33RpTXMo2Cnc74cCTHASVkS2bwRm 1KgTMyz8FCp9/zX8WDi3QiITvGovaUNGUwem6Qypvm1NTrdEtUm4BsBtbqrmZyWeS2 CT04L7fgtfurL11NNGHctgr7DQb0lx5LMCAriGNhlj2DyTjZ6+4Kj2LHvFO97r/kBE Aqbx9qdAOK/k2VRAf5/jcPK9qgpex2IujyAEurebk67cy4FlW1oTtnr2zFFW76ETyf bKd//sQYbIFjb9v3EGcxGssYr0KAc81x7J9fXbJ4ABEWOASZ1+paQfU0B8/UjdbDSM OQ2ERcvlEtfdQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v7 01/21] NFS: constify nfs_server_capable() and nfs_have_writebacks() Date: Wed, 23 Feb 2022 16:12:45 -0500 Message-Id: <20220223211305.296816-2-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220223211305.296816-1-trondmy@kernel.org> References: <20220223211305.296816-1-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Signed-off-by: Trond Myklebust --- include/linux/nfs_fs.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 72a732a5103c..6e10725887d1 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -363,7 +363,7 @@ static inline void nfs_mark_for_revalidate(struct inode *inode) spin_unlock(&inode->i_lock); } -static inline int nfs_server_capable(struct inode *inode, int cap) +static inline int nfs_server_capable(const struct inode *inode, int cap) { return NFS_SERVER(inode)->caps & cap; } @@ -587,12 +587,11 @@ extern struct nfs_commit_data *nfs_commitdata_alloc(bool never_fail); extern void nfs_commit_free(struct nfs_commit_data *data); bool nfs_commit_end(struct nfs_mds_commit_info *cinfo); -static inline int -nfs_have_writebacks(struct inode *inode) +static inline bool nfs_have_writebacks(const struct inode *inode) { if (S_ISREG(inode->i_mode)) return atomic_long_read(&NFS_I(inode)->nrequests) != 0; - return 0; + return false; } /* -- 2.35.1