From patchwork Sun Dec 21 21:20:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1023 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352063; bh=1a7e/h7pj3u0Hizo4LoEeLVZqigrVDpyuaMs6Emq4H0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=j2gJC+LsmtZemtKIgrmMJT1zvqFH/w5tng6aEDAins9hymrL8DPsk8hO73KcvxeRY YVnsE40Qua+6RbMOm9ec3VGsRZ0L/Jk5zd4bEPLmE+bpIpdfVtdgOlszaP6AeEXfM8 yWoBk2H4lT4yVeV8h7edJOIoWoQjUACKiYUKLbAcuJV3FNdmJO1pCKcrivOqTybwCj WTwOGXis9/gG3wMDMlBiFu5HI9h1OongaY0YJ4Z0O9OcoqtpjXucPG4CW8OvfXhWO5 SrOBlu1apKF8wFYMcBR0IsSpT6UwSMoJZqRy/Hcn4ajw22YXBWRrmQgJk3iCze0QaZ RqHHg8YTrluBQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 71F5364D26 for ; Sun, 21 Dec 2025 14:21:03 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pNsAMhrg_xdQ for ; Sun, 21 Dec 2025 14:21:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352062; bh=1a7e/h7pj3u0Hizo4LoEeLVZqigrVDpyuaMs6Emq4H0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eKHZ9SSuyWQlmLVFRdiiU2yXGjxex62EfbFeGs5hDIRXErlX3AyTmaj8MSUJPIPOO zbW6nhfni2lDhTwPy0Uc71kWgl0hqVqqtin33NyfhSc6Wn7h1UfnLcQzmfLq6BGhFh lolQVex9nSG9UB/D1jrOsVN1uvFeKixbxoZNYSnW7HFXlgwNoQsa1D8nPvRLoeW9go Zg7QVgC8jIVy3uw6fnzcjlveGsloT7n6vN7r4PaLFH55mPsayCjNdBfdxSI1+53Z0N hDMbmfTaOoZeLGaHReBbSBcWBvDo9WGOxrFnRsVTnK23vjI+KpnNJOEhPE+iVRxrkP HhWciWp5umP8A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6813764CF3 for ; Sun, 21 Dec 2025 14:21:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352060; bh=b+W8jLmIWCa0CzdWdh92uwWFgd03W26wUaLMWWiqJYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YPrRPq3esxd4nLGF0NOQJTH+wQseLhpGAnCHYdivDqHHLQBP7PaAqMiAcMJH7O/nB nDPFQwqvYxMqvKj0pvOz1fFqN3KFDDQ0CKK7EhACPZu4xAERl0ojYoGQsKmlzooUOL +14ej530UXhfxIcVAybcaz7Efn3Dsdcu8EK3KSKXaBK+6+++6MpXQYrd+x5lf06JuH fdmwmZ2wa0nPyERNMSzBJtwuZ7iXtHVypeenmGvn95AVhr2Vs1TX5mwEQGtfBMgQgK h3K6wza2Jb2RvmvmcxpyzD33909V5JJFE7uCy578O0AKgJGAg3JvaY599EZdIAXALJ G+1vhI4z4ZqTQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5899A64D2A; Sun, 21 Dec 2025 14:21:00 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id z4lXcuHLkkdn; Sun, 21 Dec 2025 14:21:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352057; bh=ux822WVCKW8K74z3Z5kZeI23EMHi9R7UipWZPms767A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jlOrbmrUDz6q7ridGp9GWy+EgRcdPWi0pym1Aq9QIUlfBqRt1ogw5NgVZ/NvNXEVm cnD+SjzDHy7h1pQnrVZmsxLzc9iJfhs1/+HLbXLOVrTMKl0l4uDLqsxso8YQGMwQ5m P4Cxfk/Q5462kA2SsbWmSOxH8eq5WcjNBlLrBDO3Ri5Oz9RcSFjDcOCCdXwChPfevE ZMXWVHVwW8nCwMhIXlIdVupAB5KVCnBEKeiBW5GnB2lAIambBA9Rtt2dAh9pv6DUsl C8bBDhB301cPcS920oC/Y6JnA9Tu2Fy079d9uLOVUInkjN1Fye6FUf0OdwvFkTbrd9 lacMBt3jilyQg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8459564CDE; Sun, 21 Dec 2025 14:20:57 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 21 Dec 2025 14:20:17 -0700 Message-ID: <20251221212028.857348-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251221212028.857348-1-sjg@u-boot.org> References: <20251221212028.857348-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OYNCXPIAXSUZR3USUFMMWISJ3CJX6DO6 X-Message-ID-Hash: OYNCXPIAXSUZR3USUFMMWISJ3CJX6DO6 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/15] jbd2: Add revoke.c to the build List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add revoke.c to the jbd2 Makefile and update its includes to use the compatibility layer. Add stubs for hash_64 and __find_get_block_nonatomic() Remove JBD2 revoke function stubs that are now provided by revoke.c. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 ++++ fs/ext4l/stub.c | 57 +++++++++---------------------------------- fs/jbd2/Makefile | 2 +- fs/jbd2/revoke.c | 14 +---------- 4 files changed, 18 insertions(+), 60 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 25756d29cf6..f43c3a999f9 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1365,6 +1365,9 @@ typedef unsigned int projid_t; #include #define ilog2(n) (fls(n) - 1) +/* hash_64 - simple 64-bit hash */ +#define hash_64(val, bits) ((unsigned long)((val) >> (64 - (bits)))) + /* Trace stubs for inode.c */ #define trace_ext4_begin_ordered_truncate(...) do { } while (0) #define trace_ext4_evict_inode(...) do { } while (0) @@ -2569,6 +2572,8 @@ struct seq_operations { /* Block device operations */ #define sb_find_get_block_nonatomic(sb, block) \ ({ (void)(sb); (void)(block); (struct buffer_head *)NULL; }) +#define __find_get_block_nonatomic(bdev, block, size) \ + ({ (void)(bdev); (void)(block); (void)(size); (struct buffer_head *)NULL; }) #define bdev_discard_granularity(bdev) \ ({ (void)(bdev); 0U; }) diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index b1b5bb93cd8..989ae2c85c1 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -80,11 +80,7 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh) return 0; } -int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr, - struct buffer_head *bh) -{ - return 0; -} +/* jbd2_journal_revoke is now in revoke.c */ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh) { @@ -784,18 +780,9 @@ void jbd2_journal_refile_buffer(void *journal, void *jh) { } -void jbd2_clear_buffer_revoked_flags(void *journal) -{ -} - -void jbd2_journal_switch_revoke_table(void *journal) -{ -} - -void jbd2_journal_write_revoke_records(void *journal, void *transaction, - int write_flags) -{ -} +/* jbd2_clear_buffer_revoked_flags is now in revoke.c */ +/* jbd2_journal_switch_revoke_table is now in revoke.c */ +/* jbd2_journal_write_revoke_records is now in revoke.c */ void jbd2_buffer_abort_trigger(void *jh, void *triggers) { @@ -817,39 +804,17 @@ void __jbd2_journal_refile_buffer(void *jh) /* cond_resched_lock is now a macro in ext4_uboot.h */ /* - * JBD2 stubs for journal.c - functions from recovery.c, revoke.c, transaction.c + * JBD2 stubs for journal.c - functions from transaction.c */ -int jbd2_journal_destroy_revoke(void *journal) -{ - return 0; -} /* jbd2_journal_recover is now in recovery.c */ /* jbd2_journal_skip_recovery is now in recovery.c */ - -/* JBD2 stubs for recovery.c - functions from revoke.c */ -int jbd2_journal_init_revoke_table(void *journal) -{ - return 0; -} - -int jbd2_journal_test_revoke(void *journal, unsigned long blocknr, unsigned int tid) -{ - return 0; -} - -int jbd2_journal_set_revoke(void *journal, unsigned long blocknr, unsigned int tid) -{ - return 0; -} - -void jbd2_journal_clear_revoke(void *journal) -{ -} - -void jbd2_journal_destroy_revoke_table(void *table) -{ -} +/* jbd2_journal_destroy_revoke is now in revoke.c */ +/* jbd2_journal_init_revoke_table is now in revoke.c */ +/* jbd2_journal_test_revoke is now in revoke.c */ +/* jbd2_journal_set_revoke is now in revoke.c */ +/* jbd2_journal_clear_revoke is now in revoke.c */ +/* jbd2_journal_destroy_revoke_table is now in revoke.c */ void jbd2_buffer_frozen_trigger(void *jh, void *mapped_data, void *triggers) { diff --git a/fs/jbd2/Makefile b/fs/jbd2/Makefile index bcc1f47177b..5501c364abc 100644 --- a/fs/jbd2/Makefile +++ b/fs/jbd2/Makefile @@ -3,4 +3,4 @@ # Makefile for JBD2 journaling layer (used by ext4l) # -obj-y := checkpoint.o commit.o journal.o recovery.o +obj-y := checkpoint.o commit.o journal.o recovery.o revoke.o diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index 1467f679074..b5e6fa6cf96 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c @@ -77,20 +77,8 @@ * needed. */ -#ifndef __KERNEL__ -#include "jfs_user.h" -#else -#include -#include +#include "../ext4l/ext4_uboot.h" #include -#include -#include -#include -#include -#include -#include -#include -#endif static struct kmem_cache *jbd2_revoke_record_cache; static struct kmem_cache *jbd2_revoke_table_cache;