Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1099190pxb; Wed, 6 Apr 2022 08:41:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrQTINFdaxQuUuxE4YIagbFt53sNTa8BLy+60xS+IkGkDazOHwwcQu1DAqrABhVz38zhXD X-Received: by 2002:a17:90a:ec13:b0:1ca:8240:9e4b with SMTP id l19-20020a17090aec1300b001ca82409e4bmr10609176pjy.164.1649259711070; Wed, 06 Apr 2022 08:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649259711; cv=none; d=google.com; s=arc-20160816; b=oJrbIm/ZIDFAeBD4WcHwBFi/+9Tz1vfU5ZVQRIcclDiKJYx4l8ebB67KR9DYUQAgYZ yMUgLvEgyQItmsvxQjm1JhqB0TNbL0QUpAmI+M7wKoaHEbobnm0UcVWRKnkxewSedskz w5NfZXKIASQUDLKuW/tWee5XA70jFe/0HHaXjueCzMuEneiCwnjSuOSWOjCz438tT+VU dlWPublxClTTQo4QjDrOLqrxDXjaQiN0rj6yhoeOtY4oncuzpg/bOrgbUV9B0BATiSMw 0P1PvyoN2fdCrnawwoIbywtzG6EIRZ6pzEcoh8Wwa9hy7EfPeBusWruLRXxHmWltXWdG J6DA== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=RlR0PSzQkwhvVDTT7CwBBGcxveRc8EHG9UxwUnkvRzo=; b=dEluOB2AWOU2e1BbkNMZwm3Q7hct5iBELBQB/2q1I5JuuvwtHCFp1xjD8kiTEGxQRr xmrZYNsEuhvdCYkaxEbWrwx4R7phSQEy2c8hGleI0uuRgawWmtPXTqBBdEegPKuu9+lM wMDdF/F60rFgcbdKSobMmJ1bKjhSbEnK4Mf5oBJoDNF2+FABNUHuJaTtXQhP/GvnD5NV ROJ3vJPTzMaAZ7YIcFHUoVHTr4fSnYEpV/C2JuTPaDQazS5pzxEExBDQi1oOWP53NhEZ uuGZVcYPF0Y2gREIm/B2WAUW1DzHXyFj+BaYOp86Qjl/MkD2xrop2D1navoJlBNQyXtF jeVw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id e18-20020a17090301d200b00156a2cedc85si9997204plh.528.2022.04.06.08.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:41:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 B9652337603; Wed, 6 Apr 2022 06:58:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234061AbiDFN7d (ORCPT + 99 others); Wed, 6 Apr 2022 09:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234044AbiDFN7S (ORCPT ); Wed, 6 Apr 2022 09:59:18 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D30E82DCCB9 for ; Tue, 5 Apr 2022 19:51:12 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0V9JW7Mc_1649213468; Received: from 30.225.24.86(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V9JW7Mc_1649213468) by smtp.aliyun-inc.com(127.0.0.1); Wed, 06 Apr 2022 10:51:09 +0800 Message-ID: Date: Wed, 6 Apr 2022 10:51:08 +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 From: JeffleXu To: Yue Hu , dhowells@redhat.com, linux-cachefs@redhat.com Cc: zbestahu@gmail.com, linux-kernel@vger.kernel.org, zbestahu@163.com References: <20220402044728.9669-1-huyue2@coolpad.com> <1c6b191b-4a2e-0333-b0a3-f76bcd6b6515@linux.alibaba.com> In-Reply-To: <1c6b191b-4a2e-0333-b0a3-f76bcd6b6515@linux.alibaba.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/6/22 10:45 AM, JeffleXu wrote: > > > 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" ... > Sorry, fscache_cookies_seq_stop() and fscache_cookies_seq_show() have already been wrapped with "#ifdef CONFIG_PROC_F" in this patch. Please ignore the noise... -- Thanks, Jeffle