fs_bdev_file_open_by_path(9)
β¨ 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 thefile_system_typewhen the device may be shared by several superblocks of that type. iykyk πsbβ superblock to drivefs_holder_opsevents 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms