From patchwork Sun Dec 21 21:20:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1019 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=1766352057; bh=Je8rWcAAAmUENsqtoHgLjBK7T+clNvACjwyZ2sBbE9o=; 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=m4S+hzSQqaHx5j/yfHThKj7vfnd9aWgN98I/YiVxQUWx+sZHrj1f74oNqVKP2NWS6 Xk8RrMMWEgUCnuo5uk4+coViVDitxvO2PODx1mULN9NViNn+rih58J8FpkXjwvcrZu AXc9UGw+NBvFozdev/P47Yxr1ehJTIJ9HDQhYxJ9aLl5KufnIFspOlHnEqmg/dE4FW ir1K7FNKVjk4ubiK4LyyLM1DR1gd6gpaBifPF+G+/SevymA9OIUlSFj7CvRQ+L7BlB 7pEkQdl+rW6/4uZCv24BEpbbrehXkZqE3dfgZAJh8mbjnYgo7nixSprd2DXG2dZcC4 rwenQCBOIm3dA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1A1364D14 for ; Sun, 21 Dec 2025 14:20:57 -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 rXxSXw0PGcJJ for ; Sun, 21 Dec 2025 14:20:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352057; bh=Je8rWcAAAmUENsqtoHgLjBK7T+clNvACjwyZ2sBbE9o=; 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=m4S+hzSQqaHx5j/yfHThKj7vfnd9aWgN98I/YiVxQUWx+sZHrj1f74oNqVKP2NWS6 Xk8RrMMWEgUCnuo5uk4+coViVDitxvO2PODx1mULN9NViNn+rih58J8FpkXjwvcrZu AXc9UGw+NBvFozdev/P47Yxr1ehJTIJ9HDQhYxJ9aLl5KufnIFspOlHnEqmg/dE4FW ir1K7FNKVjk4ubiK4LyyLM1DR1gd6gpaBifPF+G+/SevymA9OIUlSFj7CvRQ+L7BlB 7pEkQdl+rW6/4uZCv24BEpbbrehXkZqE3dfgZAJh8mbjnYgo7nixSprd2DXG2dZcC4 rwenQCBOIm3dA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 920B264D11 for ; Sun, 21 Dec 2025 14:20:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352055; bh=lzigXG9yiihDpNSgLhr1tmproPqTDymWA0vfVU5pzro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=btjMo0wjXomLTp43fKTlv+gg+BMZ/r5Wv5fMkoFUOtKEq6FFceXZ2JSUKUVnUY/Ka 8w2Aeyz+HEEtoxnYWVF9C3MGyzX3mLN/oUCA1UrlCoQ7Gw0zYEpKfqyGsBW90LE3Lz Fgiz4Fh2ll6ND32u6BUQD6KOX9LcveDYc1XM2kmV5w7CYmVUvYTalVVp6Muip556wu gFsaV43wCSZ7C9iP3UKgKfKWHRW6pRASRicLe4ej7yx+EG0JZLL2L4L4fk3+3yY7Ws Wj19CHgv5SAdO+8MnaA73rgHz7rLxOOhTAvXv7uWoxUtDXT2UQFXqG8fKy3KNsYF4a ASDGrPolXBB5Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AD42C64CF2; Sun, 21 Dec 2025 14:20:55 -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 PzgFE0kIm1eH; Sun, 21 Dec 2025 14:20:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352054; bh=2Wy+R7hNl353fO+8eX/fVr/DIifRaHWJt98b9nD/9kE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C6TBv3t5ujxOruhDwi3HnBY3d7tkJntfUp38hq59dpa37PbSrxp1BFyDWGbreR3Ip FHAmz2G+gZTiP7Zk6aT7auB6qxPboptPhNxu5Xx5xEYpAF8V9XUhF3XJ0UcMjOdieg LXCawY4iy/wXRRqBHa3z1IAjNdq6ETStEklJSViDh2eUBp5/lLKmYe8tiMWeopFLjq EEUmoAehJ2Nj21Qy8zex6rqzHOtAH7BnW4SHG4HcdntS+OsxL7k2d+zeDsQDV5VNWa EccKKxpNo1QsS1gQUbnb03EvYKIoaS5aWZuLOSi3VxDgwrg9adKvZiMCLJ9Sy7ZO0R urva0/2diDpDg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 52C7E64CBD; Sun, 21 Dec 2025 14:20:54 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 21 Dec 2025 14:20:14 -0700 Message-ID: <20251221212028.857348-7-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: VAIHA6VDLYII542N7SRA7DPDUAGZPAQZ X-Message-ID-Hash: VAIHA6VDLYII542N7SRA7DPDUAGZPAQZ 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 06/15] jbd2: Add checkpoint.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 Update checkpoint.c includes to use ext4_uboot.h compatibility layer. Add jbd2/Makefile and include jbd2 in the build via fs/Makefile Add necessary stubs and definitions: - JBD2 trace stubs (trace_jbd2_checkpoint, etc.) - mutex_lock_io, write_dirty_buffer, spin_needbreak stubs - bd_dev field to struct block_device - Temporary JBD2 function stubs until other jbd2 files are added Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/Makefile | 1 + fs/ext4l/ext4_uboot.h | 14 ++++++++++++++ fs/ext4l/stub.c | 33 +++++++++++++++++++++++++++++++++ fs/jbd2/Makefile | 6 ++++++ fs/jbd2/checkpoint.c | 7 +------ include/linux/fs.h | 1 + 6 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 fs/jbd2/Makefile diff --git a/fs/Makefile b/fs/Makefile index a7d5df10424..b6d4f7a9cf7 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -22,6 +22,7 @@ obj-$(CONFIG_CMD_CRAMFS) += cramfs/ obj-$(CONFIG_FS_EXFAT) += exfat/ obj-$(CONFIG_FS_EXT4) += ext4/ obj-$(CONFIG_FS_EXT4L) += ext4l/ +obj-$(CONFIG_FS_EXT4L) += jbd2/ obj-$(CONFIG_FS_FAT) += fat/ obj-$(CONFIG_FS_JFFS2) += jffs2/ obj-$(CONFIG_SANDBOX) += sandbox/ diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 82b68056953..62815e334c8 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -2768,4 +2768,18 @@ struct wait_bit_entry { /* get_current_ioprio - I/O priority (not used in U-Boot) */ #define get_current_ioprio() (0) +/* JBD2 checkpoint.c stubs */ +#define mutex_lock_io(m) mutex_lock(m) +#define write_dirty_buffer(bh, flags) sync_dirty_buffer(bh) +#define spin_needbreak(l) ({ (void)(l); 0; }) + +/* JBD2 trace stubs */ +#define trace_jbd2_checkpoint(j, r) do { (void)(j); (void)(r); } while (0) +#define trace_jbd2_shrink_checkpoint_list(j, f, t, l, n, d) \ + do { (void)(j); (void)(f); (void)(t); (void)(l); (void)(n); (void)(d); } while (0) +#define trace_jbd2_checkpoint_stats(d, tid, stats) \ + do { (void)(d); (void)(tid); (void)(stats); } while (0) +#define trace_jbd2_drop_transaction(j, t) \ + do { (void)(j); (void)(t); } while (0) + #endif /* __EXT4_UBOOT_H__ */ diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 2b2b777d1f2..0458191c496 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -827,3 +827,36 @@ int dquot_alloc_block(struct inode *inode, loff_t nr) void dquot_free_block(struct inode *inode, loff_t nr) { } + +/* + * JBD2 stubs - temporary stubs until other jbd2 files are added + * Note: These use void* to avoid pulling in jbd2.h types which would conflict + */ + +int jbd2_journal_get_log_tail(void *journal, void *tid, unsigned long *block) +{ + return 0; +} + +int __jbd2_update_log_tail(void *journal, unsigned int tid, unsigned long block) +{ + return 0; +} + +void *jbd2_journal_grab_journal_head(struct buffer_head *bh) +{ + return NULL; +} + +void jbd2_journal_put_journal_head(void *jh) +{ +} + +void jbd2_journal_free_transaction(void *transaction) +{ +} + +int jbd2_log_start_commit(void *journal, unsigned int tid) +{ + return 0; +} diff --git a/fs/jbd2/Makefile b/fs/jbd2/Makefile new file mode 100644 index 00000000000..03e8ba0f2ec --- /dev/null +++ b/fs/jbd2/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for JBD2 journaling layer (used by ext4l) +# + +obj-y := checkpoint.o diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 2d0719bf6d8..994e454bb5b 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -14,13 +14,8 @@ * reused. */ -#include -#include +#include "../ext4l/ext4_uboot.h" #include -#include -#include -#include -#include /* * Unlink a buffer from a transaction checkpoint list. diff --git a/include/linux/fs.h b/include/linux/fs.h index ae34b1f7356..ef28c12c022 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -65,6 +65,7 @@ struct block_device { struct address_space *bd_mapping; void *bd_disk; struct super_block *bd_super; + dev_t bd_dev; }; /* errseq functions - stubs */