]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sunrpc: add helpers to count and snapshot pending cache requests
authorJeff Layton <jlayton@kernel.org>
Wed, 25 Mar 2026 14:40:27 +0000 (10:40 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 1 Jun 2026 15:08:18 +0000 (11:08 -0400)
commitc13ecd47648cc98e9f324ce4bcaa3d0654c3c91c
treeaf3f8861fcf83690f22686f6b168f451add921dd
parentd52db76f2d3559292b7af7c43ad9a635e017cac8
sunrpc: add helpers to count and snapshot pending cache requests

Add sunrpc_cache_requests_count() and sunrpc_cache_requests_snapshot()
to allow callers to count and snapshot the pending upcall request list
without exposing struct cache_request outside of cache.c.

Both functions skip entries that no longer have CACHE_PENDING set.

The snapshot function takes a cache_get() reference on each item so the
caller can safely use them after the queue_lock is released.

These will be used by the nfsd generic netlink dumpit handler for
svc_export upcall requests.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/sunrpc/cache.h
net/sunrpc/cache.c