public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Chen <me@linux.beauty>
To: Theodore Ts'o <tytso@mit.edu>, Jan Kara <jack@suse.cz>,
	Mark Fasheh <mark@fasheh.com>,
	linux-ext4@vger.kernel.org, ocfs2-devel@lists.linux.dev,
	Jan Kara <jack@suse.com>,
	linux-kernel@vger.kernel.org
Cc: Andreas Dilger <adilger@dilger.ca>, Li Chen <me@linux.beauty>
Subject: [PATCH v3 1/4] jbd2: add jinode dirty range accessors
Date: Tue, 24 Feb 2026 17:24:30 +0800	[thread overview]
Message-ID: <20260224092434.202122-2-me@linux.beauty> (raw)
In-Reply-To: <20260224092434.202122-1-me@linux.beauty>

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>
Signed-off-by: Li Chen <me@linux.beauty>
---
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.52.0

  reply	other threads:[~2026-02-24  9:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24  9:24 [PATCH v3 0/4] jbd2/ext4/ocfs2: lockless jinode dirty range Li Chen
2026-02-24  9:24 ` Li Chen [this message]
2026-03-02 18:07   ` [PATCH v3 1/4] jbd2: add jinode dirty range accessors Jan Kara
2026-02-24  9:24 ` [PATCH v3 2/4] ext4: use jbd2 jinode dirty range accessor Li Chen
2026-02-24  9:24 ` [PATCH v3 3/4] ocfs2: " Li Chen
2026-03-02 18:07   ` Jan Kara
2026-02-24  9:24 ` [PATCH v3 4/4] jbd2: store jinode dirty range in PAGE_SIZE units Li Chen
2026-03-02 18:27   ` Jan Kara
2026-03-03  9:01     ` Jan Kara
2026-03-06  5:44       ` Li Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260224092434.202122-2-me@linux.beauty \
    --to=me@linux.beauty \
    --cc=adilger@dilger.ca \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox