From patchwork Mon Dec 22 11:56: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: 1040 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=1766404647; bh=1ZvKAlPWM0djR/L0bF5kZA9Mkw/QQs2WQ5xkW9cR/Mo=; 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=vQRowNdv4fEKKj73gxdSg313eG46FpymFxFDdEG5rR1kAfXMwL4Y+heRBQkZKjsFO ckZWtgSSKaiLMdFrS4ujoAywlkcnLjlG29PYNziqAgfWQpf11p+BNoJmyLFsRaiBvS fCqGjuIXtguE1lYmEj4UZYOhR7NaDfNEv4woThWB/x7frWJovn4iM2Wxo0SUKY8enU qg8+lsd/fhgyM82SnXr+ef678Fz+VeRZDkH6GaLU3wFoJTT69siF3Ye0WkvjeKhe98 EYGgl0NV0AvGX0HhyRRZX2K5QYiAJijQ4K7wb25RZlB1etb+VdFn5koErblnIDhKnt NBDL4k1on10Og== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D68664D66 for ; Mon, 22 Dec 2025 04:57:27 -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 CCh_Z2RwZxXo for ; Mon, 22 Dec 2025 04:57:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766404647; bh=1ZvKAlPWM0djR/L0bF5kZA9Mkw/QQs2WQ5xkW9cR/Mo=; 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=vQRowNdv4fEKKj73gxdSg313eG46FpymFxFDdEG5rR1kAfXMwL4Y+heRBQkZKjsFO ckZWtgSSKaiLMdFrS4ujoAywlkcnLjlG29PYNziqAgfWQpf11p+BNoJmyLFsRaiBvS fCqGjuIXtguE1lYmEj4UZYOhR7NaDfNEv4woThWB/x7frWJovn4iM2Wxo0SUKY8enU qg8+lsd/fhgyM82SnXr+ef678Fz+VeRZDkH6GaLU3wFoJTT69siF3Ye0WkvjeKhe98 EYGgl0NV0AvGX0HhyRRZX2K5QYiAJijQ4K7wb25RZlB1etb+VdFn5koErblnIDhKnt NBDL4k1on10Og== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3BAC464CCE for ; Mon, 22 Dec 2025 04:57:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766404644; bh=SCt0hx1GC16NithRuzvQ5R5E+gh5vY+r7e0SIrb/pgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LZ4aPpDHoDohwAilNBRT50+hPRDq+GdkFj5u6i4N2Untxxju3F1Xcw9T58mtE6lK/ jxZcrFvch4k73nv+nyQk0DwpvZgfHSOqlPrZ44ujp/+jhiXFc5xzU03asKCkURTnI0 i1Xr/KjMfv+AjY3WLDJPVNDYKPm0VVir0LfeycQeLkTzB2NF3q6cqQro3MWG/Ct+df akUztmregeFwry+PEJEgII0bcVpK32JNxONL2GXtaBPor5WRAodFwYQRrm3EUFOpuS u1GnLs7rysnh3W3tC/FlndedJGGxAGOnx8iYGBUL2g6mpbhzyrher7GPMAkwebfzpG 9GfdF8DU/Pamw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2CF7964D66; Mon, 22 Dec 2025 04:57:24 -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 uEYcMzPSRbTh; Mon, 22 Dec 2025 04:57:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766404642; bh=1GuK01G+Y+FXIBsXA1lr4AGfyFFFIJ1VFreD99RzMD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sR+Y+QIiPJZPZZPaOG01Kp0dWW4qbXXeOOIHTAang2jJZVzyMMARTbq3FeADsohDR sPJuw1fLjK7HgcaN+pVIupadiaUbRH+yjNb3NE3DfvbE0PXr+S1UXk2TsCoo8CwazY SjW2jgm+9oOg2FcbGbXkcg3mnNbfFEm85LqvrBybeKdcGCg+ku6JMgue+dV7wFNqch wQaPGsxa8Gv9/VwpdjxjUbD4dZHMu/xavsZwOguA1/KrK358Bco4tSBNAtylk/DMrX CD+23Qp3QQ8xtZAWZtts9fRkJ7LPBc+FU7t8PBAuZyFfYY0CJwf+EbA6MOhZlNdVXB C6FcmJR0o9mGw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6114A5FB5A; Mon, 22 Dec 2025 04:57:22 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Dec 2025 04:56:14 -0700 Message-ID: <20251222115639.700578-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251222115639.700578-1-sjg@u-boot.org> References: <20251222115639.700578-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VUPYOIAAFYX5NY3KLUD76Q2QUVYT6FBE X-Message-ID-Hash: VUPYOIAAFYX5NY3KLUD76Q2QUVYT6FBE 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/26] fs: ext4l: Use types from linux headers 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 ext4_uboot.h to include the new linux headers instead of defining types locally. Remove duplicate definitions of: - MAX_JIFFY_OFFSET (now in linux/jiffies.h) - BDEVNAME_SIZE (now in linux/blkdev.h) - rwlock_t (now in linux/spinlock.h) Remove rwlock_init() stub from stub.c since it's now a macro. Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 23 +++++++---------------- fs/ext4l/stub.c | 8 ++++---- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index d0e60c02d77..1f823ba6ea3 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -58,14 +58,12 @@ struct timespec64 { /* * ktime_t, sector_t are in linux/types.h * atomic_t, atomic64_t are in asm-generic/atomic.h + * MAX_JIFFY_OFFSET is in linux/jiffies.h + * BDEVNAME_SIZE is in linux/blkdev.h */ #include - -/* Jiffy constants */ -#define MAX_JIFFY_OFFSET ((~0UL >> 1) - 1) - -/* Block device name size */ -#define BDEVNAME_SIZE 32 +#include +#include /* Extra atomic operations not in asm-generic/atomic.h */ #define atomic_dec_if_positive(v) (--(v)->counter) @@ -86,14 +84,8 @@ struct timespec64 { /* Reference count type */ typedef struct { atomic_t refs; } refcount_t; -/* Lock types - stubs for single-threaded U-Boot */ -typedef int rwlock_t; -/* spinlock_t is defined in linux/compat.h */ - -#define read_lock(l) do { } while (0) -#define read_unlock(l) do { } while (0) -#define write_lock(l) do { } while (0) -#define write_unlock(l) do { } while (0) +/* rwlock_t and read_lock/read_unlock are now in linux/spinlock.h */ +#include /* RB tree types - stubs */ struct rb_node { @@ -2202,8 +2194,7 @@ void *alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, void inode_set_iversion(struct inode *inode, u64 version); int inode_generic_drop(struct inode *inode); -/* Lock init - declaration for stub.c */ -void rwlock_init(rwlock_t *lock); +/* rwlock_init is a macro in linux/spinlock.h */ /* Trace stubs */ #define trace_ext4_drop_inode(i, d) do { } while (0) diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 93315d10fa8..e13685bf8fa 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -2,6 +2,9 @@ /* * Stub functions for ext4l filesystem * + * Copyright 2025 Canonical Ltd + * Written by Simon Glass + * * These stubs allow the ext4l code to link during development while not all * source files are present. They will be removed once the full ext4l * implementation is complete. @@ -352,10 +355,7 @@ void inode_set_iversion(struct inode *inode, u64 version) { } -/* rwlock stubs */ -void rwlock_init(rwlock_t *lock) -{ -} +/* rwlock_init is now a macro in linux/spinlock.h */ /* trace_ext4_drop_inode is now a macro in ext4_uboot.h */