nfsd: expose /proc/net/sunrpc/nfsd in net namespaces
authorJosef Bacik <josef@toxicpanda.com>
Fri, 26 Jan 2024 15:39:46 +0000 (10:39 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:10 +0000 (09:12 -0500)
commit93483ac5fec62cc1de166051b219d953bb5e4ef4
treeabf581c516a245baa67cf9118b0b481df7b85d01
parentd98416cc2154053950610bb6880911e3dcbdf8c5
nfsd: expose /proc/net/sunrpc/nfsd in net namespaces

We are running nfsd servers inside of containers with their own network
namespace, and we want to monitor these services using the stats found
in /proc.  However these are not exposed in the proc inside of the
container, so we have to bind mount the host /proc into our containers
to get at this information.

Separate out the stat counters init and the proc registration, and move
the proc registration into the pernet operations entry and exit points
so that these stats can be exposed inside of network namespaces.

This is an intermediate step, this just exposes the global counters in
the network namespace.  Subsequent patches will move these counters into
the per-network namespace container.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsctl.c
fs/nfsd/stats.c
fs/nfsd/stats.h