Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2468173pxp; Sun, 13 Mar 2022 19:33:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx+IzoT6nLQ0+T8z6dWdGVihXAGN+lDBRdNyTnCKs9M+iDdFYuq3hxWB/m3QuTkbvA/eSt X-Received: by 2002:a17:902:c215:b0:14f:f1c2:9fe3 with SMTP id 21-20020a170902c21500b0014ff1c29fe3mr21659981pll.145.1647225183582; Sun, 13 Mar 2022 19:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647225183; cv=none; d=google.com; s=arc-20160816; b=w/RpWjN5QvXrpF/w4HVmDy6gAiLM0+GvanCHWUzxwtKz8A6qJjx2kCS45kbOZDDu2Y Ig8FclaGx2THQfSdmzSzQQ21tw2+Ndnmlxi6UjvQpfL9KyGk6fI1OiRAuTmFuRrXj/gX 0qEg4UFwyctas4ZQjzuLo6axJTgBHVQlSVch4U3p1suJ3034ZwXaQeUlYEb43zs/pWOB 2lQxIo6Klb8LqbEIYqm5XSsZtQ2smB/OFRZwIODRCOCEbTIDGtLVYF2hpDRLVy6vFiXE M0LKssP7BeTvVUDA4k5ZjLk6MpfJlhJ7ojakaHqIOuNt/7CO/UHlkG3pIyxw8hjhtEI2 kcsw== 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=pIDULS/7sfrzBPUsVY+sz5Pq1BqwRTexlS1zEc3xLND9X21bHIDAbRkDtOtfp+3W1G E25NVbKmCkL/t8vu9QwpV+QOVAZ+jmx56t86UIRTmQVlNztoRICd96Ad+JnPdfsPF9/D X3Q6SuJMhik9RZ2Q5zR9KLzJM/jGhJ0RiiO6NsgCnppV3RH4RXGMcrpd+GVIMV9SiUxh HJs/ylA7R0gnM3QJe1BIsSGpP+frv35aU0C/z1ynsCsySUK+jC1FgPaexlstNAElKUSp uOZgl/j0DlVZOdyLNiy+pU68Zh1H4gy6sjDL1SItZVxWofmJTV82Lwzaraum5t4YmfOU Gpog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=peoOXRne; 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 r12-20020a63b10c000000b003653639f3afsi14271028pgf.649.2022.03.13.19.32.37; Sun, 13 Mar 2022 19:33:03 -0700 (PDT) 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=peoOXRne; 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 S235006AbiCMRNO (ORCPT + 99 others); Sun, 13 Mar 2022 13:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234169AbiCMRNM (ORCPT ); Sun, 13 Mar 2022 13:13:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722A0139CDD for ; Sun, 13 Mar 2022 10:12:05 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 120136122A for ; Sun, 13 Mar 2022 17:12:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47D2CC340F4 for ; Sun, 13 Mar 2022 17:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647191524; bh=Y1ipazY3pl3WZgPz62B3OLONuRP4E1z7/Fuod/m3bP0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=peoOXRne408WXzODUcGL3YLVWWkS6IlDY4PdWBg7ZsdgRuWtAHQMrYSoXsr+IsVuj 3OPzvJH7aLngK0g83Il7mIOD1IViaKatolh0+CzKXsA+VGscW0c6ZB1Y9rEE8RficK HsgiMiNHaLXOQQKTuhUMAhNaCI2tQspAPOspFXFdw3f6roZz+kx4Rb6J8RM393Gwfw 95aMhdbUsmxF2dyxjufhFINduLAjbG0c53gAjmQKIzhMq6y0LcAB/LEEs+HtTn5SNh DSiz2IpfJ8IYNhTa9aw6bT4TJLTehMjeCf+mNGw+uQFfHoq6H8Gn14DEo7WjGxAicT GfRdjqSXyw7GA== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v10 02/26] NFS: constify nfs_server_capable() and nfs_have_writebacks() Date: Sun, 13 Mar 2022 13:05:33 -0400 Message-Id: <20220313170557.5940-3-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220313170557.5940-2-trondmy@kernel.org> References: <20220313170557.5940-1-trondmy@kernel.org> <20220313170557.5940-2-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 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