Page MenuHomeFreeBSD

pseudofs: Simplify pfs_readdir() and set eofflag
ClosedPublic

Authored by markj on Jul 22 2025, 1:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 22, 11:40 AM
Unknown Object (File)
Nov 17 2025, 4:16 PM
Unknown Object (File)
Nov 14 2025, 1:05 PM
Unknown Object (File)
Nov 6 2025, 11:58 PM
Unknown Object (File)
Oct 31 2025, 7:13 PM
Unknown Object (File)
Oct 27 2025, 1:24 PM
Unknown Object (File)
Oct 21 2025, 1:49 PM
Unknown Object (File)
Oct 18 2025, 6:49 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 65616
Build 62499: arc lint + arc unit

Event Timeline

markj requested review of this revision.Jul 22 2025, 1:31 PM
kib added inline comments.
sys/fs/pseudofs/pseudofs_vnops.c
888

This line definitely needs a comment that allproc_lock is required for pfs_iterate().
Although it is probably not needed for not-procdir directories.

This revision is now accepted and ready to land.Jul 22 2025, 2:19 PM
markj marked an inline comment as done.

Add a comment noting the reason for acquiring allproc_lock.

For now I did not attempt to make it smarter.

This revision now requires review to proceed.Jul 22 2025, 3:13 PM
This revision is now accepted and ready to land.Jul 22 2025, 3:17 PM