iput_if_not_last(9)
π iput_if_not_last β from the Kernel API Manual, bestie π
okay so real talk, this one lives in the <pink>Kernel API Manual</pink> and it's called iput_if_not_last β yes that's the man page name, and yes it's exactly what it sounds like it is, no cap.
πΈ NAME πΈ
iput_if_not_last β drop an inode reference only if it is not the last one π
β¨ SYNOPSIS β¨
bool iput_if_not_last (struct inode *inode );
that's it. that's the whole vibe check. π¦
π ARGUMENTS π
inodeβ the inode to put π«Ά (like, the star of the show)
π DESCRIPTION π
so here's the tea, bestie: it returns true if the reference was dropped β slay β and false if this was the last reference π€ in which case the caller must arrange for the final iput in a safe context. periodt. no shortcuts, the rules are the rules π
lowkey important: if you getfalseback, that's your cue β you gotta line up the finaliputsomewhere safe. don't just leave it hanging, that's not the move π
π SEE ALSO π
Kernel file ./include/linux/fs.h and honestly the whole friend group:
enum positive_aop_returns(9)struct address_space(9)struct file_ra_state(9)struct file(9)i_uid_into_vfsuid(9)i_uid_needs_update(9)i_uid_update(9)i_gid_into_vfsgid(9)i_gid_needs_update(9)i_gid_update(9)inode_fsuid_set(9)inode_fsgid_set(9)fsuidgid_has_mapping(9)inode_set_ctime(9)file_write_started(9)file_write_not_started(9)struct renamedata(9)is_mgtime(9)is_idmapped_mnt(9)file_start_write(9)file_end_write(9)kiocb_start_write(9)kiocb_end_write(9)name_is_dot_dotdot(9)name_contains_dotdot(9)inode_dio_begin(9)inode_dio_end(9)generic_ci_validate_strict_name(9)
and that's the whole page, bestie π§ thanks for reading, mwah π
source: ./include/linux β dated: October 2026 β catch you in the next man page, ily π
π¦ 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