Lustre Style Guide Includes

From Lustre Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

When adding new #include files

Includes should be ordered in the following way:

  1. linux headers
  2. libcfs headers
  3. lnet headers
  4. lustre/include/lustre/* headers
  5. lustre/include/*
  6. *_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.