Skip to content

Commit 19517e5

Browse files
taigerhudhowells
authored andcommitted
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
1 parent 2c547f2 commit 19517e5

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

fs/fscache/cookie.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static DEFINE_SPINLOCK(fscache_cookie_lru_lock);
3030
DEFINE_TIMER(fscache_cookie_lru_timer, fscache_cookie_lru_timed_out);
3131
static DECLARE_WORK(fscache_cookie_lru_work, fscache_cookie_lru_worker);
3232
static const char fscache_cookie_states[FSCACHE_COOKIE_STATE__NR] = "-LCAIFUWRD";
33-
unsigned int fscache_lru_cookie_timeout = 10 * HZ;
33+
static unsigned int fscache_lru_cookie_timeout = 10 * HZ;
3434

3535
void fscache_print_cookie(struct fscache_cookie *cookie, char prefix)
3636
{
@@ -1069,6 +1069,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie,
10691069
}
10701070
EXPORT_SYMBOL(__fscache_invalidate);
10711071

1072+
#ifdef CONFIG_PROC_FS
10721073
/*
10731074
* Generate a list of extant cookies in /proc/fs/fscache/cookies
10741075
*/
@@ -1145,3 +1146,4 @@ const struct seq_operations fscache_cookies_seq_ops = {
11451146
.stop = fscache_cookies_seq_stop,
11461147
.show = fscache_cookies_seq_show,
11471148
};
1149+
#endif

fs/fscache/internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ static inline bool fscache_set_cache_state_maybe(struct fscache_cache *cache,
5656
* cookie.c
5757
*/
5858
extern struct kmem_cache *fscache_cookie_jar;
59+
#ifdef CONFIG_PROC_FS
5960
extern const struct seq_operations fscache_cookies_seq_ops;
61+
#endif
6062
extern struct timer_list fscache_cookie_lru_timer;
6163

6264
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);
137139
/*
138140
* volume.c
139141
*/
142+
#ifdef CONFIG_PROC_FS
140143
extern const struct seq_operations fscache_volumes_seq_ops;
144+
#endif
141145

142146
struct fscache_volume *fscache_get_volume(struct fscache_volume *volume,
143147
enum fscache_volume_trace where);

0 commit comments

Comments
 (0)