opnsense-src/sys/fs/pseudofs
Mark Johnston e9b713513a pseudofs: Simplify pfs_readdir() and set eofflag
There were two loops, one to skip entries before the requested offset,
and one to populate entries.  Merge them and use the return value of
pfs_iterate() to decide whether to set eofflag.

As a side effect, this fixes a small bug: the first loop would decrement
`offset` to zero, and the second loop would increment it again.
However, `offset` was used to set `d_off`, and we should include the
starting offset there.

Add a comment explaining the use of the allproc lock.

Reviewed by:	des, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51462
2025-07-23 16:20:31 +00:00
..
pseudofs.c pseudofs: make dup name an error instead of panic 2025-06-06 01:41:40 +03:00
pseudofs.h Remove my middle name. 2023-08-17 15:08:30 +02:00
pseudofs_fileno.c Remove my middle name. 2023-08-17 15:08:30 +02:00
pseudofs_internal.h Remove my middle name. 2023-08-17 15:08:30 +02:00
pseudofs_vncache.c pseudofs: fix off by one in hash iteration in pfs_purge 2023-11-20 05:57:25 +00:00
pseudofs_vnops.c pseudofs: Simplify pfs_readdir() and set eofflag 2025-07-23 16:20:31 +00:00