ubifs_jnl_truncate(9)
π ubifs_jnl_truncate(9) β like, the kernel API manual entry, bestie π
okay so this is ubifs_jnl_truncate, straight out of the Kernel API Manual bestie, and it's genuinely the moment a file gets shorter and the journal has to keep up β¨
πΈ NAME πΈ
ubifs_jnl_truncate β update the journal for a truncation.
π¦ SYNOPSIS π¦
int ubifs_jnl_truncate (struct ubifs_info *c , const struct inode *inode
, loff_t old_size , loff_t new_size );
π ARGUMENTS π
cβ the UBIFS file-system description object. your whole file-system's main character, fr fr πinodeβ the inode to truncate. yeah. that one. βοΈold_sizeβ old size. the before pic πΈnew_sizeβ new size. the after pic π
β¨ DESCRIPTION β¨
so when the size of a file decreases due to truncation, a truncation node is written, the journal tree is updated, and the last data block is re-written if it has been affected π like the last data block literally gets dragged back into the group chat. the inode is also updated in order to synchronize the new inode size β nobody's walking around with a stale size, not on her watch π«Ά
this function marks the inode as clean and returns zero on success. in case of failure, a negative error code is returned. periodt. π
ngl bestie, success is 0 and failure is a negative error code β so like, don't go looking for a positive return value, it's not giving π
π₯ SEE ALSO π₯
kernel file ./fs/ubifs/journal.c β and honestly the whole friend group shows up:
zero_ino_node_unused(9)zero_dent_node_unused(9)zero_trun_node_unused(9)reserve_space(9)write_head(9)__queue_and_wait(9)wait_for_reservation(9)wake_up_reservation(9)add_or_start_queue(9)make_reservation(9)release_head(9)finish_reservation(9)get_dent_type(9)pack_inode(9)mark_inode_clean(9)ubifs_jnl_update(9)ubifs_jnl_write_data(9)ubifs_jnl_write_inode(9)ubifs_jnl_delete_inode(9)ubifs_jnl_xrename(9)ubifs_jnl_rename(9)truncate_data_node(9)ubifs_jnl_delete_xattr(9)ubifs_jnl_change_xattr(9)
β ok that's the whole page, no notes π this one's from ./fs/ubifs, dated October 2026, and it's literally titled ubifs_jnl_truncate(9) β iykyk, slay, bye bestie π§π
π¦ 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