mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: JeffleXu <jefflexu@linux.alibaba.com>
To: Yue Hu <huyue2@coolpad.com>,
	dhowells@redhat.com, linux-cachefs@redhat.com
Cc: linux-kernel@vger.kernel.org, zbestahu@163.com, zbestahu@gmail.com
Subject: Re: [Linux-cachefs] [PATCH] fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS
Date: Wed, 6 Apr 2022 10:45:46 +0800	[thread overview]
Message-ID: <1c6b191b-4a2e-0333-b0a3-f76bcd6b6515@linux.alibaba.com> (raw)
In-Reply-To: <20220402044728.9669-1-huyue2@coolpad.com>



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 <huyue2@coolpad.com>
> ---
>  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

       reply	other threads:[~2022-04-06 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220402044728.9669-1-huyue2@coolpad.com>
2022-04-06  2:45 ` JeffleXu [this message]
2022-04-06  2:51   ` JeffleXu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c6b191b-4a2e-0333-b0a3-f76bcd6b6515@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=dhowells@redhat.com \
    --cc=huyue2@coolpad.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbestahu@163.com \
    --cc=zbestahu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®