folio_trylock(9)
πΈ folio_trylock(9) πΈ
okay so bestie, welcome to the Kernel API Manual π this is the page for folio_trylock(9), and it's giving βjust try the lock, no big dramatic waitβ energy. β¨
π NAME π
folio_trylock β Attempt to lock a folio.
π¦ SYNOPSIS π¦
bool folio_trylock (struct folio *folio );
π ARGUMENTS π
folioβ The folio to attempt to lock. that's the whole arg, periodt π«Ά
β¨ DESCRIPTION β¨
Sometimes it is undesirable to wait for a folio to be unlocked (eg when the locks are being taken in the wrong order, or if making progress through a batch of folios is more important than processing them in order). Usually folio_lock is the correct function to call.
ngl, that βUsuallyfolio_lockis the correct function to callβ line is the main character warning here β don't just grabfolio_trylockbecause the name sounds cute. π
π CONTEXT π
Any context. literally any. no cap. π¦
π RETURN π
Whether the lock was successfully acquired. yes, that's the whole return vibe β a lil success check. π
π₯ SEE ALSO π₯
Kernel file ./include/linux/pagemap.h β yes, that exact one β plus this whole squad of besties:
filemap_set_wb_err(9)filemap_check_wb_err(9)filemap_sample_wb_err(9)file_sample_sb_err(9)mapping_set_error(9)mapping_set_large_folios(9)mapping_align_index(9)mapping_pmd_folio_support(9)folio_flush_mapping(9)folio_inode(9)folio_attach_private(9)folio_change_private(9)folio_detach_private(9)fgf_t(9)fgf_set_order(9)write_begin_get_folio(9)filemap_get_folio(9)filemap_lock_folio(9)filemap_grab_folio(9)find_get_page(9)find_lock_page(9)find_or_create_page(9)grab_cache_page_nowait(9)folio_next_index(9)folio_next_pos(9)folio_file_page(9)folio_contains(9)page_pgoff(9)folio_pos(9)linear_page_delta(9)linear_page_index(9)linear_anon_page_index(9)folio_lock(9)lock_page(9)folio_lock_killable(9)filemap_range_needs_writeback(9)struct readahead_control(9)page_cache_sync_readahead(9)page_cache_async_readahead(9)readahead_folio(9)readahead_pos(9)readahead_length(9)readahead_index(9)readahead_count(9)readahead_batch_length(9)folio_mkwrite_check_truncate(9)i_blocks_per_folio(9)
okay that's the whole page π the source/version bit is ./include/linux, and the date is October 2026 β go forth and try your locks, bestie, slay π
β¨
π¦ 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