mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS
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> Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-cachefs@redhat.com Link: https://listman.redhat.com/archives/linux-cachefs/2022-April/006649.html # v1
This commit is contained in:
@@ -30,7 +30,7 @@ static DEFINE_SPINLOCK(fscache_cookie_lru_lock);
|
|||||||
DEFINE_TIMER(fscache_cookie_lru_timer, fscache_cookie_lru_timed_out);
|
DEFINE_TIMER(fscache_cookie_lru_timer, fscache_cookie_lru_timed_out);
|
||||||
static DECLARE_WORK(fscache_cookie_lru_work, fscache_cookie_lru_worker);
|
static DECLARE_WORK(fscache_cookie_lru_work, fscache_cookie_lru_worker);
|
||||||
static const char fscache_cookie_states[FSCACHE_COOKIE_STATE__NR] = "-LCAIFUWRD";
|
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)
|
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);
|
EXPORT_SYMBOL(__fscache_invalidate);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PROC_FS
|
||||||
/*
|
/*
|
||||||
* Generate a list of extant cookies in /proc/fs/fscache/cookies
|
* 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,
|
.stop = fscache_cookies_seq_stop,
|
||||||
.show = fscache_cookies_seq_show,
|
.show = fscache_cookies_seq_show,
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
@@ -56,7 +56,9 @@ static inline bool fscache_set_cache_state_maybe(struct fscache_cache *cache,
|
|||||||
* cookie.c
|
* cookie.c
|
||||||
*/
|
*/
|
||||||
extern struct kmem_cache *fscache_cookie_jar;
|
extern struct kmem_cache *fscache_cookie_jar;
|
||||||
|
#ifdef CONFIG_PROC_FS
|
||||||
extern const struct seq_operations fscache_cookies_seq_ops;
|
extern const struct seq_operations fscache_cookies_seq_ops;
|
||||||
|
#endif
|
||||||
extern struct timer_list fscache_cookie_lru_timer;
|
extern struct timer_list fscache_cookie_lru_timer;
|
||||||
|
|
||||||
extern void fscache_print_cookie(struct fscache_cookie *cookie, char prefix);
|
extern void fscache_print_cookie(struct fscache_cookie *cookie, char prefix);
|
||||||
@@ -137,7 +139,9 @@ int fscache_stats_show(struct seq_file *m, void *v);
|
|||||||
/*
|
/*
|
||||||
* volume.c
|
* volume.c
|
||||||
*/
|
*/
|
||||||
|
#ifdef CONFIG_PROC_FS
|
||||||
extern const struct seq_operations fscache_volumes_seq_ops;
|
extern const struct seq_operations fscache_volumes_seq_ops;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct fscache_volume *fscache_get_volume(struct fscache_volume *volume,
|
struct fscache_volume *fscache_get_volume(struct fscache_volume *volume,
|
||||||
enum fscache_volume_trace where);
|
enum fscache_volume_trace where);
|
||||||
|
Reference in New Issue
Block a user