STRUCT SYNC_FILE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct sync_file(9) β€” a Kernel API Manual moment πŸŽ€

okay bestie, we're in the struct sync_file(9) girlie-verse today β€” this is the kernel API manual page for the little struct that lets you export a sync file to userspace ✨


🌸 NAME 🌸

struct sync_file β€” sync file to export to the userspace πŸ’«


✨ SYNOPSIS ✨

struct sync_file {
    struct file             *file;
    char user_name[32];
  #ifdef CONFIG_DEBUG_FS;
    struct list_head        sync_file_list;
  #endif;
    wait_queue_head_t wq;
    unsigned long           flags;
    struct dma_fence        *fence;
    struct dma_fence_cb cb;
 };

no cap, that's the whole vibe right there πŸ‘‘ copy it exactly, she's precise πŸ’…


πŸ¦‹ Members πŸ¦‹

  • file β€” the file representing this fence. lowkey the whole main character of the struct 🫢
  • user_name β€” the name of the sync file, handed to us by userspace β€” but only for merged fences, bestie. otherwise it's generated through driver callbacks, and in that case the entire array is 0 πŸ’€ (yes, literally the whole thing, all zeroes)
  • sync_file_list β€” membership in the global file list πŸ“‹ psst: this one's tucked inside the #ifdef CONFIG_DEBUG_FS; so she only shows up when debug fs is in the building πŸŽ€
  • wq β€” wait queue for fence signaling ⏳ this is where everybody waits around for the signal, iconic behavior honestly
  • flags β€” flags for the sync_file 🚩
  • fence β€” fence with the fences in the sync_file πŸ”₯ (yes, fences plural, she contains multitudes)
  • cb β€” fence callback information πŸ“ž the callback deets live here

🌈 Description 🌈

flags time, bestie: POLL_ENABLED β€” whether userspace is currently poll'ing or not πŸ‘€ that's it, that's the flag. simply asking "are you polling rn?"


πŸ’œ SEE ALSO πŸ’œ

  • Kernel file ./include/linux/sync_file.h β€” go read her, iykyk πŸ“–

and that's a wrap on this one, gorgeous 🌟 this came to you from ./include/linux, dated October 2026, and yes β€” it's still struct sync_file(9), always and forever πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from