fs_bdev_file_open_by_path(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ fs_bdev_file_open_by_path(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’– this one is literally the "hey block device, meet your new superblock" page and it's giving matchmaker energy fr fr πŸŽ€


🌸 NAME 🌸

fs_bdev_file_open_by_path β€” claim a block device on behalf of a superblock 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

struct file * fs_bdev_file_open_by_path (const char *path , blk_mode_t
mode , void *holder , struct super_block *sb );

like, that's the whole vibe. four args, one struct file * back at you (or a plot twist, see RETURN below 😭) ✨


πŸ’… ARGUMENTS πŸ’…

  • path β€” path to the block device. yep, just the path. go find your blkdev queen πŸ‘‘
  • mode β€” open mode. how you're coming at it, basically 🌈
  • holder β€” block-layer exclusivity token. and no, not just anything β€” it's a superblock, or the file_system_type when the device may be shared by several superblocks of that type. iykyk πŸ’€
  • sb β€” superblock to drive fs_holder_ops events for. this is the main character of this whole operation ngl ⭐

πŸ’– DESCRIPTION πŸ’–

so what it does is: open the block device at path with fs_holder_ops and register that sb uses it β€” so device removal/sync/freeze/thaw are propagated to sb (and any other superblock sharing the device). the way that one call sets up the whole group chat 😭πŸ”₯

⚠️ important bestie: this must be paired with fs_bdev_file_release. don't leave it hanging, that's so not slay πŸ™ˆ

πŸŽ€ RETURN πŸŽ€

an opened block-device file or an ERR_PTR. so like, either a cute file or a sad little error pointer β€” vibe check accordingly πŸ’…


🌟 SEE ALSO 🌟

all the siblings and cousins and extended family, we love a big family tree πŸ§šβ€β™€οΈ:

Kernel file ./fs/super.c β€” plus: super_lock(9), alloc_super(9), deactivate_locked_super(9), deactivate_super(9), grab_super(9), retire_super(9), generic_shutdown_super(9), sget_fc(9), iterate_supers_type(9), reconfigure_super(9), emergency_thaw_all(9), get_anon_bdev(9), sget_dev(9), fs_bdev_freeze(9), fs_bdev_thaw(9), fs_bdev_file_open_by_dev(9), fs_bdev_unregister(9), fs_bdev_file_release(9), get_tree_bdev_flags(9), get_tree_bdev(9), vfs_get_tree(9), sb_wait_write(9), freeze_super(9), thaw_super(9)


and that's the page!! πŸ“ she lives in ./fs, she's stamped October 2026, and she answers to the name fs_bdev_file_open_by_path(9) β€” periodt, love u, go pair your release calls πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from