lkml.org 
[lkml]   [2026]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 1/4] jbd2: add jinode dirty range accessors
Date
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 <adilger@dilger.ca>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Li Chen <me@linux.beauty>
---
Changes since v3:
- Add Reviewed-by: Jan Kara.

Changes since v2:
- New patch: add jbd2_jinode_get_dirty_range() helper.

include/linux/jbd2.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)

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;

/**
--
2.53.0
\
 
 \ /
  Last update: 2026-03-06 10:06    [W:0.099 / U:4.690 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog