Page MenuHomeFreeBSD

vfs: Sort includes in vfs_vnops.c
ClosedPublic

Authored by markj on May 12 2025, 8:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 11, 7:30 AM
Unknown Object (File)
Wed, Jun 11, 12:45 AM
Unknown Object (File)
Tue, Jun 10, 7:35 PM
Unknown Object (File)
Sun, Jun 8, 4:24 PM
Unknown Object (File)
Sat, Jun 7, 8:51 AM
Unknown Object (File)
Tue, May 27, 2:25 AM
Unknown Object (File)
Sun, May 25, 11:34 PM
Unknown Object (File)
Wed, May 14, 5:54 PM
Subscribers

Details

Summary

Remove some that are not needed. No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.May 12 2025, 8:54 PM
This revision is now accepted and ready to land.May 12 2025, 9:29 PM
sys/kern/vfs_vnops.c
45

sys/systm.h already includes sys/param.h

47

I cannot find uses of 'struct bio' or BIO_XXX symbols. Might be, this header is not needed?

49

Do we need sys/conf.h there at all? I did not checked, but suspect that it is not needed, at least directly.

markj marked 3 inline comments as done.

Remove some more unneeded includes.

This revision now requires review to proceed.Tue, May 13, 2:52 PM
olce added inline comments.
sys/kern/vfs_vnops.c
45

sys/systm.h already includes sys/param.h

There is no mention in style(9) that sys/param.h must not be directly included even if sys/systm.h is also. On the contrary, it evokes their ordering when both should be included.

As said elsewhere, we should stick with listing all the includes that are directly needed, unless we have clear agreed-upon exceptions (which are equivalent to a kind of commitment that the headers won't be disentangled).

If you wish that sys/param.h is not listed when sys/systm.h is included, then please propose a draft modifying style(9). Actually, sys/systm.h includes sys/param.h only on _KERNEL, not in userland. This would need to be spelled clearly in such a proposal (and seems a drawback to me). In the meantime, I would not remove sys/param.h here.

This revision is now accepted and ready to land.Tue, May 13, 3:35 PM
kib added inline comments.
sys/kern/vfs_vnops.c
45

sys/systm.h was written as a convenience header providing the set of the kernel symbols. sys/param.h is part of the systm.h contract.

This revision was automatically updated to reflect the committed changes.