]> git.ipfire.org Git - thirdparty/linux.git/commit
sunrpc: split cache_detail queue into request and reader lists
authorJeff Layton <jlayton@kernel.org>
Mon, 23 Feb 2026 17:10:01 +0000 (12:10 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
commitfacc4e3c80420e3466003ce09b576e005b56a015
tree6fe4f9f78530da602b8fd7348b89fad2dc9de3c3
parent552d0e17ea042fc4f959c4543cbbd0e54de7a8e9
sunrpc: split cache_detail queue into request and reader lists

Replace the single interleaved queue (which mixed cache_request and
cache_reader entries distinguished by a ->reader flag) with two
dedicated lists: cd->requests for upcall requests and cd->readers
for open file handles.

Readers now track their position via a monotonically increasing
sequence number (next_seqno) rather than by their position in the
shared list. Each cache_request is assigned a seqno when enqueued,
and a new cache_next_request() helper finds the next request at or
after a given seqno.

This eliminates the cache_queue wrapper struct entirely, simplifies
the reader-skipping loops in cache_read/cache_poll/cache_ioctl/
cache_release, and makes the data flow easier to reason about.

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