Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1087286pxb; Wed, 6 Apr 2022 08:24:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0b2zOpZd+axHK2IrZ4sKPZiTop0K6yWoc06x+liXRb1Kc0zjPoMjHogYsfygOoVz3f28G X-Received: by 2002:a63:1847:0:b0:381:8214:3a7d with SMTP id 7-20020a631847000000b0038182143a7dmr7370371pgy.134.1649258691245; Wed, 06 Apr 2022 08:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649258691; cv=none; d=google.com; s=arc-20160816; b=Z9FyYRVBUqN2Qsd2MRu/C+6d1YMI4mLI+789ecvz22oQP0IiyR7fFlGMBLe7NVg0XC Xdl8T4w2J5EdJ1Imhc8lxgGSDdJ5bfQZ9V2sx6BdqDYqA3goz5PrnEtWGQx6Y96O9hgr saGk54ax+5ovDaYsEBVG0z53PsQwdrI+/ar1NCSmlcbGd+xMvplEOyJEnTS3Rew7Y1Qt SqIn0QLxUd68BTioHxbPhNQRLNej1v9ehRNVc8sAvQuf/5H/J/M+hKGfdVFVQG7zoHyV WdEhdhVO78UUlHnsEiV7CuVh59WUoxLv9m7++9TjqnjsI+G2w/Qj07J4StcT5AsQ4C9G qfmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=TjVpbsPbQocsySCxB7maxnKrGg2wwgfzMeHNSvGeXoM=; b=Srlqsuj8jXFch1QxnPx17qVAzkGsVCQkiuDyvOjDTwJaxstPAXeba0SObP9rnFZbK+ NXhs25PGIXtp+SD1Zyvx5NWFiJkf70BwTy5rLzx24Iq3uBrYnu9bH3KJVBxDMkz23G2G p0FPk0Qkql84ACpbYrPH34qo/XdwuU1YPkHgnv1UXA3kgOUuMbGRX6zx7TAdwulVo0TV kDzoXePf4IToxlj9nOWIb5T2UqkzSFE8MZplzzRbnfPSqwqxA/oJQqZiYQQ3AFbu1e8P B7pllXoCCt3h9BsLnxEOaFEqMutwwqf+BUTX5amL34a0sGW4csdqMybXv94mFIrhCyd/ 0WwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q91-20020a17090a1b6400b001c74c0f7c62si4523268pjq.129.2022.04.06.08.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ED88E475861; Wed, 6 Apr 2022 06:28:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233233AbiDFNaJ (ORCPT + 99 others); Wed, 6 Apr 2022 09:30:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233291AbiDFN3V (ORCPT ); Wed, 6 Apr 2022 09:29:21 -0400 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA29E137B08 for ; Tue, 5 Apr 2022 19:45:49 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0V9JmdQB_1649213146; Received: from 30.225.24.86(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V9JmdQB_1649213146) by smtp.aliyun-inc.com(127.0.0.1); Wed, 06 Apr 2022 10:45:47 +0800 Message-ID: <1c6b191b-4a2e-0333-b0a3-f76bcd6b6515@linux.alibaba.com> Date: Wed, 6 Apr 2022 10:45:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [Linux-cachefs] [PATCH] fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS Content-Language: en-US To: Yue Hu , dhowells@redhat.com, linux-cachefs@redhat.com Cc: linux-kernel@vger.kernel.org, zbestahu@163.com, zbestahu@gmail.com References: <20220402044728.9669-1-huyue2@coolpad.com> From: JeffleXu In-Reply-To: <20220402044728.9669-1-huyue2@coolpad.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable 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-kernel@vger.kernel.org On 4/2/22 12:47 PM, Yue Hu wrote: > fscache_cookies_seq_ops is only used in proc.c that is compiled under > enabled CONFIG_PROC_FS, so move related code under this config. The > same case exsits in internal.h. > > Also, make fscache_lru_cookie_timeout static due to no user outside > of cookie.c. > > Signed-off-by: Yue Hu > --- > fs/fscache/cookie.c | 4 +++- > fs/fscache/internal.h | 4 ++++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c > index 9bb1ab5fe5ed..9d3cf0111709 100644 > --- a/fs/fscache/cookie.c > +++ b/fs/fscache/cookie.c > @@ -30,7 +30,7 @@ static DEFINE_SPINLOCK(fscache_cookie_lru_lock); > DEFINE_TIMER(fscache_cookie_lru_timer, fscache_cookie_lru_timed_out); > static DECLARE_WORK(fscache_cookie_lru_work, fscache_cookie_lru_worker); > static const char fscache_cookie_states[FSCACHE_COOKIE_STATE__NR] = "-LCAIFUWRD"; > -unsigned int fscache_lru_cookie_timeout = 10 * HZ; > +static unsigned int fscache_lru_cookie_timeout = 10 * HZ; > > void fscache_print_cookie(struct fscache_cookie *cookie, char prefix) > { > @@ -1069,6 +1069,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie, > } > EXPORT_SYMBOL(__fscache_invalidate); > > +#ifdef CONFIG_PROC_FS > /* > * Generate a list of extant cookies in /proc/fs/fscache/cookies > */ > @@ -1145,3 +1146,4 @@ const struct seq_operations fscache_cookies_seq_ops = { > .stop = fscache_cookies_seq_stop, > .show = fscache_cookies_seq_show, > }; > +#endif Then I'm afraid fscache_cookies_seq_stop() and fscache_cookies_seq_show() also need to be wrapped with "#ifdef CONFIG_PROC_F" ... -- Thanks, Jeffle