* Re: [Linux-cachefs] [PATCH] fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS [not found] <20220402044728.9669-1-huyue2@coolpad.com> @ 2022-04-06 2:45 ` JeffleXu 2022-04-06 2:51 ` JeffleXu 0 siblings, 1 reply; 2+ messages in thread From: JeffleXu @ 2022-04-06 2:45 UTC (permalink / raw) To: Yue Hu, dhowells, linux-cachefs; +Cc: linux-kernel, zbestahu, zbestahu 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Linux-cachefs] [PATCH] fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS 2022-04-06 2:45 ` [Linux-cachefs] [PATCH] fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS JeffleXu @ 2022-04-06 2:51 ` JeffleXu 0 siblings, 0 replies; 2+ messages in thread From: JeffleXu @ 2022-04-06 2:51 UTC (permalink / raw) To: Yue Hu, dhowells, linux-cachefs; +Cc: zbestahu, linux-kernel, zbestahu 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 <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" ... > 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-06 13:57 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20220402044728.9669-1-huyue2@coolpad.com> 2022-04-06 2:45 ` [Linux-cachefs] [PATCH] fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS JeffleXu 2022-04-06 2:51 ` JeffleXu
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.