STRUCT MEDIA_REQUEST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct media_request(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ β€” yes, THE Kernel API Manual, the one we all gagged over. today's main character is struct media_request, aka Media device request. she's giving kernel-internals-realness and honestly? obsessed πŸŽ€


🌸 NAME 🌸

struct media_request β€” Media device request πŸ¦‹

like, that's her. that's the whole name. periodt.


✨ SYNOPSIS ✨

no cap, here's the literal struct, copied with love and zero typos πŸ’–:

struct media_request {
    struct media_device *mdev;
    struct kref kref;
    char debug_str[TASK_COMM_LEN + 11];
    enum media_request_state state;
    unsigned int updating_count;
    unsigned int access_count;
    struct list_head objects;
    unsigned int num_incomplete_objects;
    bool manual_completion;
    wait_queue_head_t poll_wait;
    spinlock_t lock;
};

she's a whole vibe check in struct form, iykyk πŸ’…


🧚 Members 🧚

okay so this is the part where we meet the squad, one field at a time β€” every single one, no skipping, fr fr:

  • mdev β€” the Media device this request belongs to 🫢 like, her home base, her origin story.
  • kref β€” Reference count ⭐ the classic "how many people are holding hands with me right now" counter.
  • debug_str β€” Prefix for debug messages (process name:fd) πŸ” so when she talks in debug logs, she introduces herself properly, process name:fd style.
  • state β€” The state of the request 🌈 literally what mood she's in, structurally speaking. the type is enum media_request_state, in case you were wondering πŸ‘€
  • updating_count β€” count the number of request updates that are in progress πŸ”₯ keeping track of how many update situations are currently mid-happening.
  • access_count β€” count the number of request accesses that are in progress πŸ’œ same energy, but for accesses. very "how many people are looking at me rn" of her.
  • objects β€” List of struct media_request_object request objects πŸŽ€ it's a struct list_head, and it's exactly what it sounds like: the guest list.
  • num_incomplete_objects β€” The number of incomplete objects in the request πŸ“ the little counter of things that aren't done yet. she's tracking them, don't worry.
  • manual_completion β€” if true, then the request won't be marked as completed when num_incomplete_objects reaches 0. Call media_request_manual_complete to complete the request after num_incomplete_objects == 0. πŸ™ˆ so like, she does NOT auto-complete herself and that's a whole thing β€” you have to do it by hand with media_request_manual_complete, and only after num_incomplete_objects == 0. read that twice bestie, it matters πŸ’€
  • poll_wait β€” Wait queue for poll ⏳ the waiting room where poll hangs out.
  • lock β€” Serializes access to this struct πŸ”’ the bouncer at the door. nobody gets in out of order.
lowkey important: manual_completion being a "no auto-complete" switch is real behavior, not a fun fact. don't be out here expecting her to finish herself πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, linked with love β€” Kernel file ./include/media/media-request.h plus every single one of these 🌟:


πŸŽ€ that's the whole page, bestie. you ate that. and for the record, this lil masterpiece lives in ./include/media and it's dated October 2026 β€” so yeah, future icon behavior πŸ’œπŸ¦‹βœ¨ periodt.

πŸ“¦ where this page comes from