Lustre Style Guide Includes: Difference between revisions
Jump to navigation
Jump to search
KenRawlings (talk | contribs) (adding categories) |
(provide rationale for sorted headers) |
||
Line 8: | Line 8: | ||
# *_internal.h and any other "local.h" files | # *_internal.h and any other "local.h" files | ||
Each group shall be sorted alphanumerically | Each group shall be sorted alphanumerically. | ||
The rationale for this is that Lustre is a strict superset of LNet functionality so there shouldn't be any LNet code that depends on Lustre headers, and Lustre headers should not override or otherwise conflict with kernel headers. Sorting alphabetically makes it easier to avoid duplicate header include and reduces the chance of patch conflicts if new headers are added at the end in separate patches. | |||
[[Category: Development]] | [[Category: Development]] |
Latest revision as of 16:30, 12 December 2016
When adding new #include files
Includes should be ordered in the following way:
- linux headers
- libcfs headers
- lnet headers
- lustre/include/lustre/* headers
- lustre/include/*
- *_internal.h and any other "local.h" files
Each group shall be sorted alphanumerically.
The rationale for this is that Lustre is a strict superset of LNet functionality so there shouldn't be any LNet code that depends on Lustre headers, and Lustre headers should not override or otherwise conflict with kernel headers. Sorting alphabetically makes it easier to avoid duplicate header include and reduces the chance of patch conflicts if new headers are added at the end in separate patches.