kernel_samsung_a53x/include
NeilBrown 58232d691d SUNRPC: stop using ->sv_nrthreads as a refcount
[ Upstream commit ec52361df99b490f6af412b046df9799b92c1050 ]

The use of sv_nrthreads as a general refcount results in clumsy code, as
is seen by various comments needed to explain the situation.

This patch introduces a 'struct kref' and uses that for reference
counting, leaving sv_nrthreads to be a pure count of threads.  The kref
is managed particularly in svc_get() and svc_put(), and also nfsd_put();

svc_destroy() now takes a pointer to the embedded kref, rather than to
the serv.

nfsd allows the svc_serv to exist with ->sv_nrhtreads being zero.  This
happens when a transport is created before the first thread is started.
To support this, a 'keep_active' flag is introduced which holds a ref on
the svc_serv.  This is set when any listening socket is successfully
added (unless there are running threads), and cleared when the number of
threads is set.  So when the last thread exits, the nfs_serv will be
destroyed.
The use of 'keep_active' replaces previous code which checked if there
were any permanent sockets.

We no longer clear ->rq_server when nfsd() exits.  This was done
to prevent svc_exit_thread() from calling svc_destroy().
Instead we take an extra reference to the svc_serv to prevent
svc_destroy() from being called.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:50 +01:00
..
acpi
asm-generic
clocksource
crypto crypto: af_alg - Disallow multiple in-flight AIO requests 2024-11-18 12:12:26 +01:00
drm drm/mipi-dsi: use correct return type for the DSC functions 2024-11-19 12:26:58 +01:00
dt-bindings dt-bindings: clock: Update the videocc resets for sm8150 2024-11-18 12:12:41 +01:00
keys
kunit
kvm
linux SUNRPC: stop using ->sv_nrthreads as a refcount 2024-11-19 12:27:50 +01:00
math-emu
media
memory
misc
net net: fix __dst_negative_advice() race 2024-11-19 12:27:19 +01:00
pcmcia
ras
rdma
scsc
scsi scsi: core: Introduce enum scsi_disposition 2024-11-18 12:13:21 +01:00
sdp
soc soc: fsl: qbman: Add CGR update function 2024-11-19 09:22:35 +01:00
sound ASoC: soc-acpi: add helper to identify parent driver. 2024-11-19 12:26:57 +01:00
target
test
trace SUNRPC: Trace calls to .rpc_call_done 2024-11-19 12:27:47 +01:00
uapi fanotify: report old and/or new parent+name in FAN_RENAME event 2024-11-19 12:27:49 +01:00
variant1/linux
vdso
video
xen