From: Li Chen Date: Fri, 6 Mar 2026 08:56:39 +0000 (+0800) Subject: jbd2: add jinode dirty range accessors X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5267f6ef49cb5fba426f2d286817b1355fde31da;p=thirdparty%2Fkernel%2Flinux.git jbd2: add jinode dirty range accessors Provide a helper to fetch jinode dirty ranges in bytes. This lets filesystem callbacks avoid depending on the internal representation, preparing for a later conversion to page units. Suggested-by: Andreas Dilger Reviewed-by: Jan Kara Signed-off-by: Li Chen Link: https://patch.msgid.link/20260306085643.465275-2-me@linux.beauty Signed-off-by: Theodore Ts'o --- diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index a53a00d36228c..64392baf5f4b4 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -445,6 +445,20 @@ struct jbd2_inode { loff_t i_dirty_end; }; +static inline bool jbd2_jinode_get_dirty_range(const struct jbd2_inode *jinode, + loff_t *start, loff_t *end) +{ + loff_t start_byte = jinode->i_dirty_start; + loff_t end_byte = jinode->i_dirty_end; + + if (!end_byte) + return false; + + *start = start_byte; + *end = end_byte; + return true; +} + struct jbd2_revoke_table_s; /**