Page MenuHomeFreeBSD

make tmpfs.h friendly with _KERNEL undefined
ClosedPublic

Authored by dougm on Dec 19 2019, 4:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 2:50 PM
Unknown Object (File)
Oct 6 2024, 6:17 AM
Unknown Object (File)
Oct 3 2024, 11:27 PM
Unknown Object (File)
Oct 3 2024, 2:45 AM
Unknown Object (File)
Sep 30 2024, 7:16 PM
Unknown Object (File)
Sep 30 2024, 6:01 PM
Unknown Object (File)
Sep 30 2024, 5:39 PM
Unknown Object (File)
Sep 30 2024, 10:19 AM
Subscribers

Details

Summary

Including <sys/tmpfs.h> into non-kernel software leads to a compilation error because, without _KERNEL defined, the macro TMPFS_VALIDATE_DIR is invoked, but never defined. User-level software that includes sys/tmpfs.h must define _KERNEL to make the definition of TMPFS_VALIDATE_DIR visible.

This change puts all the inline functions that, directly or indirectly, invoke MPASS into the scope of the _KERNEL block, allowing many user-space includers of <sys/tmpfs.h> to stop defining _KERNEL.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/fs/tmpfs/tmpfs.h
407 ↗(On Diff #65804)

The practice of including headers from headers is discouraged. It should be handled by consumer.

538 ↗(On Diff #65804)

This is fine.

dougm edited the summary of this revision. (Show Details)

Remove #include <sys/lock.h> from tmpfs.h.

Leave #include <sys/queue.h> and #include <sys/tree.h> in tmpfs.h.

This revision is now accepted and ready to land.Dec 19 2019, 4:31 PM