ENUM BUF_END_ALIGN_TYPE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– enum buf_end_align_type(9) πŸ’–

ok so bestie, this is a page from the Kernel API Manual and it's literally all about enum buf_end_align_type β€” which is honestly such a main character name. it's about how a buffer's end lines up with pages, relative to where the previous buffer ended. page alignment drama, basically. let's get into it πŸŽ€


✨ NAME ✨

enum buf_end_align_type β€” page alignment of a buffer end with regard to the end of the previous buffer. that's it, that's the vibe πŸ¦‹


✨ SYNOPSIS ✨

enum buf_end_align_type {
    SAME_PAGE_UNALIGNED ,
    SAME_PAGE_ALIGNED ,
    NEXT_PAGE_UNALIGNED ,
    NEXT_PAGE_ALIGNED ,
    NEXT_NEXT_UNALIGNED ,
    LOOP_END

};

✨ Constants ✨

okay so here's the whole cast of characters, one by one πŸ‘‘

  • SAME_PAGE_UNALIGNED β€” the end of this buffer is on the same page as the end of the previous buffer, and it is not page aligned. examples: buf1 ][ buf2 ][ ... and buf1 ]|[ buf2 ][ ... πŸ’…
  • SAME_PAGE_ALIGNED β€” so when the end of the previous buffer is not page aligned, the end of this buffer is on the same page as the end of the previous buffer and it is page aligned. but when the previous buffer is page aligned, the end of this buffer is aligned to the next page boundary. examples: buf1 ][ buf2 ]| ... and buf1 ]|[ buf2 ]| ... ✨
  • NEXT_PAGE_UNALIGNED β€” the end of this buffer is on the page next to the end of the previous buffer, and it is not page aligned. examples: buf1 ][ buf2 | buf2 ][ ... and buf1 ]|[ buf2 | buf2 ][ ... 🌸
  • NEXT_PAGE_ALIGNED β€” the end of this buffer is on the page next to the end of the previous buffer, and it is page aligned. examples: buf1 ][ buf2 | buf2 ]| ... and buf1 ]|[ buf2 | buf2 ]| ... πŸ”₯
  • NEXT_NEXT_UNALIGNED β€” the end of this buffer is on the page that follows the page after the end of the previous buffer, and it is not page aligned. examples: buf1 ][ buf2 | buf2 | buf2 ][ ... and buf1 ]|[ buf2 | buf2 | buf2 ][ ... 😭 (yes the name is a mouthful, no I will not be shortening it)
  • LOOP_END β€” the number of enum values in buf_end_align_type. it's used for controlling loop termination. so like, it's the "we're done here" counter 🫢

🌈 Description 🌈

in the pictures below, buf2 refers to the buffer we are aligning. buf1 refers to the previous buffer by addr. symbol [ means the start of a buffer, ] means the end of a buffer, and | means page boundaries. iykyk πŸ’«

ngl the symbols are doing a lot of heavy lifting here, so stare at those little diagrams until the alignment clicks. it's giving "ascii art but make it kernel" 🎨

πŸ¦‹ SEE ALSO πŸ¦‹


okay periodt, that's the whole page bestie, you're officially an alignment expert now πŸ‘‘

and for the cute sign-off: this gem comes from ./drivers/android/tests and it's dated October 2026 β€” so yeah, future vibes. mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from