diff options
author | Dai Ngo <dai.ngo@oracle.com> | 2022-09-14 08:54:26 -0700 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2022-09-26 14:02:41 -0400 |
commit | 7746b32f467b3813fb61faaab3258de35806a7ac (patch) | |
tree | 22ace645fe5c97affbe517c0f36395cdc2e898cf /fs/nfsd/nfsd.h | |
parent | 3a4ea23d86a317c4b68b9a69d51f7e84e1e04357 (diff) | |
download | linux-7746b32f467b3813fb61faaab3258de35806a7ac.tar.gz linux-7746b32f467b3813fb61faaab3258de35806a7ac.tar.bz2 linux-7746b32f467b3813fb61faaab3258de35806a7ac.zip |
NFSD: add shrinker to reap courtesy clients on low memory condition
Add courtesy_client_reaper to react to low memory condition triggered
by the system memory shrinker.
The delayed_work for the courtesy_client_reaper is scheduled on
the shrinker's count callback using the laundry_wq.
The shrinker's scan callback is not used for expiring the courtesy
clients due to potential deadlocks.
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfsd.h')
-rw-r--r-- | fs/nfsd/nfsd.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index 6ab4ad41ae84..09726c5b9a31 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -505,7 +505,8 @@ extern void unregister_cld_notifier(void); extern void nfsd4_ssc_init_umount_work(struct nfsd_net *nn); #endif -extern void nfsd4_init_leases_net(struct nfsd_net *nn); +extern int nfsd4_init_leases_net(struct nfsd_net *nn); +extern void nfsd4_leases_net_shutdown(struct nfsd_net *nn); #else /* CONFIG_NFSD_V4 */ static inline int nfsd4_is_junction(struct dentry *dentry) @@ -513,7 +514,8 @@ static inline int nfsd4_is_junction(struct dentry *dentry) return 0; } -static inline void nfsd4_init_leases_net(struct nfsd_net *nn) {}; +static inline int nfsd4_init_leases_net(struct nfsd_net *nn) { return 0; }; +static inline void nfsd4_leases_net_shutdown(struct nfsd_net *nn) {}; #define register_cld_notifier() 0 #define unregister_cld_notifier() do { } while(0) |