From patchwork Wed Jan 21 22:08:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1727 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=1769033356; bh=Dms+9wxn3gIJRujaIv/wlt5mDzx2iMEwAQjvqaeBcwY=; 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=iSWrIvzIBVkKPypKP8hk/629i1Bz/tq6vkaOUgPVOJh81I6AOmf/z4vvK4BZ2Tm0k EWKYG77DdOjoAazsfyY53CqC2nMfzggPE1GrQq5PdQ046TnW47TO/9Vi+wDzF7AcO7 TPxotLdZJN4r3vYuIxL9jFGbqpkj458ttqdQSgXglRGt/ipozBBOnRkwMtgcU0LFEQ /MJIPmTIvazKhCt9Z05ECkYfsmOCR9NrTpHDN6iySPSBaayA3W0y/4t8tsz7FWRFr+ pQ457LFpWxd/I02Q+eo6e/SWubjn1ELhT1BQxcHA2+JgDX0ke1+WTi9hS9lFTxtZuC hMvRTbHj+GqRw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 482B269601 for ; Wed, 21 Jan 2026 15:09:16 -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 luUtoTiU9nzB for ; Wed, 21 Jan 2026 15:09:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033354; bh=Dms+9wxn3gIJRujaIv/wlt5mDzx2iMEwAQjvqaeBcwY=; 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=S+gIKaiQAHmad5eFB76V66+zsjdqKK/GB5QrGrrkgDcbzKmmF3uOL3PO2MYdQoTBI rvT5h1hgor5Z3wiit/+Y4TYkQa+FouCwJg5RoAfYedzjZk7eW7DlCELf4p4VfUWcB/ KMwU19alqClEzvpMlmIItVR3LZtlJgsUQKytpkykO+bAO456/+8RhnvLZGYlDw5aS4 tAY2V3zrTQiD5pZmmcBf79/mHx2L9CWMxcmJocD86YkLWrk44rX+Pc2IcUFqB5ZxkL +AMYqofjlCZbec5jlgEN83jmCS9Esv3xy9mWmxbpIVvttJfE8eTz5w936IK65SLLIj ht9BNmBmPWwFA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4AEB1695F7 for ; Wed, 21 Jan 2026 15:09:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033351; bh=v5XDQ03IcbQsPrjNh8okulP99T5rqCpvsbai9egps+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EDW6W+9jgg/oEME+zAuyeg65QPvlJnZx93ZU5lD/lWaxd5lgvIeHMgQjsqZ0DOdjN 18rhMvmS7Uq3xc0UiQ7IQ2WhPb5ieYJbe81ihJQkJT73cYULpE0H6COpx8pzUrioOD 8jQcrvPYAwsPhqcGrn1qsngfOGzInmvx0UpQo82bgB8B5l7LrqBC5zb1GiMkOAQBci 4d4LSnAIF+kJ/6r7gCbi2U/XSDb+IB0TTNe33TBAQPU9oncuFmcIGFL2G0siJERQXn /HuYtJoGYCo9W8hL93ILOogMn83np+0EhOZsZdW1NJi2t2z5MNjy4i5zHE4p9W6Df3 y9WzLgKwO6d3Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AD241695F4; Wed, 21 Jan 2026 15:09:11 -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 4jOg9Zzcbv2x; Wed, 21 Jan 2026 15:09:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033351; bh=aJLUcZ4CINnFWghk0IlbCZkkUgl8ioJvJBIHnBD8Ehk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RCZDHWZcOsjjoesZ/+G4CV5B+L3PYv/XFQsmnJ6Y6oZtRwNB/5xUW0hi4U0c/l24y Vo0tam13L4x9U9owxR1aAI9GtS5hDAK3zz4hTxt+mDHt0mb8PTe62gEYQIiQcvCGCT jPSrHHSOkWw3t2S5vmqA5PBSjYyXBlflqY6itI5JrYeWJo79SZruJdkXnQ8n2N4qE9 1OoJdt0FTTJNb1QhFFxd9HwgxArf+QcioF9KwSXN9qlHEGL38+l1slsbf0hhBknU/+ 7HdZTarNBh+RHg8fvuSp4x3DsZMLaf3qSMSW9xX/k1eOjvuIp5FxhAN0KQeE7lJi0S BcJ+vvcnDRsrA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2BCF3695F2; Wed, 21 Jan 2026 15:09:11 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:14 -0700 Message-ID: <20260121220857.2137568-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: F3CE6PXETJOWLHH4PQRZEN6G7ACVYQDJ X-Message-ID-Hash: F3CE6PXETJOWLHH4PQRZEN6G7ACVYQDJ 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 01/33] linux/sort.h: Fix qsort implicit declaration warning 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 Include instead of to get the proper qsort declaration. U-Boot's stdlib.h does not declare qsort, but sort.h does. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- include/linux/sort.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/sort.h b/include/linux/sort.h index dc222d8dc89..f131be8d48c 100644 --- a/include/linux/sort.h +++ b/include/linux/sort.h @@ -6,7 +6,7 @@ #define _LINUX_SORT_H #include -#include +#include typedef int (*cmp_func_t)(const void *, const void *); From patchwork Wed Jan 21 22:08:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1728 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=1769033360; bh=JN0+KVMH648fRxNcf+SD+9B/j9PwAdsIvdJ+Nk9RC6Q=; 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=lMEuxAK1/BBBndZm3puahy3dY9Lqbixv1s2eqoB4CzSp/UKp7JcijXstn9Hi+4Mmc ORoT0mcK+fH9dlagfBgrjmKrD9QfLCFwecsqb7M1VW6EW0MAYZgRiSu8rsqtKWIVam OQtQgi/Go2bFTuQ1D0PuUoIuxSUB8dlQfRcfEMBpoYjcFtDR5Z9Pc+04+mo/41kj/q JA1K7iTkFRm93rk9kj/jIXF8H1RqNatNZvizDVIjkndJb4zos+mNafLkO7iku1stF5 oM3tjWbBFCaWPEulUpC+ERFBMxCT/yqrEETvp+9r2/tc1+C79WFWPOC0oJT2kkbIIy eQFVp2eDMbmPw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0AA3C695FD for ; Wed, 21 Jan 2026 15:09:20 -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 vd1P0-sC-UI2 for ; Wed, 21 Jan 2026 15:09:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033359; bh=JN0+KVMH648fRxNcf+SD+9B/j9PwAdsIvdJ+Nk9RC6Q=; 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=kiG6rOPhhBOR+5lbDQGPCCtu9rip4DvEF5cLmKcZKuoLv0KwCDl2W5KSCN5F+auYn 9XH8prdHvrjo04n6vX6Fyu7DsPzM8G+otj2Ag1FtpYpt8AnEr/GgDJayyB/QbKR2jh E/7Yi5JkDw0xblafgSwNH8B6OPMIgy+E4T9xCLCx8DY4tQV6vNsB+wTCghFj3dK+TF bQsYIdpWHay2Pj7QUk5IDZqFq7p8T+FX3vkVbC+oD7ZuJuhzPw58BoQO9uqarman5Y /UTk9PvYdZO1MM+tq3wAYKm7faLV4JxX5H0Wy8l4NpYQw8QhDl7zk0KvKApmkaFTU8 lyEwPDpzML+WQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE29D695FC for ; Wed, 21 Jan 2026 15:09:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033358; bh=va+iu2fMV6TpX7b4mvFK0i2oMUllN1lEFK0qvKCfN5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JiOOOhyDrs6Uhh+MVkZwLE3LE31P00XND4aoXt6fcPpPR9W0PldTmmfbxBC6EcVWu Nr+Dytoi0FG5yBLM/gKA3K/ZOf4XMQnw3Gm9lTtDQ6yCuEWssBHQ99MCr5zrVZAfM9 FbAPczKhFEHGKSqRzu4pwBrR73CvH8rOZbrBnArAtkGS4aa+PafafaJmqPlAjMzAiM iPR4x7qT1pQWOHn5/OWJI7mNiAfqSWx90qocShudbhZZ4yXCOpiOQj45b0pDrwZRjd NB70pINrfFjUErGd+uYhKrjO0/rg6SonoPvcrKdy/CtbVnu7G+ladhltMu9CBXS6pJ 8CuOYkHNrnocQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9653A695F7; Wed, 21 Jan 2026 15:09:18 -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 Fk2rK0g65qQH; Wed, 21 Jan 2026 15:09:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033352; bh=rgAw/BMzBv4tklqkoRXzOvMHs6+Lan260Hg/abOh0Ic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z17/syZjJDusYQ4Qf8ZKfI0YaMwpNvPgmxKRk8IU4ClmNeoQDLhEndvpzwMsDDL7O MQPYKjBC8u4DDFNYSODnGpQEVWAMCfbYekd/sAllRLcIOIXfS5/iKc1qOQ9OuXy2XD RUAU49BJppJPIwE0/HU4rc2PxxEHLXqk2rO+bZ9PWNTXLvzeZpXD6ywX7NzrXDefHH Fc9f0nxMrEMHFYk9hSl3kxBvyotL47H3+vb5bKcKq/NY20zo/lcQ16DbhKwcVQ+Ij9 aJBy7K3mexPWWytWmYgP/8i2p+CqAEubA/lHh1DdAOKf52DeKaqbp3EC6BVsMuSIW3 2SL5nD82plS7A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EC84A695F2; Wed, 21 Jan 2026 15:09:11 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:15 -0700 Message-ID: <20260121220857.2137568-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WVJUHVWEMDMAU6YGKLLMKMU5WTZ7LQM3 X-Message-ID-Hash: WVJUHVWEMDMAU6YGKLLMKMU5WTZ7LQM3 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 02/33] list: Add const qualifiers to list_sort callback signature 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 list_sort() to use const qualifiers for the list_head parameters in the comparison callback, matching the Linux kernel interface. Changes to the API: - Add list_cmp_func_t typedef with const qualifiers - Update list_sort() declaration to use the new typedef - Update internal merge functions to use const qualifiers Update all callers: - lib/efi_loader/efi_memory.c: efi_mem_cmp() - fs/ubifs/replay.c: replay_entries_cmp() - fs/ubifs/gc.c: data_nodes_cmp() and nondata_nodes_cmp() - arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c: part_cmp() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- .../mach-stm32mp/cmd_stm32prog/stm32prog.c | 9 +++++---- fs/ubifs/gc.c | 19 ++++++++++--------- fs/ubifs/replay.c | 6 +++--- include/linux/list_sort.h | 8 +++++--- lib/efi_loader/efi_memory.c | 7 ++++--- lib/list_sort.c | 12 ++++++------ 6 files changed, 33 insertions(+), 28 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index 353aecc09de..a66e003cfb4 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -708,12 +708,13 @@ static int parse_flash_layout(struct stm32prog_data *data, return 0; } -static int __init part_cmp(void *priv, struct list_head *a, struct list_head *b) +static int __init part_cmp(void *priv, const struct list_head *a, + const struct list_head *b) { - struct stm32prog_part_t *parta, *partb; + const struct stm32prog_part_t *parta, *partb; - parta = container_of(a, struct stm32prog_part_t, list); - partb = container_of(b, struct stm32prog_part_t, list); + parta = container_of(a, const struct stm32prog_part_t, list); + partb = container_of(b, const struct stm32prog_part_t, list); if (parta->part_id != partb->part_id) return parta->part_id - partb->part_id; diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c index 6a4ada62c82..0577d91104a 100644 --- a/fs/ubifs/gc.c +++ b/fs/ubifs/gc.c @@ -114,18 +114,19 @@ static int switch_gc_head(struct ubifs_info *c) * This function compares data nodes @a and @b. Returns %1 if @a has greater * inode or block number, and %-1 otherwise. */ -static int data_nodes_cmp(void *priv, struct list_head *a, struct list_head *b) +static int data_nodes_cmp(void *priv, const struct list_head *a, + const struct list_head *b) { ino_t inuma, inumb; struct ubifs_info *c = priv; - struct ubifs_scan_node *sa, *sb; + const struct ubifs_scan_node *sa, *sb; cond_resched(); if (a == b) return 0; - sa = list_entry(a, struct ubifs_scan_node, list); - sb = list_entry(b, struct ubifs_scan_node, list); + sa = list_entry(a, const struct ubifs_scan_node, list); + sb = list_entry(b, const struct ubifs_scan_node, list); ubifs_assert(key_type(c, &sa->key) == UBIFS_DATA_KEY); ubifs_assert(key_type(c, &sb->key) == UBIFS_DATA_KEY); @@ -157,19 +158,19 @@ static int data_nodes_cmp(void *priv, struct list_head *a, struct list_head *b) * first and sorted by length in descending order. Directory entry nodes go * after inode nodes and are sorted in ascending hash valuer order. */ -static int nondata_nodes_cmp(void *priv, struct list_head *a, - struct list_head *b) +static int nondata_nodes_cmp(void *priv, const struct list_head *a, + const struct list_head *b) { ino_t inuma, inumb; struct ubifs_info *c = priv; - struct ubifs_scan_node *sa, *sb; + const struct ubifs_scan_node *sa, *sb; cond_resched(); if (a == b) return 0; - sa = list_entry(a, struct ubifs_scan_node, list); - sb = list_entry(b, struct ubifs_scan_node, list); + sa = list_entry(a, const struct ubifs_scan_node, list); + sb = list_entry(b, const struct ubifs_scan_node, list); ubifs_assert(key_type(c, &sa->key) != UBIFS_DATA_KEY && key_type(c, &sb->key) != UBIFS_DATA_KEY); diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index b6e03b76d41..a323ae6d058 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c @@ -268,10 +268,10 @@ static int apply_replay_entry(struct ubifs_info *c, struct replay_entry *r) * entries @a and @b by comparing their sequence numer. Returns %1 if @a has * greater sequence number and %-1 otherwise. */ -static int replay_entries_cmp(void *priv, struct list_head *a, - struct list_head *b) +static int replay_entries_cmp(void *priv, const struct list_head *a, + const struct list_head *b) { - struct replay_entry *ra, *rb; + const struct replay_entry *ra, *rb; cond_resched(); if (a == b) diff --git a/include/linux/list_sort.h b/include/linux/list_sort.h index 1a2df2efb77..dc760a60644 100644 --- a/include/linux/list_sort.h +++ b/include/linux/list_sort.h @@ -5,7 +5,9 @@ struct list_head; -void list_sort(void *priv, struct list_head *head, - int (*cmp)(void *priv, struct list_head *a, - struct list_head *b)); +typedef int (*list_cmp_func_t)(void *priv, const struct list_head *a, + const struct list_head *b); + +void list_sort(void *priv, struct list_head *head, list_cmp_func_t cmp); + #endif diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 4a56dfca37c..190937cf1ff 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -116,10 +116,11 @@ static u64 checksum(struct efi_pool_allocation *alloc) * @b: second memory area * Return: 1 if @a is before @b, -1 if @b is before @a, 0 if equal */ -static int efi_mem_cmp(void *priv, struct list_head *a, struct list_head *b) +static int efi_mem_cmp(void *priv, const struct list_head *a, + const struct list_head *b) { - struct mem_node *mema = list_entry(a, struct mem_node, link); - struct mem_node *memb = list_entry(b, struct mem_node, link); + const struct mem_node *mema = list_entry(a, struct mem_node, link); + const struct mem_node *memb = list_entry(b, struct mem_node, link); if (mema->base == memb->base) return 0; diff --git a/lib/list_sort.c b/lib/list_sort.c index cf5cac17720..5298990b3e7 100644 --- a/lib/list_sort.c +++ b/lib/list_sort.c @@ -21,8 +21,8 @@ * sentinel head node, "prev" links not maintained. */ static struct list_head *merge(void *priv, - int (*cmp)(void *priv, struct list_head *a, - struct list_head *b), + int (*cmp)(void *priv, const struct list_head *a, + const struct list_head *b), struct list_head *a, struct list_head *b) { struct list_head head, *tail = &head; @@ -50,8 +50,8 @@ static struct list_head *merge(void *priv, * throughout. */ static void merge_and_restore_back_links(void *priv, - int (*cmp)(void *priv, struct list_head *a, - struct list_head *b), + int (*cmp)(void *priv, const struct list_head *a, + const struct list_head *b), struct list_head *head, struct list_head *a, struct list_head *b) { @@ -104,8 +104,8 @@ static void merge_and_restore_back_links(void *priv, * ordering is to be preserved, @cmp must return 0. */ void list_sort(void *priv, struct list_head *head, - int (*cmp)(void *priv, struct list_head *a, - struct list_head *b)) + int (*cmp)(void *priv, const struct list_head *a, + const struct list_head *b)) { struct list_head *part[MAX_LIST_LENGTH_BITS+1]; /* sorted partial lists -- last slot is a sentinel */ From patchwork Wed Jan 21 22:08:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1729 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=1769033362; bh=jIGPd97COxZ70/6NgZx0xxIp4o8P2Yk44dodU/5gcH0=; 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=gPu+YomU5ruwR1TowKxKrvgH/PuqIT6qsMHqhbZW3Yj2KUxFRvApGTBkuDCuO6XDC R61KoXust1gSPbRXniQg3TcHYelc40I6lDhd7N6y9/gdUxlKHz1pgpwGhruEH3iqD6 qQzvyZSG5+eRfbOxchywFsTNZcxCek1AgIkW6LJvWyyjS9BCj4chEksenZUKjjZT7U Bf+NqmmigKe32dN6h/d9eg+JigDWtzUJ7LTSh5NiAyRdw0us7quV6SOWHGDV0UlAN+ 6JGptukzSM/wP+lANqxa0+r4+l+X0+q6RrayFVwpJYY9f3BwIv0xNXl01mwU4K2nFj Y6BrX02Jvgjmg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 94099695F2 for ; Wed, 21 Jan 2026 15:09:22 -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 ggBnibFl7CQV for ; Wed, 21 Jan 2026 15:09:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033361; bh=jIGPd97COxZ70/6NgZx0xxIp4o8P2Yk44dodU/5gcH0=; 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=IFiIzPFh+asGdqO/sGvH/R9eOAqgna5oKq59cp9qg9Dnvt0iWsYELvNCKzJuus5ty VJ0Bds8DNG5a/AKXi1/f6wPCET521ouojzalCXRJ+USLqSN66p4A3VkBNJXzBoKrUh YhDBE3PPiqxyPPQ2mEvgBDxRDnVRB+yL0szBVmqC7R6XM85vhtHb8VLeSlzFVVmmyh I9Yv8jdkaFCCupPTBu8Wf1CP65L3AzqEhdp6/t+27FaKXHmYHEy3lvOM7vfSIF7hZe c5u50mUo2HhFM+f6zTQaXIkScl9LnLTuM/LhXv+fQ0By2BkxbqS0I5uRsJX/F4bwzz /kKBTNTFAN7rQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 02418695FD for ; Wed, 21 Jan 2026 15:09:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033358; bh=rkdHABar2A2vrj5ax3eSaOnMO/JVKnCR55lQlJQOe0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UXVD+gmqvvzreL1CzBItiukzpGM8+P0+ODu5FSrNYQqwPv3G0ZsUjjCANWiqg9EQa 1g2g1zJccOjkFi14HEjq7D7q2QewskVu1IGbO6Za+o6gq5qx6qZSil14jeckZqvUqr oMmj9Qzyx0JbXm//LygTCwz6TiN4WiTFJsQ0ecbCgNC8oZYiZ0kuSMW4Ni/8u3YIqi EFTD5dzKNbFQtIwliI/KSHpqc/sc5gQeoQBvhqsqVBFnVmJrL2kU5TSkjjiGhSQN1f Fd44VoEXb5JmGp5xTxfiHJTvCfJWwOQvA87pDNZYd4XzdQNwljQ904am5wqtHcuA95 9B1qOh6G6SF3g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9A48C695F2; Wed, 21 Jan 2026 15:09:18 -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 q4O46I5b9-YX; Wed, 21 Jan 2026 15:09:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033357; bh=qn9ninMfsEd8XYVIwUXZstjFnsPwfWO4vBwOGco6co4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rvgWD1e6dLgZog1m9vJ0ykExu5nIYRhGKdGMqrf0YANQYkCSb+9PnFyP/83NtUUw7 QjJnLur7BeXLDB9Z/PU7fsupNCyVScWTiWM+0l0giGZauoQ0G02tbHXOBRF7LB+REz UToiPkMkxWIm3a6wiZPWpMRFFovkrXvKFT3m5f4Qm6xa5MCucHYiyY9BXdOMMASeyP VCdEL7x3kiGRXZbpf1XIm9bBq4HeDcZRWxP2TNMyxoCrY1/J4A2OV1uKaYPJyZwBYw qgNAGqS/vaIsxL23mJV1M3MzGIaZklsJj10xsfaIj6Qx43v2kUwC1dW1jMuFvE7biS tYng0nl7zkhQA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C79E8695FD; Wed, 21 Jan 2026 15:09:16 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:16 -0700 Message-ID: <20260121220857.2137568-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6MTFGKP2Q2LUX4XL2IINFTXKVWW2W7VE X-Message-ID-Hash: 6MTFGKP2Q2LUX4XL2IINFTXKVWW2W7VE 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 03/33] ext4l: Remove redundant header-location comments from ext4_uboot.h 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 Remove comment lines that simply document which header provides a definition, as these add noise without value. The definitions are already in the appropriate headers, so the comments are redundant. This removes approximately 250 standalone comments of the form "/* X is in linux/Y.h */" and consolidates related #include statements. Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 528 +----------------------------------------- 1 file changed, 9 insertions(+), 519 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 2f73325e521..5d62c49663c 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -70,16 +70,6 @@ #undef no_printk #define no_printk(fmt, ...) ({ 0; }) -/* rol32 and ror32 are now in linux/bitops.h */ -/* Time types - timespec64 and time64_t are now in linux/time.h */ - -/* - * ktime_t, sector_t are now in linux/types.h - * atomic_t, atomic64_t are now in asm-generic/atomic.h - * MAX_JIFFY_OFFSET is now in linux/jiffies.h - * BDEVNAME_SIZE is now in linux/blkdev.h - * blk_opf_t is now in linux/blk_types.h - */ #include #include #include @@ -90,88 +80,27 @@ #include #include #include - -/* atomic_dec_if_positive, atomic_add_unless, etc. are now in asm-generic/atomic.h */ -/* cmpxchg is now in asm-generic/atomic.h */ -/* SMP stubs (raw_smp_processor_id, smp_*mb) are now in linux/smp.h */ -/* refcount_t and operations are now in linux/refcount.h */ - -/* rwlock_t and read_lock/read_unlock are now in linux/spinlock.h */ #include - -/* RB tree types - from included above */ - -/* percpu - use Linux headers */ #include #include - -/* Project ID type - use linux/projid.h */ #include - -/* kobject is now in linux/kobject.h */ #include - -/* lockdep stubs - needed before jbd2.h is included */ #include -/* _THIS_IP_ is in linux/kernel.h */ - -/* completion - use Linux header */ #include - -/* Cache alignment - use linux/cache.h */ #include - -/* ZERO_OR_NULL_PTR is in linux/slab.h */ -/* data_race is in linux/compiler.h */ - -/* REQ_META, REQ_PRIO, REQ_RAHEAD are in linux/blk_types.h */ -/* __GFP_MOVABLE, __GFP_FS are in linux/slab.h */ - -/* Capabilities - use linux/capability.h */ #include - -/* FIEMAP types - use linux/fiemap.h */ #include -#define EXT4_FIEMAP_EXTENT_HOLE 0x08000000 - -/* FALLOC_FL_* flags are in linux/fs.h */ +#include +#include -/* File flags */ +#define EXT4_FIEMAP_EXTENT_HOLE 0x08000000 #define O_SYNC 0 +#define S_NOQUOTA 0 -/* Forward declarations (struct inode, struct address_space) are in linux/fs.h */ - -/* pgoff_t is in linux/types.h */ #ifndef PAGE_SHIFT #define PAGE_SHIFT 12 #endif -/* FMODE_32BITHASH, FMODE_64BITHASH are in linux/fs.h */ - -/* struct file is defined in linux/fs.h */ - -/* kiocb, iov_iter - use linux/uio.h */ -#include - -/* __counted_by is in linux/compiler_attributes.h */ - -/* dir_context, filldir_t are in linux/fs.h */ - -/* iomap types and structs are in linux/iomap.h */ - -/* fscrypt_str, qstr are now in ext4_fscrypt.h */ - -/* percpu rw semaphore is in linux/percpu.h */ - -/* Memory allocation context - use linux/sched/mm.h */ -#include - -/* IS_CASEFOLDED is in linux/fs.h */ -/* IS_ENCRYPTED and FSCRYPT_SET_CONTEXT_MAX_SIZE are in ext4_fscrypt.h */ -#define S_NOQUOTA 0 - -/* user_namespace and init_user_ns are in linux/cred.h */ - /* * BUG_ON / BUG - stubs (not using linux/bug.h which panics) * In Linux, these indicate kernel bugs. In ext4l, some BUG_ON conditions @@ -183,57 +112,15 @@ #define BUG_ON(cond) do { (void)(cond); } while (0) #define BUG() do { } while (0) -/* might_sleep is in linux/kernel.h */ - -/* sb_rdonly is in linux/super.h */ - -/* Trace stubs are now in ext4_trace.h */ - -/* Buffer operations are in linux/buffer_head.h */ -/* wait_on_bit_io is now in linux/wait_bit.h */ - -/* inode_needs_sync is in linux/fs.h */ - -/* Memory barriers are now in linux/smp.h */ - -/* - * set_bit/clear_bit are declared extern in asm/bitops.h but not implemented. - * We implement them in interface.c for sandbox. - */ - -/* Little-endian bit operations - use asm-generic/bitops/le.h */ #include - -/* KUNIT stub - use kunit/static_stub.h */ #include - -/* percpu_counter operations are in linux/percpu_counter.h */ - -/* in_group_p is in linux/cred.h */ - -/* Quota operations - use linux/quotaops.h */ #include - -/* icount_read is in linux/fs.h */ -/* d_inode is now in linux/dcache.h */ - -/* Random number functions - use linux/random.h */ #include -/* Buffer cache operations - sb_find_get_block, sync_dirty_buffer are in linux/buffer_head.h */ - -/* Time functions - ktime_get_real_seconds, time_before32 are in linux/time.h */ - /* Inode operations - iget_locked and new_inode are in interface.c */ extern struct inode *new_inode(struct super_block *sb); -/* i_uid_write, i_gid_write, inode_fsuid_set, inode_init_owner are in linux/fs.h */ -/* insert_inode_locked, unlock_new_inode, clear_nlink are in linux/fs.h */ -/* IS_DIRSYNC is in linux/fs.h */ - -/* fscrypt_prepare_new_inode, fscrypt_set_context are in ext4_fscrypt.h */ -/* ext4_init_acl is provided by acl.h */ -/* xattr stubs for files that don't include xattr.h */ +/* Forward declarations for xattr functions */ struct super_block; struct buffer_head; struct qstr; @@ -243,59 +130,17 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, struct buffer_head *block_bh, size_t value_len, bool is_create); #endif -/* ext4_init_security is provided by xattr.h */ - -/* is_bad_inode is in linux/fs.h */ /* Block device operations - stubs */ #define sb_issue_zeroout(sb, blk, num, gfp) ({ (void)(sb); (void)(blk); (void)(num); (void)(gfp); 0; }) #define blkdev_issue_flush(bdev) ({ (void)(bdev); 0; }) -/* inode_is_locked, i_size_write, i_size_read are in linux/fs.h */ - -/* spin_trylock is defined in linux/spinlock.h */ - -/* atomic_add_unless is now in asm-generic/atomic.h */ - -/* bgl_lock_ptr is now in linux/blockgroup_lock.h */ - -/* RCU stubs - use linux/rcupdate.h */ #include - -/* RCU head for callbacks - defined in linux/compat.h as callback_head */ - -/* lockdep_is_held is in linux/lockdep.h */ - -/* Memory allocation - use linux/slab.h which is already available */ #include -/* KMEM_CACHE macro is in linux/slab.h */ - -/* - * RB tree operations - use real rbtree implementation from lib/rbtree.c - * and include/linux/rbtree.h. rb_entry, rb_first, rb_next, rb_prev, - * rb_insert_color, rb_erase, rb_link_node, RB_EMPTY_ROOT, and - * rbtree_postorder_for_each_entry_safe are all provided by the real - * implementation - do not stub them! - */ - -/* inode/dentry operations */ void iput(struct inode *inode); -/* current task - from linux/sched.h */ #include - -/* _RET_IP_ is in linux/kernel.h */ - -/* SB_FREEZE_* constants are in linux/fs.h */ - -/* sb_writers is in linux/super.h */ - -/* mapping_large_folio_support is in linux/pagemap.h */ - -/* sector_t is now in linux/types.h */ - -/* Buffer head - from linux/buffer_head.h */ #include #include @@ -315,29 +160,14 @@ BUFFER_FNS(OwnsData, ownsdata) #define BH_Cached (BH_JBDPrivateStart + 2) BUFFER_FNS(Cached, cached) -/* get_block_t is in linux/fs.h */ - -/* crc32c - from linux/crc32c.h */ #include - -/* ratelimit_state - use linux/ratelimit.h */ #include - -/* fscrypt_dummy_policy and qstr are now in ext4_fscrypt.h */ - -/* errseq_t is defined in linux/fs.h */ -/* time64_t is now in linux/time.h */ - -/* IS_NOQUOTA is in linux/fs.h */ -/* dentry, name_snapshot are now in linux/dcache.h */ - -/* VM types - use linux/mm_types.h */ #include +#include +#include -/* pipe_inode_info - forward declaration */ +/* Forward declarations */ struct pipe_inode_info; - -/* Forward declarations for function prototypes (vm_fault is in linux/mm_types.h) */ struct kstat; struct path; struct file_kattr; @@ -346,67 +176,20 @@ struct readahead_control; struct fiemap_extent_info; struct folio; -/* qsize_t is in linux/quotaops.h */ - -/* blk_opf_t is in linux/blk_types.h */ - -/* bh_end_io_t and struct buffer_head are in linux/buffer_head.h */ - -/* DT_* directory entry types are in linux/fs.h */ - -/* mnt_idmap - use linux/mnt_idmapping.h */ -#include - -/* fstrim_range is in linux/fs.h */ - -/* rw_semaphore - defined in linux/rwsem.h, include it */ -#include - -/* block_device is defined in linux/fs.h */ - -/* SB_RDONLY, SB_I_VERSION, etc. superblock flags are in linux/fs.h */ - -/* uuid_t is now in linux/uuid.h */ - -/* super_block is now in linux/super.h */ - -/* Block device read-only check */ static inline int bdev_read_only(struct block_device *bdev) { return bdev ? bdev->read_only : 0; } -/* kuid_t and kgid_t - from linux/cred.h */ #include -/* Inode state bits (I_NEW, I_FREEING, etc.) are in linux/fs.h */ -/* S_SYNC, S_NOATIME, etc. inode flags are in linux/fs.h */ -/* S_IRWXUGO is in linux/fs.h */ - -/* Whiteout mode for overlayfs */ #define WHITEOUT_DEV 0 #define WHITEOUT_MODE 0 -/* RENAME_* flags are in linux/fs.h */ -/* I_DIRTY_TIME is in linux/fs.h */ - -/* SB_LAZYTIME is in linux/fs.h */ -/* ATTR_* iattr valid flags are in linux/fs.h */ -/* STATX_* flags and struct kstat are in linux/stat.h */ -/* VM fault return values are in linux/mm_types.h */ -/* struct path is defined in linux/fs.h */ -/* VM structs (vm_area_struct, page, vm_fault, vm_operations_struct) are in linux/mm_types.h */ - -/* Forward declaration for swap */ struct swap_info_struct; - -/* PF_MEMALLOC is in linux/sched.h */ - -/* Forward declarations for inode operations */ struct inode_operations; struct file_operations; -/* inode - extended for inode.c */ struct inode { struct super_block *i_sb; unsigned long i_ino; @@ -573,12 +356,6 @@ struct dx_hash_info { #define EXT4_HTREE_EOF_32BIT ((1UL << (32 - 1)) - 1) #define EXT4_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1) -/* jbd2_buffer_trigger_type is defined in jbd2.h */ -/* struct seq_file is in linux/seq_file.h */ - -/* fscrypt_has_encryption_key, fscrypt_fname_siphash are in ext4_fscrypt.h */ - -/* ext4 warning macros - stubs (only when ext4.h is not included) */ #ifdef EXT4_UBOOT_NO_EXT4_H #define ext4_warning(sb, fmt, ...) \ do { } while (0) @@ -587,31 +364,6 @@ struct dx_hash_info { do { } while (0) #endif -/* fallthrough is in linux/compiler_attributes.h */ - -/* BUILD_BUG_ON is in linux/build_bug.h */ -/* WARN_ON, WARN_ON_ONCE, WARN_ONCE are in linux/bug.h */ -/* pr_warn_once is in linux/printk.h */ - -/* lockdep_assert_held_read is in linux/lockdep.h */ -/* strtomem_pad is in linux/string.h */ -/* strscpy_pad is in linux/string.h */ - -/* memweight is in linux/string.h */ - -/* BITS_PER_BYTE is in linux/bitops.h */ - -/* extents.c stubs */ - -/* rwsem_is_locked is in linux/rwsem.h */ - -/* Buffer operations - sb_getblk_gfp, bh_uptodate_or_lock are in linux/buffer_head.h */ -/* ext4_read_bh is stubbed in interface.c */ - -/* Inode locking stubs are in linux/fs.h */ -/* Lock debugging stubs are in linux/lockdep.h */ - -/* File operations */ #define file_modified(file) ({ (void)(file); 0; }) #define file_accessed(file) do { (void)(file); } while (0) @@ -623,27 +375,13 @@ struct dx_hash_info { #define generic_atomic_write_valid(iocb, from) ({ (void)(iocb); (void)(from); 0; }) #define vfs_setpos(file, offset, maxsize) ({ (void)(file); (void)(maxsize); (offset); }) -/* IS_NOSEC is in linux/fs.h */ - -/* Filemap operations and fault handlers are in linux/pagemap.h */ - -/* DAX device mapping check - always false in U-Boot */ #define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) -/* Inode time/size operations - inode_newsize_ok, i_blocksize, IS_SYNC are in linux/fs.h */ -/* inode_set_ctime_current, inode_set_mtime_to_ts are in linux/fs.h */ - -/* Case-folding stubs - not supported in U-Boot */ #define sb_no_casefold_compat_fallback(sb) ({ (void)(sb); 1; }) #define generic_ci_validate_strict_name(d, n) ({ (void)(d); (void)(n); 1; }) -/* in_range - use linux/minmax.h */ #include -/* dquot_reclaim_block is in linux/quotaops.h */ - -/* fiemap stubs are now in linux/fiemap.h */ - /* Memory retry wait */ #define memalloc_retry_wait(g) do { } while (0) @@ -652,10 +390,6 @@ struct dx_hash_info { /* indirect.c stubs */ -/* umin is in linux/minmax.h */ - -/* truncate_inode_pages is in linux/pagemap.h */ - /* ext4_sb_bread_nofail is stubbed in interface.c */ /* extents_status.c stubs */ @@ -669,14 +403,6 @@ struct dx_hash_info { /* hrtimer - use linux/hrtimer.h */ #include -/* write_trylock is in linux/spinlock.h */ - -/* percpu_counter_init/destroy are in linux/percpu_counter.h */ - -/* ratelimit macros are now in linux/ratelimit.h */ - -/* SEQ_START_TOKEN is in linux/seq_file.h */ - /* folio and pagemap - use linux/pagemap.h */ #include #include @@ -684,13 +410,6 @@ struct dx_hash_info { /* wbc_to_tag, WB_REASON_* - use linux/writeback.h */ #include -/* blk_plug is now in linux/blkdev.h */ - -/* address_space_operations is in linux/fs.h */ -/* buffer_migrate_folio, buffer_migrate_folio_norefs, noop_dirty_folio are in linux/buffer_head.h */ -/* readahead_control, FGP_*, kmap/kunmap, folio stubs are in linux/pagemap.h */ -/* __filemap_get_folio, folio_put, folio_get, mapping_clear_folio_cache are in linux/pagemap.h */ - /* projid_t is now in linux/projid.h */ /* @@ -730,32 +449,8 @@ struct dx_hash_info { /* d_path, path_put - use linux/path.h */ #include -/* fscrypt_file_open is in ext4_fscrypt.h */ -/* fsverity_file_open is in linux/fsverity.h */ #include -/* dquot_file_open is in linux/quotaops.h */ - -/* inode_io_list_del is in linux/writeback.h */ -/* inode_is_open_for_write, inode_is_dirtytime_only are in linux/fs.h */ - -/* Folio operations and writeback stubs are in linux/pagemap.h */ -/* folio_batch_release is in linux/pagevec.h */ - -/* Quota stubs are in linux/quotaops.h */ - -/* percpu_counter_sub is in linux/percpu_counter.h */ - -/* Filemap operations are in linux/pagemap.h */ -/* try_to_writeback_inodes_sb is in linux/writeback.h */ - -/* Buffer/block folio operations are in linux/buffer_head.h */ -/* write_begin_get_folio is in linux/pagemap.h */ - -/* fscrypt_name, fscrypt_match_name, and fscrypt stubs are in ext4_fscrypt.h */ - -/* fsverity stubs are in linux/fsverity.h */ - /* Inode time setters - needed for ext4.h */ static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode, struct timespec64 ts) @@ -773,7 +468,6 @@ static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, /* Inode version operations - use linux/iversion.h */ #include -/* inode_set_flags is in linux/fs.h */ /* Inode credential helpers - i_uid_read, i_gid_read need struct inode */ static inline unsigned int i_uid_read(const struct inode *inode) @@ -786,8 +480,6 @@ static inline unsigned int i_gid_read(const struct inode *inode) return inode->i_gid.val; } -/* i_uid_needs_update, i_gid_needs_update, i_uid_update, i_gid_update are in linux/fs.h */ - /* Device encoding helpers are now in linux/kdev_t.h */ #include @@ -796,9 +488,6 @@ static inline unsigned int i_gid_read(const struct inode *inode) /* Inode allocation/state operations */ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); -/* set_nlink, inc_nlink, drop_nlink are in linux/fs.h */ -/* inode_set_cached_link, init_special_inode, make_bad_inode are in linux/fs.h */ -/* iget_failed, find_inode_by_ino_rcu, mark_inode_dirty are in linux/fs.h */ /* Attribute operations */ #define setattr_prepare(m, d, a) ({ (void)(m); (void)(d); (void)(a); 0; }) @@ -807,8 +496,6 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); #define generic_fillattr(m, req, i, s) do { } while (0) #define generic_fill_statx_atomic_writes(s, u_m, u_M, g) do { } while (0) -/* IS_APPEND, IS_IMMUTABLE are in linux/fs.h */ - /* File operations */ #define file_update_time(f) do { } while (0) #define vmf_fs_error(e) ((vm_fault_t)VM_FAULT_SIGBUS) @@ -820,8 +507,6 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); /* Block device alignment */ #define bdev_dma_alignment(bd) (0) -/* Truncation stubs are in linux/pagemap.h */ - /* * Additional stubs for dir.c */ @@ -829,14 +514,6 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); /* FSTR_INIT - fscrypt_str initializer (fscrypt_str defined in ext4_fscrypt.h) */ #define FSTR_INIT(n, l) { .name = (n), .len = (l) } -/* fscrypt directory operations are in ext4_fscrypt.h */ - -/* Readahead operations are in linux/pagemap.h */ - -/* Inode version operations are in linux/iversion.h */ - -/* dir_emit, dir_relax_shared are in linux/fs.h */ - /* File llseek */ #define generic_file_llseek_size(f, o, w, m, e) ({ (void)(f); (void)(o); (void)(w); (void)(m); (void)(e); 0LL; }) @@ -916,19 +593,10 @@ static inline const char *simple_get_link(struct dentry *dentry, return inode->i_link; } -/* fscrypt symlink stubs are in ext4_fscrypt.h */ - /* * Additional stubs for super.c */ -/* QFMT_VFS_* quota format constants are in linux/quotaops.h */ - -/* end_buffer_read_sync is in linux/buffer_head.h */ - -/* REQ_OP_READ is in linux/blk_types.h */ -/* SB_ACTIVE is in linux/fs.h */ - /* Part stat - not used in U-Boot. Note: sectors[X] is passed as second arg */ #define STAT_WRITE 0 #define STAT_READ 0 @@ -936,8 +604,6 @@ static u64 __attribute__((unused)) __ext4_sectors[2]; #define sectors __ext4_sectors #define part_stat_read(p, f) ({ (void)(p); (void)(f); 0ULL; }) -/* system_state, SYSTEM_HALT, etc. are in linux/kernel.h */ - /* * Hex dump - DUMP_PREFIX_* types are in hexdump.h. * However, the Linux kernel print_hex_dump has a different signature @@ -947,25 +613,12 @@ static u64 __attribute__((unused)) __ext4_sectors[2]; #undef print_hex_dump #define print_hex_dump(l, p, pt, rg, gc, b, len, a) do { } while (0) -/* SLAB_RECLAIM_ACCOUNT, SLAB_ACCOUNT are in linux/slab.h */ - /* Forward declarations for super_operations and export_operations */ struct kstatfs; struct fid; -/* super_operations is in linux/fs/super_types.h */ - -/* export_operations and fid - use linux/exportfs.h */ #include - -/* uuid_to_fsid is in linux/statfs.h */ - -/* kstatfs - use linux/statfs.h */ #include - -/* struct seq_file is in linux/seq_file.h */ - -/* Module stubs and register_filesystem are in linux/module.h */ #include /* EXT4_GOING flags */ @@ -978,29 +631,17 @@ int ext4_fill_super(struct super_block *sb, struct fs_context *fc); int ext4_commit_super(struct super_block *sb); void ext4_unregister_li_request(struct super_block *sb); -/* prandom - get_random_u32, prandom_u32_max are in linux/random.h */ - -/* ctype */ #include -/* crc16 - use U-Boot's implementation */ #include - -/* Timer and timing stubs are in linux/jiffies.h */ - -/* Path lookup flags - use linux/namei.h */ #include /* I/O priority classes - use linux/ioprio.h */ #include -/* SB_INLINECRYPT, SB_SILENT, SB_POSIXACL are in linux/fs.h */ #define SB_I_CGROUPWB 0 /* Not supported in U-Boot */ #define SB_I_ALLOW_HSM 0 /* Not supported in U-Boot */ -/* BLK_OPEN_* flags are in linux/blkdev.h */ -/* REQ_OP_*, REQ_SYNC, REQ_FUA are in linux/blk_types.h */ - /* blk_holder_ops for block device */ struct blk_holder_ops { void (*mark_dead)(struct block_device *, bool); @@ -1016,17 +657,11 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate); /* Block size */ #define BLOCK_SIZE 1024 -/* NSEC_PER_SEC is in linux/time.h */ - -/* EXT4 magic number */ #define EXT4_SUPER_MAGIC 0xEF53 -/* MAX_LFS_FILESIZE is in linux/fs.h */ - /* blockgroup_lock - use linux/blockgroup_lock.h */ #include -/* submit_bh is in linux/buffer_head.h */ /* Buffer submission stubs - declarations for stub.c implementations */ struct buffer_head *bdev_getblk(struct block_device *bdev, sector_t block, unsigned int size, gfp_t gfp); @@ -1044,8 +679,6 @@ void fsnotify_sb_error(struct super_block *sb, struct inode *inode, int error); char *file_path(struct file *file, char *buf, int buflen); struct block_device *file_bdev(struct file *file); -/* percpu_init_rwsem/percpu_free_rwsem are in linux/percpu.h */ - /* Block device sync - declarations for stub.c */ int sync_blockdev(struct block_device *bdev); void invalidate_bdev(struct block_device *bdev); @@ -1056,40 +689,14 @@ void invalidate_bdev(struct block_device *bdev); /* DAX - declaration for stub.c */ void fs_put_dax(void *dax, void *holder); -/* fscrypt declarations are in ext4_fscrypt.h */ - -/* alloc_inode_sb, inode_generic_drop are in linux/fs.h */ -/* inode_set_iversion is in linux/iversion.h */ - -/* rwlock_init is a macro in linux/spinlock.h */ - /* slab usercopy - use regular kmem_cache_create */ #define kmem_cache_create_usercopy(n, sz, al, fl, uo, us, c) \ kmem_cache_create(n, sz, al, fl, c) -/* invalidate_inode_buffers, clear_inode are in linux/fs.h */ -/* fsverity_cleanup_inode is in linux/fsverity.h */ - -/* NFS export helpers are now in linux/exportfs.h */ - -/* Path operations - path_put, d_path are in linux/path.h */ - -/* I/O priority stubs are in linux/ioprio.h */ - -/* kmemdup_nul is in linux/slab.h */ -/* fscrypt declarations are in ext4_fscrypt.h */ - /* Memory allocation - declarations for stub.c */ void *kvzalloc(size_t size, gfp_t flags); #define kvmalloc(size, flags) kvzalloc(size, flags) -/* Time operations - ktime_get_ns is in linux/ktime.h */ -/* nsecs_to_jiffies is in linux/jiffies.h */ - -/* sb_start_write, sb_end_write are in linux/fs/super_types.h */ - -/* schedule_timeout_interruptible is in linux/sched.h */ - /* Page allocation - declarations for stub.c */ unsigned long get_zeroed_page(gfp_t gfp); void free_page(unsigned long addr); @@ -1098,8 +705,6 @@ void free_page(unsigned long addr); void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, void *holder); -/* Block device atomic write stubs are in linux/blkdev.h */ - /* Superblock blocksize - declaration for stub.c */ int sb_set_blocksize(struct super_block *sb, int size); @@ -1114,10 +719,6 @@ int generic_check_addressable(unsigned int blocksize_bits, u64 num_blocks); u64 sb_bdev_nr_blocks(struct super_block *sb); unsigned int bdev_max_discard_sectors(struct block_device *bdev); -/* bgl_lock_init is now in linux/blockgroup_lock.h */ - -/* set_task_ioprio is in linux/ioprio.h */ - /* Superblock identity functions */ static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, unsigned len) @@ -1136,16 +737,6 @@ static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, #define xattr_handler_can_list(h, d) ({ (void)(h); (void)(d); 0; }) #define xattr_prefix(h) ({ (void)(h); (const char *)NULL; }) -/* I_MUTEX_* constants and inode locking stubs are in linux/fs.h */ - -/* PF_MEMALLOC_NOFS is in linux/sched.h */ - -/* generic_set_sb_d_ops, d_make_root are now in linux/dcache.h */ - -/* strreplace is in linux/string.h */ - -/* ratelimit_state_init is now in linux/ratelimit.h */ - /* Block device operations - declarations for stub.c */ void bdev_fput(void *file); void *bdev_file_open_by_dev(dev_t dev, int flags, void *holder, @@ -1154,48 +745,20 @@ void *bdev_file_open_by_dev(dev_t dev, int flags, void *holder, /* Filesystem sync - declaration for stub.c */ int sync_filesystem(void *sb); -/* Quota operations are in linux/quotaops.h */ - /* Block device file operations - stubs */ #define set_blocksize(f, size) ({ (void)(f); (void)(size); 0; }) struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned size); -/* flush_workqueue is now in linux/workqueue.h */ - -/* Quota stubs for super.c are in linux/quotaops.h */ - /* * Stubs for mballoc.c */ -/* XArray is now in linux/xarray.h */ -/* Per-CPU stubs are in linux/percpu.h */ - -/* Little-endian bit operations are in asm-generic/bitops/le.h */ - -/* atomic64 operations are now in asm-generic/atomic.h */ - -/* get_cycles is in asm-generic/timex.h */ #include - -/* folio_address is in linux/pagemap.h */ - -/* sb_end_intwrite defined earlier */ - -/* WARN_RATELIMIT is in linux/ratelimit.h */ - -/* folio_get - now implemented in support.c */ - -/* array_index_nospec is in linux/nospec.h */ #include -/* atomic_inc_return and atomic_add_return are now in asm-generic/atomic.h */ - /* pde_data - proc dir entry data (not supported in U-Boot) */ #define pde_data(inode) ((void *)NULL) -/* struct seq_operations is in linux/seq_file.h */ - /* DEFINE_RAW_FLEX - define a flexible array struct on the stack (stubbed to NULL) */ #define DEFINE_RAW_FLEX(type, name, member, count) \ type *name = NULL @@ -1203,8 +766,6 @@ struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned /* Block layer constants */ #define BLK_MAX_SEGMENT_SIZE 65536 -/* num_possible_cpus, alloc_percpu, free_percpu are in linux/percpu.h */ - /* Block device properties */ #define bdev_nonrot(bdev) ({ (void)(bdev); 0; }) @@ -1212,16 +773,9 @@ struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned #define sb_issue_discard(sb, sector, nr_sects, gfp, flags) \ ({ (void)(sb); (void)(sector); (void)(nr_sects); (void)(gfp); (void)(flags); 0; }) -/* atomic_sub, atomic64_sub, atomic_dec_and_test are in asm-generic/atomic.h */ - -/* RCU list operations are in linux/rcupdate.h */ - /* raw_cpu_ptr - get pointer to per-CPU data for current CPU */ #define raw_cpu_ptr(ptr) (ptr) -/* schedule_timeout_uninterruptible, need_resched are in linux/sched.h */ - -/* sb_find_get_block_nonatomic, __find_get_block_nonatomic are in linux/buffer_head.h */ #define bdev_discard_granularity(bdev) \ ({ (void)(bdev); 0U; }) @@ -1230,40 +784,15 @@ struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned */ #include -/* refcount operations are now in linux/refcount.h */ - -/* xchg is now in asm-generic/atomic.h */ - -/* printk_ratelimited is in linux/printk.h */ - -/* atomic_inc is in asm-generic/atomic.h */ -/* GFP_NOIO is in linux/slab.h */ - -/* fscrypt page-io stubs are in ext4_fscrypt.h */ - -/* folio writeback operations are in linux/pagemap.h */ -/* writeback control stubs are in linux/pagemap.h */ -/* bio_add_folio is in linux/bio.h */ - /* * Stubs for readpage.c */ -/* mempool is now in linux/mempool.h */ #include -/* folio read operations are in linux/pagemap.h */ -/* fscrypt readpage stubs are in ext4_fscrypt.h */ - -/* fsverity stubs are in linux/fsverity.h */ - -/* readahead operations are in linux/pagemap.h */ - /* prefetch operations */ #define prefetchw(addr) do { (void)(addr); } while (0) -/* block_read_full_folio is in linux/buffer_head.h */ - /* * Stubs for fast_commit.c */ @@ -1271,30 +800,13 @@ struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned /* Wait bit operations - use linux/wait_bit.h */ #include -/* Dentry name snapshot operations are now in linux/dcache.h */ - -/* lockdep_assert_not_held is in linux/lockdep.h */ -/* REQ_IDLE, REQ_PREFLUSH are in linux/blk_types.h */ -/* wake_up_bit is now in linux/wait_bit.h */ - -/* d_alloc, d_drop are now in linux/dcache.h */ - -/* get_current_ioprio is in linux/ioprio.h */ - -/* JBD2 checkpoint.c stubs */ -/* mutex_lock_io is in linux/mutex.h */ -/* write_dirty_buffer is in linux/buffer_head.h */ -/* spin_needbreak is in linux/spinlock.h */ - -/* JBD2 commit.c stubs (folio_trylock is in linux/pagemap.h) */ -/* clear_bit_unlock is in asm-generic/bitops/lock.h */ +/* JBD2 checkpoint.c and commit.c stubs */ #include /* smp_mb__after_atomic is now in linux/smp.h */ #define ktime_get_coarse_real_ts64(ts) do { (ts)->tv_sec = 0; (ts)->tv_nsec = 0; } while (0) #define filemap_fdatawait_range_keep_errors(m, s, e) \ ({ (void)(m); (void)(s); (void)(e); 0; }) #define crc32_be(crc, p, len) crc32(crc, p, len) -/* free_buffer_head is in linux/buffer_head.h */ /* ext4l support functions (support.c) */ void ext4l_crc32c_init(void); @@ -1317,10 +829,7 @@ struct disk_partition *ext4l_get_partition(void); /* DEFINE_WAIT stub - creates a wait queue entry */ #define DEFINE_WAIT(name) int name = 0 -/* cond_resched_lock is in linux/sched.h */ - /* JBD2 journal.c stubs */ -/* alloc_buffer_head, __getblk are in linux/buffer_head.h */ int bmap(struct inode *inode, sector_t *block); /* seq_file operations for /proc - stubs */ @@ -1334,30 +843,19 @@ int bmap(struct inode *inode, sector_t *block); ssize_t seq_read(struct file *f, char *b, size_t s, loff_t *p); loff_t seq_lseek(struct file *f, loff_t o, int w); -/* S_IRUGO is in linux/fs.h */ - -/* procfs stubs are now in linux/proc_fs.h */ - -/* lockdep_init_map and lock_class_key are in linux/lockdep.h */ - /* Block device operations for journal.c */ -/* bh_read, bh_read_nowait, bh_readahead_batch are in linux/buffer_head.h */ #define truncate_inode_pages_range(m, s, e) \ do { (void)(m); (void)(s); (void)(e); } while (0) #define blkdev_issue_discard(bdev, s, n, gfp) \ ({ (void)(bdev); (void)(s); (void)(n); (void)(gfp); 0; }) #define blkdev_issue_zeroout(bdev, s, n, gfp, f) \ ({ (void)(bdev); (void)(s); (void)(n); (void)(gfp); (void)(f); 0; }) -/* SECTOR_SHIFT, SECTOR_SIZE are in linux/blk_types.h */ -/* mapping_max_folio_order is in linux/pagemap.h */ /* Memory allocation for journal.c */ #define __get_free_pages(gfp, order) ((unsigned long)memalign(PAGE_SIZE, PAGE_SIZE << (order))) #define free_pages(addr, order) free((void *)(addr)) #define get_order(size) ilog2(roundup_pow_of_two((size) / PAGE_SIZE)) -/* pr_notice_ratelimited is in linux/printk.h */ - /* * Stubs for mmp.c */ @@ -1373,23 +871,15 @@ loff_t seq_lseek(struct file *f, loff_t o, int w); #define down_write_nested(sem, subclass) \ do { (void)(sem); (void)(subclass); } while (0) -/* filemap_release_folio is in linux/pagemap.h */ - -/* IS_SWAPFILE is in linux/fs.h */ - /* PAGE_MASK - mask for page alignment */ #ifndef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE - 1)) #endif -/* lock_two_nondirectories, unlock_two_nondirectories are in linux/fs.h */ - /* * Stubs for resize.c */ -/* test_and_set_bit_lock is in asm-generic/bitops/lock.h */ - /* time_is_before_jiffies - check if time is before current jiffies */ #define time_is_before_jiffies(a) ({ (void)(a); 0; }) From patchwork Wed Jan 21 22:08:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1730 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=1769033366; bh=YRgNrqZTkmaCSjNTOHHVAgk75JCk0UoTrO6wVBcqzSA=; 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=YS9kPPV16fNNpGXbs4u2KfkBCTgmNfnN7Q8NUfOdVk4LwQb29y/yPWetNUTkNLWhP iFPa0w2gn9EseJ4XEPhfs9FTu5fBmVi1ZUbRszZVYxJJcGLGHOgpEp5v8qD98sRPYl Zi3eLNMTS/1kG5/0Si172gujt4i1fBRoIqr0+gbTV3M1ellBuDnqzw+fqCCCHDro84 HzQGyfvBgczCsJd1/GUhAO1lIZNHc2Ule4ZAhWZsvGuuDE8Htd2Y5/U1E7twwjgh4K ncNIdAdQZ58VRE2S8Erail2B9PE3D73mxeopGx974bJXR8zZahCLZk95Pyejn3Q0K5 2W9CdmauBdpMw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D044C695FF for ; Wed, 21 Jan 2026 15:09:26 -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 AccMciD2KKQQ for ; Wed, 21 Jan 2026 15:09:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033366; bh=YRgNrqZTkmaCSjNTOHHVAgk75JCk0UoTrO6wVBcqzSA=; 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=YS9kPPV16fNNpGXbs4u2KfkBCTgmNfnN7Q8NUfOdVk4LwQb29y/yPWetNUTkNLWhP iFPa0w2gn9EseJ4XEPhfs9FTu5fBmVi1ZUbRszZVYxJJcGLGHOgpEp5v8qD98sRPYl Zi3eLNMTS/1kG5/0Si172gujt4i1fBRoIqr0+gbTV3M1ellBuDnqzw+fqCCCHDro84 HzQGyfvBgczCsJd1/GUhAO1lIZNHc2Ule4ZAhWZsvGuuDE8Htd2Y5/U1E7twwjgh4K ncNIdAdQZ58VRE2S8Erail2B9PE3D73mxeopGx974bJXR8zZahCLZk95Pyejn3Q0K5 2W9CdmauBdpMw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BF0C4695FB for ; Wed, 21 Jan 2026 15:09:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033364; bh=tPIcluNXZRDzXmvBfNwNNfqzWoMWaTPSAtH3ZS+tYDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j8+SB5ytYtKq1xrCkWdGVIT9NmKaR1xzyScyWZUi142YBqYWfz3YMumhhGG9/KhSR 3Dji1HWIfe5rJewL39hiPlbS5g50o6wgBa7WH6QkWg1w7UPkd7lb7qOnNeVzxk0s9T nKDNpQmYVpJRU5HP0M6n7KloZHuTEp1eeCAg/lshuNGFuO+oURB7lWqBLzmcW8WD+V sDvHoGmhFEc8nHYKC4eNSu4/57EThGAEeUjIL82ySdNv0yuo7a/c5aiFPIYQa1bbhQ mfVSvHrS6J5TOjEYO+q/JWgy20+JLETQMI3qyYu6vuxCt1vMssOvPd/JGp+PptB/GD QPXpfctcvbCaw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D3001695F7; Wed, 21 Jan 2026 15:09: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 9Btz0_kaKyLF; Wed, 21 Jan 2026 15:09:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033359; bh=BiI2x4FNxTDaLon358FuNNJ0VKFXfymiHdq8WsnrjpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qxoeokdLNg64C/fR25UPYiVjSW4ywbzsRkhgXKKcS0GKc2SgGplCAiEljVdoeCpqj jfbeDUTIxdgvj99mMcAJO8rImCrs4GDG9uwmmFLKjL4rwym4CYO4TceSTll/jGlGTo APqWhYceT625dTeiw7ROl/rFsSZwKNXXLD8Z0E1ff9FKFEXtf4qeH5iwWre3aGzfLj skgQCCuU74x5fiYmiXyJ+2eTrjg7J9vpdYUTQ5UztODjn5ut+4t5XKigU8zrM0ACLD lBMlP5pk15RmkE0q9S5L/8v6dza71vhKn7z3C+Q3FM0sZCnTYtx4kQbvRk328aJbif GedIDgzvAKPiw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C1F1B695FB; Wed, 21 Jan 2026 15:09:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:17 -0700 Message-ID: <20260121220857.2137568-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: H3AIPGKZGPXZL6IXTJBAPOBEOJY3N324 X-Message-ID-Hash: H3AIPGKZGPXZL6IXTJBAPOBEOJY3N324 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 04/33] ext4l: Move file_operations and inode_operations to linux/fs.h 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 Move the file_operations and inode_operations structure definitions from ext4_uboot.h to include/linux/fs.h where they belong according to Linux kernel conventions. Add necessary forward declarations for types used by these structures (delayed_call, fiemap_extent_info, file_kattr, posix_acl, mnt_idmap, kstat). Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 48 --------------------------------- include/linux/fs.h | 63 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 48 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 5d62c49663c..fb5c7cc8872 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -524,18 +524,6 @@ ssize_t generic_read_dir(struct file *f, char __user *buf, size_t count, /* struct_size - use linux/overflow.h */ #include -/* file_operations - extended for dir.c */ -struct file_operations { - int (*open)(struct inode *, struct file *); - loff_t (*llseek)(struct file *, loff_t, int); - ssize_t (*read)(struct file *, char *, size_t, loff_t *); - int (*iterate_shared)(struct file *, struct dir_context *); - long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); - int (*fsync)(struct file *, loff_t, loff_t, int); - int (*release)(struct inode *, struct file *); -}; - -/* delayed_call - use linux/delayed_call.h */ #include #define kfree_link kfree @@ -546,42 +534,6 @@ static inline void nd_terminate_link(void *name, loff_t len, int maxlen) ((char *)name)[min_t(loff_t, len, maxlen)] = '\0'; } -/* inode_operations - for file and directory operations */ -struct inode_operations { - /* Symlink operations */ - const char *(*get_link)(struct dentry *, struct inode *, - struct delayed_call *); - /* Common operations */ - int (*getattr)(struct mnt_idmap *, const struct path *, - struct kstat *, u32, unsigned int); - ssize_t (*listxattr)(struct dentry *, char *, size_t); - int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64, u64); - int (*setattr)(struct mnt_idmap *, struct dentry *, struct iattr *); - struct posix_acl *(*get_inode_acl)(struct inode *, int, bool); - int (*set_acl)(struct mnt_idmap *, struct dentry *, - struct posix_acl *, int); - int (*fileattr_get)(struct dentry *, struct file_kattr *); - int (*fileattr_set)(struct mnt_idmap *, struct dentry *, - struct file_kattr *); - /* Directory operations */ - struct dentry *(*lookup)(struct inode *, struct dentry *, unsigned int); - int (*create)(struct mnt_idmap *, struct inode *, struct dentry *, - umode_t, bool); - int (*link)(struct dentry *, struct inode *, struct dentry *); - int (*unlink)(struct inode *, struct dentry *); - int (*symlink)(struct mnt_idmap *, struct inode *, struct dentry *, - const char *); - struct dentry *(*mkdir)(struct mnt_idmap *, struct inode *, - struct dentry *, umode_t); - int (*rmdir)(struct inode *, struct dentry *); - int (*mknod)(struct mnt_idmap *, struct inode *, struct dentry *, - umode_t, dev_t); - int (*rename)(struct mnt_idmap *, struct inode *, struct dentry *, - struct inode *, struct dentry *, unsigned int); - int (*tmpfile)(struct mnt_idmap *, struct inode *, struct file *, - umode_t); -}; - /* file open helper */ #define simple_open(i, f) ({ (void)(i); (void)(f); 0; }) diff --git a/include/linux/fs.h b/include/linux/fs.h index aac88e7c68c..3f82a027931 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -402,4 +402,67 @@ struct fstrim_range { u64 minlen; }; +/* Forward declarations for file/inode operations */ +struct delayed_call; +struct fiemap_extent_info; +struct file_kattr; +struct posix_acl; +struct mnt_idmap; +struct kstat; + +/** + * struct file_operations - filesystem file operations + * + * Methods for file I/O and directory iteration. + */ +struct file_operations { + int (*open)(struct inode *, struct file *); + loff_t (*llseek)(struct file *, loff_t, int); + ssize_t (*read)(struct file *, char *, size_t, loff_t *); + int (*iterate_shared)(struct file *, struct dir_context *); + long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); + int (*fsync)(struct file *, loff_t, loff_t, int); + int (*release)(struct inode *, struct file *); +}; + +/** + * struct inode_operations - filesystem inode operations + * + * Methods for inode manipulation, including symlinks and directories. + */ +struct inode_operations { + /* Symlink operations */ + const char *(*get_link)(struct dentry *, struct inode *, + struct delayed_call *); + /* Common operations */ + int (*getattr)(struct mnt_idmap *, const struct path *, + struct kstat *, u32, unsigned int); + ssize_t (*listxattr)(struct dentry *, char *, size_t); + int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64, u64); + int (*setattr)(struct mnt_idmap *, struct dentry *, struct iattr *); + struct posix_acl *(*get_inode_acl)(struct inode *, int, bool); + int (*set_acl)(struct mnt_idmap *, struct dentry *, + struct posix_acl *, int); + int (*fileattr_get)(struct dentry *, struct file_kattr *); + int (*fileattr_set)(struct mnt_idmap *, struct dentry *, + struct file_kattr *); + /* Directory operations */ + struct dentry *(*lookup)(struct inode *, struct dentry *, unsigned int); + int (*create)(struct mnt_idmap *, struct inode *, struct dentry *, + umode_t, bool); + int (*link)(struct dentry *, struct inode *, struct dentry *); + int (*unlink)(struct inode *, struct dentry *); + int (*symlink)(struct mnt_idmap *, struct inode *, struct dentry *, + const char *); + struct dentry *(*mkdir)(struct mnt_idmap *, struct inode *, + struct dentry *, umode_t); + int (*rmdir)(struct inode *, struct dentry *); + int (*mknod)(struct mnt_idmap *, struct inode *, struct dentry *, + umode_t, dev_t); + int (*rename)(struct mnt_idmap *, struct inode *, struct dentry *, + struct inode *, struct dentry *, unsigned int); + int (*tmpfile)(struct mnt_idmap *, struct inode *, struct file *, + umode_t); +}; + #endif /* _LINUX_FS_H */ From patchwork Wed Jan 21 22:08:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1731 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=1769033371; bh=xt6qnhFKL9WyVTInrzm1Z4esRtHuNW9HQZNyJp230tM=; 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=Iff/cZIO1LYEopOF7d0MIka0OlQrM4c7QXY6IWY0TLU326TWfN4/9UCwtkeMCDu2/ 0TVyx7kcOOPjAHtkp8ElaQGwD1XLepsr0rAxA8HqscHw/SbxFz2ByOdEWJONdLtpgr 2rqMmurrkWEXBhBvLMYK5F+T5I8S75lDgW5rLPBsC9Mfojl+k899gqjFLtsGsZ29u0 LhL+TpO2xL9PJHIY1YNeU35uMH585WmPk3/V8Kxr7bvBVgoRI35PyQ0ddXmlhaLtv3 u+QjzKk2Fozc1J/UcFevFIxEsBMFB1648Z5rcK/PIYF/nmwHXwZVYxf2fbxtdwZjCH akexDB7YU3+2Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5A29D695FF for ; Wed, 21 Jan 2026 15:09:31 -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 Z2U1oRQ2E78b for ; Wed, 21 Jan 2026 15:09:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033371; bh=xt6qnhFKL9WyVTInrzm1Z4esRtHuNW9HQZNyJp230tM=; 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=Iff/cZIO1LYEopOF7d0MIka0OlQrM4c7QXY6IWY0TLU326TWfN4/9UCwtkeMCDu2/ 0TVyx7kcOOPjAHtkp8ElaQGwD1XLepsr0rAxA8HqscHw/SbxFz2ByOdEWJONdLtpgr 2rqMmurrkWEXBhBvLMYK5F+T5I8S75lDgW5rLPBsC9Mfojl+k899gqjFLtsGsZ29u0 LhL+TpO2xL9PJHIY1YNeU35uMH585WmPk3/V8Kxr7bvBVgoRI35PyQ0ddXmlhaLtv3 u+QjzKk2Fozc1J/UcFevFIxEsBMFB1648Z5rcK/PIYF/nmwHXwZVYxf2fbxtdwZjCH akexDB7YU3+2Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 45EFD695FB for ; Wed, 21 Jan 2026 15:09:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033369; bh=rpe9aj4cGN2Er3Ad3UM0v/Jyz0aY9Ueoe3X7fuBlO6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wPi6M1x/XsIEFvueIYhg3UblSJFLE1fPvHo012pNVYS6sYGH7teolPXo2yfln+oZ1 rkM/bc3IVfH7zROCVTuCGXvgkckffg37OiEL1iBDyPoHhNLaN8xXez2tdA08koxe6l ebNkj8ktO/eZPYNtmYQunXxWUCqtaG6tvLrNnclR7gAk0VmgYBO0HwBgeGgCuCZCZg SUJQT4tkMqI5+UwKP/8lUA4ATIyG/CdiXiDn8reJkfNi7UEcGO91w8JOzndODc6U93 LaIilVe7S/4PEsLEioZGXhuH8BejDuXISos+ayV5xxhO/T+P87J6DsF3Q/6Ap2NWGi IP//I6Eki8GdQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E6BC695FB; Wed, 21 Jan 2026 15:09:29 -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 u4itpatrfIJ9; Wed, 21 Jan 2026 15:09:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033363; bh=4B/v1dmTUhB2hZLbqW3YM8vh0p76lXxzCJZHjJeOsro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a9XpPLpElwzlKrQgZrWYFDgFdciAU3FLkgGnzxFQByys11eKCOryoeWMo0pK9kSKT 7vLubNBSQ80QU4gG+rqvX0BeTg3w03eakVtHuW94rMs3f2s7rL9mZm0Wzu3m0roPjy VhAzco56ZGAgqm7Uiv2C+xdOYuxz/3yKVvyW+teuNCpOtUbS9NLxUg0i81wc7Dxqe/ qUBn+9+noZVEbmZcPpR43vocG42Y4VMeaFsKGGToMSEwXYRqpSUu4uV1AeQdZfxtvY AJ+LAXOuuG01N4Vynl5e1YRewGpx4X0odIpmxYPT12lhlWTl+uPTtN6lPINT5OtZsv Cz3nLwQbc13lw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 51369695F2; Wed, 21 Jan 2026 15:09:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:18 -0700 Message-ID: <20260121220857.2137568-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LSFKU3CBOZEVEO7MY6EJI7YRDN4IRPFQ X-Message-ID-Hash: LSFKU3CBOZEVEO7MY6EJI7YRDN4IRPFQ 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 05/33] ext4l: Move struct inode and time accessors to linux/fs.h 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 Move the inode structure definition and its time accessor functions from ext4_uboot.h to include/linux/fs.h where they belong according to Linux kernel conventions. This includes: - struct inode definition - inode_get_atime(), inode_get_mtime(), inode_get_ctime() - inode_get_atime_sec(), inode_get_mtime_sec(), inode_get_ctime_sec() - inode_set_atime(), inode_set_mtime(), inode_set_ctime() - inode_set_atime_to_ts(), inode_set_ctime_to_ts() - simple_inode_init_ts() - i_uid_read(), i_gid_read() Add necessary includes to linux/fs.h for inode dependencies (cred.h, rwsem.h, time.h, atomic.h). Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 126 ----------------------------------------- include/linux/fs.h | 129 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 128 insertions(+), 127 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index fb5c7cc8872..6f4ebd7e68b 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -181,105 +181,9 @@ static inline int bdev_read_only(struct block_device *bdev) return bdev ? bdev->read_only : 0; } -#include - #define WHITEOUT_DEV 0 #define WHITEOUT_MODE 0 -struct swap_info_struct; -struct inode_operations; -struct file_operations; - -struct inode { - struct super_block *i_sb; - unsigned long i_ino; - umode_t i_mode; - unsigned int i_nlink; - loff_t i_size; - struct address_space *i_mapping; - struct address_space i_data; - kuid_t i_uid; - kgid_t i_gid; - unsigned long i_blocks; - unsigned int i_generation; - unsigned int i_flags; - unsigned int i_blkbits; - unsigned long i_state; - struct timespec64 i_atime; - struct timespec64 i_mtime; - struct timespec64 i_ctime; - struct list_head i_io_list; - dev_t i_rdev; - const struct inode_operations *i_op; - const struct file_operations *i_fop; - atomic_t i_writecount; /* Count of writers */ - atomic_t i_count; /* Reference count */ - struct rw_semaphore i_rwsem; /* inode lock */ - const char *i_link; /* Symlink target for fast symlinks */ - unsigned short i_write_hint; /* Write life time hint */ - - /* U-Boot: linkage into super_block s_inodes list */ - struct list_head i_sb_list; -}; - -/* Inode time accessors */ -static inline struct timespec64 inode_get_atime(const struct inode *inode) -{ - return inode->i_atime; -} - -static inline struct timespec64 inode_get_mtime(const struct inode *inode) -{ - return inode->i_mtime; -} - -static inline struct timespec64 inode_get_ctime(const struct inode *inode) -{ - return inode->i_ctime; -} - -static inline time_t inode_get_atime_sec(const struct inode *inode) -{ - return inode->i_atime.tv_sec; -} - -static inline time_t inode_get_ctime_sec(const struct inode *inode) -{ - return inode->i_ctime.tv_sec; -} - -static inline time_t inode_get_mtime_sec(const struct inode *inode) -{ - return inode->i_mtime.tv_sec; -} - -static inline void inode_set_ctime(struct inode *inode, time_t sec, long nsec) -{ - inode->i_ctime.tv_sec = sec; - inode->i_ctime.tv_nsec = nsec; -} - -static inline void inode_set_atime(struct inode *inode, time_t sec, long nsec) -{ - inode->i_atime.tv_sec = sec; - inode->i_atime.tv_nsec = nsec; -} - -static inline void inode_set_mtime(struct inode *inode, time_t sec, long nsec) -{ - inode->i_mtime.tv_sec = sec; - inode->i_mtime.tv_nsec = nsec; -} - -static inline void simple_inode_init_ts(struct inode *inode) -{ - struct timespec64 ts = { .tv_sec = 0, .tv_nsec = 0 }; - - inode->i_atime = ts; - inode->i_mtime = ts; - inode->i_ctime = ts; -} - /* * Inode state accessors - simplified for single-threaded U-Boot. * Linux uses READ_ONCE/WRITE_ONCE and lockdep assertions; we use direct access. @@ -450,37 +354,7 @@ struct dx_hash_info { #include #include - -/* Inode time setters - needed for ext4.h */ -static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode, - struct timespec64 ts) -{ - inode->i_atime = ts; - return ts; -} - -static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, - struct timespec64 ts) -{ - inode->i_ctime = ts; - return ts; -} - -/* Inode version operations - use linux/iversion.h */ #include - -/* Inode credential helpers - i_uid_read, i_gid_read need struct inode */ -static inline unsigned int i_uid_read(const struct inode *inode) -{ - return inode->i_uid.val; -} - -static inline unsigned int i_gid_read(const struct inode *inode) -{ - return inode->i_gid.val; -} - -/* Device encoding helpers are now in linux/kdev_t.h */ #include /* UID/GID bit helpers - use linux/highuid.h */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 3f82a027931..e78ac5f7284 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -11,9 +11,12 @@ #include #include #include +#include +#include +#include +#include /* Forward declarations */ -struct inode; struct buffer_head; struct file; struct folio; @@ -100,6 +103,130 @@ struct address_space_operations { sector_t *); }; +/* Forward declarations for inode */ +struct inode_operations; +struct file_operations; + +/** + * struct inode - filesystem inode + * + * Core filesystem object representing a file, directory, or other entity. + */ +struct inode { + struct super_block *i_sb; + unsigned long i_ino; + umode_t i_mode; + unsigned int i_nlink; + loff_t i_size; + struct address_space *i_mapping; + struct address_space i_data; + kuid_t i_uid; + kgid_t i_gid; + unsigned long i_blocks; + unsigned int i_generation; + unsigned int i_flags; + unsigned int i_blkbits; + unsigned long i_state; + struct timespec64 i_atime; + struct timespec64 i_mtime; + struct timespec64 i_ctime; + struct list_head i_io_list; + dev_t i_rdev; + const struct inode_operations *i_op; + const struct file_operations *i_fop; + atomic_t i_writecount; /* Count of writers */ + atomic_t i_count; /* Reference count */ + struct rw_semaphore i_rwsem; /* inode lock */ + const char *i_link; /* Symlink target for fast symlinks */ + unsigned short i_write_hint; /* Write life time hint */ +#ifdef __UBOOT__ + struct list_head i_sb_list; /* Linkage into super_block s_inodes */ +#endif +}; + +/* Inode time accessors */ +static inline struct timespec64 inode_get_atime(const struct inode *inode) +{ + return inode->i_atime; +} + +static inline struct timespec64 inode_get_mtime(const struct inode *inode) +{ + return inode->i_mtime; +} + +static inline struct timespec64 inode_get_ctime(const struct inode *inode) +{ + return inode->i_ctime; +} + +static inline time_t inode_get_atime_sec(const struct inode *inode) +{ + return inode->i_atime.tv_sec; +} + +static inline time_t inode_get_ctime_sec(const struct inode *inode) +{ + return inode->i_ctime.tv_sec; +} + +static inline time_t inode_get_mtime_sec(const struct inode *inode) +{ + return inode->i_mtime.tv_sec; +} + +static inline void inode_set_ctime(struct inode *inode, time_t sec, long nsec) +{ + inode->i_ctime.tv_sec = sec; + inode->i_ctime.tv_nsec = nsec; +} + +static inline void inode_set_atime(struct inode *inode, time_t sec, long nsec) +{ + inode->i_atime.tv_sec = sec; + inode->i_atime.tv_nsec = nsec; +} + +static inline void inode_set_mtime(struct inode *inode, time_t sec, long nsec) +{ + inode->i_mtime.tv_sec = sec; + inode->i_mtime.tv_nsec = nsec; +} + +static inline void simple_inode_init_ts(struct inode *inode) +{ + struct timespec64 ts = { .tv_sec = 0, .tv_nsec = 0 }; + + inode->i_atime = ts; + inode->i_mtime = ts; + inode->i_ctime = ts; +} + +static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode, + struct timespec64 ts) +{ + inode->i_atime = ts; + return ts; +} + +static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, + struct timespec64 ts) +{ + inode->i_ctime = ts; + return ts; +} + +/* Inode credential helpers */ +static inline unsigned int i_uid_read(const struct inode *inode) +{ + return inode->i_uid.val; +} + +static inline unsigned int i_gid_read(const struct inode *inode) +{ + return inode->i_gid.val; +} + /* block_device - minimal stub */ struct block_device { struct address_space *bd_mapping; From patchwork Wed Jan 21 22:08:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1732 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=1769033376; bh=iO99h1Rpb+vax7XwgGHHVZXOc2T4P4ghi9iibbk+uns=; 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=guaJzuXJgrsTxMvrNH08mQ9rD/lXEimHWhiFpFoFCRar6h23t35aBS/zdRyhLLLmL hRxjuoiVLCZ/YL5TaXPjiTXQ35yKZzwILqdl7K59px7gMydECYbRolYw/cjP9dHtDd orYfXlQACeWC/xsS36MbkpDpT0oBEZCtEw/0FuGe6WYDR9tbZuPJiN1hViX5soqX4M bqnec096ot81fThU9yM+CAFybTH59ECVEtkbbosFgff31mC+yt5iAVmqE5kixoTbMK WPo05EsUawxEQL4nz7xsLQwtvBs4CV6M4ss1T0OjhVfKh4k/TViJORx3FmSovqUPut VfsK1Xw72ZppA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 50D62695FF for ; Wed, 21 Jan 2026 15:09:36 -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 W9h5So6bCP8r for ; Wed, 21 Jan 2026 15:09:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033376; bh=iO99h1Rpb+vax7XwgGHHVZXOc2T4P4ghi9iibbk+uns=; 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=guaJzuXJgrsTxMvrNH08mQ9rD/lXEimHWhiFpFoFCRar6h23t35aBS/zdRyhLLLmL hRxjuoiVLCZ/YL5TaXPjiTXQ35yKZzwILqdl7K59px7gMydECYbRolYw/cjP9dHtDd orYfXlQACeWC/xsS36MbkpDpT0oBEZCtEw/0FuGe6WYDR9tbZuPJiN1hViX5soqX4M bqnec096ot81fThU9yM+CAFybTH59ECVEtkbbosFgff31mC+yt5iAVmqE5kixoTbMK WPo05EsUawxEQL4nz7xsLQwtvBs4CV6M4ss1T0OjhVfKh4k/TViJORx3FmSovqUPut VfsK1Xw72ZppA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3ED28695F7 for ; Wed, 21 Jan 2026 15:09:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033373; bh=qlMiv1Et73b5KLFTiCpOlShrN0mXKac0oe2/66f/9VY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qjwrPXBEt0rILfYlsG1QlPupMpAR4S1alL4Q37JL1mY57dTc+VHafBSK3PZXfV5G0 JyJ9wlMP3nroHIuXN0ZUjFqJ6QKzGt0CfPH56Ycx0E+8NI6pEGirHAcHW69JdH8HAn jjepL5UGzYm784sLNvtzgLC3DE9jQVyHbWrXEZNt7lOlVPzv7/Qn0T7MkP0Xr48RIg ZsAo0YOR5UjC//UUi/7N7OAQwzXMw7/MpqjP/XoRbKWsp4K+JJ5EL6BLe3ml1YTZGj L5Sk0nrPuZDvhgkgWAcYaxIAvM/f7rUpgPG+vXyFKRGrRZsrO+sU5Y7BbEDRb9DPcW 4nBEw5aDFtEbA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C03BC695F2; Wed, 21 Jan 2026 15:09:33 -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 G2ftYYGKKT9I; Wed, 21 Jan 2026 15:09:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033368; bh=JyDic1YiImbB+Dq6tcD40YPchTHnekirymnNQ7Y9dQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I83FTsWCu5fXIp5AGT0F7x6A1YpCZQK1H/kvNq1NxcOJnF/JiRCrZG1OI2Z57/izz NMg9EKLZTCF522IJ4CWkrAH/YUYs4KkWSbWAunUBRreQlmcQ1R/5tepzN3EOihoFfk 3rhZD0wONSgG+GAjc3ZSs7nHtIn/+8CYSsYjL8zOpe1afXwxcCbsHjS2U5GM65PXXR x4DtEYLX8ZbOKUtvcsg/psqOgPZn9XQE53tdYAv1qBp0tnl/K1l3Wmwi/FJTb4fzVU HMzhffVenc8iNHpU0+Mb62dM8agQTnNXFEcUrIqg132Nx+sSvHd0cuEzzaOtl4zyPo c9y+4kBjQOuSw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1AF77695F7; Wed, 21 Jan 2026 15:09:28 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:19 -0700 Message-ID: <20260121220857.2137568-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WUP4A7E3GFOJ44ASMDSBXLW2HP3HI475 X-Message-ID-Hash: WUP4A7E3GFOJ44ASMDSBXLW2HP3HI475 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 06/33] ext4l: Move sb_ functions and SB_ macros to super_types.h 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 Move superblock-related functions and macros from ext4_uboot.h to include/linux/fs/super_types.h where struct super_block is defined. This includes: - sb_start_intwrite(), sb_end_intwrite(), sb_start_intwrite_trylock() - sb_start_pagefault(), sb_end_pagefault() - sb_set_blocksize(), sb_min_blocksize(), sb_bdev_nr_blocks() - sb_issue_zeroout(), sb_issue_discard() - sb_is_blkdev_sb(), sb_no_casefold_compat_fallback() - super_set_uuid() - SB_I_CGROUPWB, SB_I_ALLOW_HSM Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 42 -------------------------------- include/linux/fs/super_types.h | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 6f4ebd7e68b..0cddc46cf98 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -132,7 +132,6 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, #endif /* Block device operations - stubs */ -#define sb_issue_zeroout(sb, blk, num, gfp) ({ (void)(sb); (void)(blk); (void)(num); (void)(gfp); 0; }) #define blkdev_issue_flush(bdev) ({ (void)(bdev); 0; }) #include @@ -281,7 +280,6 @@ struct dx_hash_info { #define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) -#define sb_no_casefold_compat_fallback(sb) ({ (void)(sb); 1; }) #define generic_ci_validate_strict_name(d, n) ({ (void)(d); (void)(n); 1; }) #include @@ -343,14 +341,6 @@ struct dx_hash_info { #define dax_zero_range(i, p, l, d, op) ({ (void)(i); (void)(p); (void)(l); (void)(d); (void)(op); -EOPNOTSUPP; }) #define dax_break_layout_inode(i, m) ({ (void)(i); (void)(m); 0; }) -/* Superblock freezing stubs */ -#define sb_start_intwrite(sb) do { (void)(sb); } while (0) -#define sb_end_intwrite(sb) do { (void)(sb); } while (0) -#define sb_start_intwrite_trylock(sb) ({ (void)(sb); 1; }) -#define sb_start_pagefault(sb) do { (void)(sb); } while (0) -#define sb_end_pagefault(sb) do { (void)(sb); } while (0) - -/* d_path, path_put - use linux/path.h */ #include #include @@ -465,9 +455,6 @@ void ext4_unregister_li_request(struct super_block *sb); /* I/O priority classes - use linux/ioprio.h */ #include -#define SB_I_CGROUPWB 0 /* Not supported in U-Boot */ -#define SB_I_ALLOW_HSM 0 /* Not supported in U-Boot */ - /* blk_holder_ops for block device */ struct blk_holder_ops { void (*mark_dead)(struct block_device *, bool); @@ -531,32 +518,9 @@ void free_page(unsigned long addr); void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, void *holder); -/* Superblock blocksize - declaration for stub.c */ -int sb_set_blocksize(struct super_block *sb, int size); - -/* Superblock min blocksize - stub */ -static inline int sb_min_blocksize(struct super_block *sb, int size) -{ - return sb_set_blocksize(sb, size); -} - /* Block device size - declarations for stub.c */ int generic_check_addressable(unsigned int blocksize_bits, u64 num_blocks); -u64 sb_bdev_nr_blocks(struct super_block *sb); unsigned int bdev_max_discard_sectors(struct block_device *bdev); - -/* Superblock identity functions */ -static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, - unsigned len) -{ - if (len > sizeof(sb->s_uuid.b)) - len = sizeof(sb->s_uuid.b); - memcpy(sb->s_uuid.b, uuid, len); -} - -/* super_set_sysfs_name_bdev is now in linux/kobject.h */ - -/* mb_cache - use linux/mbcache.h */ #include /* xattr helper stubs for xattr.c */ @@ -595,10 +559,6 @@ struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned /* Block device properties */ #define bdev_nonrot(bdev) ({ (void)(bdev); 0; }) -/* sb_issue_discard - issue discard request (no-op in U-Boot) */ -#define sb_issue_discard(sb, sector, nr_sects, gfp, flags) \ - ({ (void)(sb); (void)(sector); (void)(nr_sects); (void)(gfp); (void)(flags); 0; }) - /* raw_cpu_ptr - get pointer to per-CPU data for current CPU */ #define raw_cpu_ptr(ptr) (ptr) @@ -650,8 +610,6 @@ void ext4l_print_msgs(void); struct blk_desc *ext4l_get_blk_dev(void); struct disk_partition *ext4l_get_partition(void); -#define sb_is_blkdev_sb(sb) ({ (void)(sb); 0; }) - /* DEFINE_WAIT stub - creates a wait queue entry */ #define DEFINE_WAIT(name) int name = 0 diff --git a/include/linux/fs/super_types.h b/include/linux/fs/super_types.h index c575d268c43..189a40dd123 100644 --- a/include/linux/fs/super_types.h +++ b/include/linux/fs/super_types.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -98,4 +99,47 @@ static inline bool sb_rdonly(const struct super_block *sb) #define sb_end_write(sb) do { (void)(sb); } while (0) #define sb_start_write_trylock(sb) ({ (void)(sb); 1; }) +/* Superblock internal write operations */ +#define sb_start_intwrite(sb) do { (void)(sb); } while (0) +#define sb_end_intwrite(sb) do { (void)(sb); } while (0) +#define sb_start_intwrite_trylock(sb) ({ (void)(sb); 1; }) + +/* Superblock pagefault operations */ +#define sb_start_pagefault(sb) do { (void)(sb); } while (0) +#define sb_end_pagefault(sb) do { (void)(sb); } while (0) + +/* Superblock internal flags */ +#define SB_I_CGROUPWB 0 /* Not supported in U-Boot */ +#define SB_I_ALLOW_HSM 0 /* Not supported in U-Boot */ + +/* Superblock block size operations - sb_set_blocksize in stub.c */ +int sb_set_blocksize(struct super_block *sb, int size); + +static inline int sb_min_blocksize(struct super_block *sb, int size) +{ + return sb_set_blocksize(sb, size); +} + +/* Superblock block device operations */ +u64 sb_bdev_nr_blocks(struct super_block *sb); +#define sb_is_blkdev_sb(sb) ({ (void)(sb); 0; }) + +/* Superblock discard/zeroout operations - no-op in U-Boot */ +#define sb_issue_zeroout(sb, blk, num, gfp) \ + ({ (void)(sb); (void)(blk); (void)(num); (void)(gfp); 0; }) +#define sb_issue_discard(sb, sector, nr_sects, gfp, flags) \ + ({ (void)(sb); (void)(sector); (void)(nr_sects); (void)(gfp); (void)(flags); 0; }) + +/* Case-folding - not supported in U-Boot */ +#define sb_no_casefold_compat_fallback(sb) ({ (void)(sb); 1; }) + +/* Superblock identity functions */ +static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, + unsigned len) +{ + if (len > sizeof(sb->s_uuid.b)) + len = sizeof(sb->s_uuid.b); + memcpy(sb->s_uuid.b, uuid, len); +} + #endif /* _LINUX_FS_SUPER_TYPES_H */ From patchwork Wed Jan 21 22:08:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1733 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=1769033380; bh=y9nSUGcgIeG8sp01Nnqkjncop2NpMFmFzgBHVsvpfBk=; 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=pvuvHHrBx09+qD+TB4oLOEGY/ncERFge8lVtvt+9Vl/HFJDnD8kg1ti0g8ApHw1O4 BF/4zEFeKW1i9JKyoEwUpQEpGFpgYs0Vxx5wbE+xsISHDeU3/KU34LfluQ3enb3HXc XTlR1l6+Hq49TXROngDwpUZh1W0MgoCkkqZ6dwYBLGcuGFABpl+VqC0yydcnC6stBm o/Pm6SKNODB7meCTy1BZnOL+C27VOVs0pvuLPOe3fFdVG73ZOiRyG4H9J4LC1t52V8 gYpmHlVi6dybiN/bV5Uy4jCScC6/P0sEeHVOY6SNyH7lc5eXBbctJQ31rRR15sJpNE awM5F4qYIQ3kQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E154069605 for ; Wed, 21 Jan 2026 15:09:40 -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 cQLS3NL517aS for ; Wed, 21 Jan 2026 15:09:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033380; bh=y9nSUGcgIeG8sp01Nnqkjncop2NpMFmFzgBHVsvpfBk=; 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=pvuvHHrBx09+qD+TB4oLOEGY/ncERFge8lVtvt+9Vl/HFJDnD8kg1ti0g8ApHw1O4 BF/4zEFeKW1i9JKyoEwUpQEpGFpgYs0Vxx5wbE+xsISHDeU3/KU34LfluQ3enb3HXc XTlR1l6+Hq49TXROngDwpUZh1W0MgoCkkqZ6dwYBLGcuGFABpl+VqC0yydcnC6stBm o/Pm6SKNODB7meCTy1BZnOL+C27VOVs0pvuLPOe3fFdVG73ZOiRyG4H9J4LC1t52V8 gYpmHlVi6dybiN/bV5Uy4jCScC6/P0sEeHVOY6SNyH7lc5eXBbctJQ31rRR15sJpNE awM5F4qYIQ3kQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D104369601 for ; Wed, 21 Jan 2026 15:09:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033378; bh=mFU8VWVDJFrNMwNmddI/aQgLM1eVIIySnGqQjbGyDag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FaAJRHtl7G8WO77LZzOJXRJvNtetuHxKzifhv9O4yJ8dQUb4HVE0tIkcv6QtcEx2v TQBiHAMOrcZpKJHomveK/WVQKNNeCXCnpYFN4SasiNmM3HlIBsY3+L+mqwBu3mqY0Q usOB7GbxlIQLaOgooghJYAwnLPzO6ITavS8luFguPLKeI0ALoJqLBUUMwMyPSec/mp +RFqxFJdp0qMaLeXL8G6xEK1jgL8nR8uPedLQW29FxXhmjcDtD3EUBroy1CLYxPA4D K6vH09lESs9c5YYyzqwGwR/3Qyr5Q/9EKLuTAnnmLmDa0QjcRgtlJOssKu/QwZJN5f rgcOyBch1fBJA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BC9CC695F7; Wed, 21 Jan 2026 15:09:38 -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 EIwt__ZtXghv; Wed, 21 Jan 2026 15:09:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033372; bh=wxOSfvVM5M2wq7R8m9xw9/pLmybb0kiV1GGL66/xexU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=keMpFbr9Q46iDV7fKDqKAbiw22X8Jgd7h4K7ukjalZbfsBB3B2JUmAFBS3mVsANWH bDJbENsfuPN7fAydCGgYggP0VsYJRNNDWLHYg6ehqH55I+fWGnfpIR3Zb2xrzE7Hea YWu83Yxuk1hkU3lMJ0JWzIHOgQwgzJTzAH+na6mMXMqb988d2MCNO3e8ErAWrh9ze6 ccia4xoyJG59gEj1K562OAHbmU2Si7DrplYKeNfgkau/XpGW19NnaTxbvGKFDBOP06 MyzDiVe/w6qm8wQoM9m7GkFjhsFagXQai8nrEsE5tciRv3jUocwTzICamoE+FQ6T4U q5Wa0/jm2OFsQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B4A20695FB; Wed, 21 Jan 2026 15:09:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:20 -0700 Message-ID: <20260121220857.2137568-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 45RXD4AQKOPM6UUXE7XUOPC3U72QCSV3 X-Message-ID-Hash: 45RXD4AQKOPM6UUXE7XUOPC3U72QCSV3 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 07/33] ext4l: Move seq_ functions to linux/seq_file.h 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 Move seq_file operation stubs and declarations from ext4_uboot.h to include/linux/seq_file.h where they belong. This includes: - seq_open(), seq_release() stubs - seq_read(), seq_lseek() declarations Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 9 --------- include/linux/seq_file.h | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 0cddc46cf98..278351a9fef 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -616,17 +616,8 @@ struct disk_partition *ext4l_get_partition(void); /* JBD2 journal.c stubs */ int bmap(struct inode *inode, sector_t *block); -/* seq_file operations for /proc - stubs */ -#define seq_open(f, ops) ({ (void)(f); (void)(ops); 0; }) -#define seq_release(i, f) ({ (void)(i); (void)(f); 0; }) - -/* proc_ops - use linux/proc_fs.h */ #include -/* seq_read and seq_lseek declarations (defined in stub.c) */ -ssize_t seq_read(struct file *f, char *b, size_t s, loff_t *p); -loff_t seq_lseek(struct file *f, loff_t o, int w); - /* Block device operations for journal.c */ #define truncate_inode_pages_range(m, s, e) \ do { (void)(m); (void)(s); (void)(e); } while (0) diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index c10da3e4f98..6afe754745c 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -29,4 +29,12 @@ struct seq_operations { #define seq_puts(m, s) do { (void)(m); (void)(s); } while (0) #define seq_putc(m, c) do { (void)(m); (void)(c); } while (0) +/* seq_file operations - stubs */ +#define seq_open(f, ops) ({ (void)(f); (void)(ops); 0; }) +#define seq_release(i, f) ({ (void)(i); (void)(f); 0; }) + +/* seq_read and seq_lseek - implemented in ext4l/stub.c */ +ssize_t seq_read(struct file *f, char *b, size_t s, loff_t *p); +loff_t seq_lseek(struct file *f, loff_t o, int w); + #endif /* _LINUX_SEQ_FILE_H */ From patchwork Wed Jan 21 22:08:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1734 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=1769033383; bh=00kvfHFNZoizeiHkQhrqP3PvFPLtOFrqnqqAcE5dtm4=; 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=GHnvf1mWKaBOAFXWyh+fROl4YBfazw0dsFHy/ebvf7iCM84U4IxdLg3ZT0HWlDxPF g//2+vqjbCVF1IszB8a8nXiR1T2hLlp3WYsRFTVhwc9BFNQSTdFFpkrb7IaYkKiz/k nM+pzaaroY7k0GVMIlwuRx5IWstbVDIKI+3zF1vu2kjjyF/MWouaykY+IDjPod4foi KuflH2ZdfLCP141UbYSRbMq0Zp6pJI304Z2FftAF8C1qfgRaijmtW7p3+iqyU/+m0x HjGhDYp9QaCOZ49Cx+EbRfNFjnnSGruNA2meUOPNzgaYazqlm0dp6XqQhhxCYDp6Ul QA+G3MpTshvSw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E51C669605 for ; Wed, 21 Jan 2026 15:09:43 -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 4vrcShMYopoi for ; Wed, 21 Jan 2026 15:09:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033383; bh=00kvfHFNZoizeiHkQhrqP3PvFPLtOFrqnqqAcE5dtm4=; 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=GHnvf1mWKaBOAFXWyh+fROl4YBfazw0dsFHy/ebvf7iCM84U4IxdLg3ZT0HWlDxPF g//2+vqjbCVF1IszB8a8nXiR1T2hLlp3WYsRFTVhwc9BFNQSTdFFpkrb7IaYkKiz/k nM+pzaaroY7k0GVMIlwuRx5IWstbVDIKI+3zF1vu2kjjyF/MWouaykY+IDjPod4foi KuflH2ZdfLCP141UbYSRbMq0Zp6pJI304Z2FftAF8C1qfgRaijmtW7p3+iqyU/+m0x HjGhDYp9QaCOZ49Cx+EbRfNFjnnSGruNA2meUOPNzgaYazqlm0dp6XqQhhxCYDp6Ul QA+G3MpTshvSw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D2D82695F7 for ; Wed, 21 Jan 2026 15:09:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033381; bh=FOB9hjqLSfO6jzGKq/Iy9zNc+2jAvX0/vMXvW5QlbvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/qlswZ8WqJLJ/h/gQGTTNGjhUADAr6Xr3RWY0/cgFGglWMk401m9P1YJeb9AEbqw VzOugCLJtzkzuFu6OXw/8AeV6+KbKZc4PVkRfyi4qVtFBCs9+ktH5tCKcu6HSo+J3L sxx+uHqXdGH9cTB4xeY5JiU4kTWOfNYTe/Ylfk/+/oajQlxoZcvcb3gJzPjofQSBFJ vpIByjINxZEiA9UK1RUCw1OcIsVvyg6XFnRCh4Vv4w+bM/v0KtdToR1okVJl+I1MQi u7GjNAJ+kX2Foxy76F5uXE0KLjxrTGgpTG1cvOGkSzjr0M8EB8pnhqhcxrUXo4MDBM mb1g40FHYdbzQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AC375695F7; Wed, 21 Jan 2026 15:09:41 -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 KP8DQNQdRhyz; Wed, 21 Jan 2026 15:09:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033377; bh=eqnqwuqgoO/gga32Q3m1WGk0SwZwJp9+jbZdsCRPSak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mnw7UE2J83RMWRmThRdctpsZL7NyLexqSyhmSCnl/F+YQYfO6GxJZLWIz3aUlLQ9M I9lNZowm4LLu7egyo5S/GAbDWLLwfy7J0EOwpjqrq1V4N0R0w33XygCmA0ZHbMEBG9 8sKP0GiEtvsrJCL2FhYYbOz4/fBbHh3xbXMvKyne15vwv9QA5/XPt2OTfBFRLdFj9c 1xwN4XVhb68mjJujGjveUGWQRTbnnVmPKLhaF1c5H9fh32xGFLLuVzQ78reerlbGdt L5GFJKqPSHvbCpPcaktY6Oe2KHKPVdtDGQOCqoQpni4lnm0hT/1jIgAB7Fv6SZJ/uP hhRJUG1kmkAfA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 530BF695FD; Wed, 21 Jan 2026 15:09:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:21 -0700 Message-ID: <20260121220857.2137568-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RU2TYVVS4EPRGRZCSLTTJ4OLDWIFYOJ4 X-Message-ID-Hash: RU2TYVVS4EPRGRZCSLTTJ4OLDWIFYOJ4 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 08/33] ext4l: Move inode state accessors to linux/fs.h 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 Move the inode state accessor functions from ext4_uboot.h to include/linux/fs.h where struct inode is defined. This includes: - inode_state_read_once(), inode_state_read() - inode_state_set_raw(), inode_state_set() - inode_state_clear_raw(), inode_state_clear() - inode_state_assign_raw(), inode_state_assign() Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 46 ------------------------------------------- include/linux/fs.h | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 278351a9fef..d3ad76f2618 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -183,52 +183,6 @@ static inline int bdev_read_only(struct block_device *bdev) #define WHITEOUT_DEV 0 #define WHITEOUT_MODE 0 -/* - * Inode state accessors - simplified for single-threaded U-Boot. - * Linux uses READ_ONCE/WRITE_ONCE and lockdep assertions; we use direct access. - */ -static inline unsigned long inode_state_read_once(struct inode *inode) -{ - return inode->i_state; -} - -static inline unsigned long inode_state_read(struct inode *inode) -{ - return inode->i_state; -} - -static inline void inode_state_set_raw(struct inode *inode, unsigned long flags) -{ - inode->i_state |= flags; -} - -static inline void inode_state_set(struct inode *inode, unsigned long flags) -{ - inode->i_state |= flags; -} - -static inline void inode_state_clear_raw(struct inode *inode, - unsigned long flags) -{ - inode->i_state &= ~flags; -} - -static inline void inode_state_clear(struct inode *inode, unsigned long flags) -{ - inode->i_state &= ~flags; -} - -static inline void inode_state_assign_raw(struct inode *inode, - unsigned long flags) -{ - inode->i_state = flags; -} - -static inline void inode_state_assign(struct inode *inode, unsigned long flags) -{ - inode->i_state = flags; -} - /* QSTR_INIT and dotdot_name are now in linux/dcache.h */ /* diff --git a/include/linux/fs.h b/include/linux/fs.h index e78ac5f7284..f50a081b32b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -227,6 +227,52 @@ static inline unsigned int i_gid_read(const struct inode *inode) return inode->i_gid.val; } +/* + * Inode state accessors - simplified for single-threaded U-Boot. + * Linux uses READ_ONCE/WRITE_ONCE and lockdep assertions; we use direct access. + */ +static inline unsigned long inode_state_read_once(struct inode *inode) +{ + return inode->i_state; +} + +static inline unsigned long inode_state_read(struct inode *inode) +{ + return inode->i_state; +} + +static inline void inode_state_set_raw(struct inode *inode, unsigned long flags) +{ + inode->i_state |= flags; +} + +static inline void inode_state_set(struct inode *inode, unsigned long flags) +{ + inode->i_state |= flags; +} + +static inline void inode_state_clear_raw(struct inode *inode, + unsigned long flags) +{ + inode->i_state &= ~flags; +} + +static inline void inode_state_clear(struct inode *inode, unsigned long flags) +{ + inode->i_state &= ~flags; +} + +static inline void inode_state_assign_raw(struct inode *inode, + unsigned long flags) +{ + inode->i_state = flags; +} + +static inline void inode_state_assign(struct inode *inode, unsigned long flags) +{ + inode->i_state = flags; +} + /* block_device - minimal stub */ struct block_device { struct address_space *bd_mapping; From patchwork Wed Jan 21 22:08:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1735 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=1769033389; bh=A40PyQOvyoQI0awypSaWqrtk4Tt+YEas5uyQ2Z0mPOk=; 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=uibjvM4UumNywQPD7xw4TmyR8pkoDVbXgXRZBDX3cfu2I7/ckeFigUgSQ+1+ltTA+ 4p/2G1s+BwEhrXlva9ukgKTfzNYhA7TLYxzn2TiYrKUPLFKwMVhJC1m9jnXji7GRBJ ZXapkR34cvhA9NEIVf2zI++/80HFWOdKXkiIE9R6TBTQfw56JpE8oWKEebg/Mi+Fvo txYwh2TY+/oFDgBYOIr13ryxN3BWXA9fkEEdRiC1Jv0p1si+ObidF/yOnHAu45mSi/ cY/koqrZrdeyEelxt+UgtaCP474Kp5tedNxqvaVcaEwgFjcC45SsuMsEewfclaoPDa dJoSScM8Spt8Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 65C9269601 for ; Wed, 21 Jan 2026 15:09:49 -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 6mT-9XtSDODr for ; Wed, 21 Jan 2026 15:09:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033389; bh=A40PyQOvyoQI0awypSaWqrtk4Tt+YEas5uyQ2Z0mPOk=; 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=uibjvM4UumNywQPD7xw4TmyR8pkoDVbXgXRZBDX3cfu2I7/ckeFigUgSQ+1+ltTA+ 4p/2G1s+BwEhrXlva9ukgKTfzNYhA7TLYxzn2TiYrKUPLFKwMVhJC1m9jnXji7GRBJ ZXapkR34cvhA9NEIVf2zI++/80HFWOdKXkiIE9R6TBTQfw56JpE8oWKEebg/Mi+Fvo txYwh2TY+/oFDgBYOIr13ryxN3BWXA9fkEEdRiC1Jv0p1si+ObidF/yOnHAu45mSi/ cY/koqrZrdeyEelxt+UgtaCP474Kp5tedNxqvaVcaEwgFjcC45SsuMsEewfclaoPDa dJoSScM8Spt8Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 55FDF695FB for ; Wed, 21 Jan 2026 15:09:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033386; bh=piS4okq7QgG6fKDyW4KgwycRf5bbKD3JHCkxnZytkkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LALkAJyrtmu08R7QPDEJUBcI7OG+AkqxTSXQzFWB+LWJvnhTuAsiWO1IiGnyzUXbA JL5qiYfACQU9vNZZ2gyvi14by1Zd4JAXeAdAhFcq2JIBZ/7dtFs3tYpTLnIGMiXbuB PVq3Oj1ujbI68GA/BbyfjYv1kwHF57/NjmyTlbqKotZy2neM8lm/gwzr/hiY+MoHfI NnpyM8z5hjAjXSCe5ar0U6lHPfq/qMYjgMoin135a0jaVeDc0jCW+g5s0zq5i6aA6i C4Nrq+LEXulcFsutd3GLQ8YKNT+zZmZT5EGChLDTeouWDaCKbyHF/UhPHtq7uWVxvu h9ceVDRJ4S1zA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5D71B695F2; Wed, 21 Jan 2026 15:09:46 -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 HKOwF2BQRPp0; Wed, 21 Jan 2026 15:09:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033382; bh=BNfJNQeWnVBIpewHCyL4A1/Yf9enzYr/6af+jGiKhQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUF/e7L2BOm1w6hkOjIQuxFeidk6+3x9Psudk0CFSXnZbgkkZ5L7xyjXfj9KvanSe 5aZ/m6I55dGB365K4HFRrJw/LMlzqFua4FUrGdihYJ6AUHKTM7Ss26gE+9KbAg1/Iv uakDrUL9pgoldNdmsyEKvLrm/UEsMsozczSf4e2SYvZEiN3O7dW6lZupJaVFb/72Tc jxYqlQgbRn6AzutCUezlhVRgqv5b7fsl43oTxmnGsb4bccaSkSL+l/KPQOjuBHIuU5 +KnrQ5hsSVoGQSX1PN4bKQiugFsTKxBy+a4K8Sp6zMvMXsjGAFqz6SzS3qRncdTp3z GSqJkPMxrIQYA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D7BE9695FD; Wed, 21 Jan 2026 15:09:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:22 -0700 Message-ID: <20260121220857.2137568-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QCJ2Y3YJVRE25HBYEG735H2JFHIDZCCA X-Message-ID-Hash: QCJ2Y3YJVRE25HBYEG735H2JFHIDZCCA 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 09/33] ext4l: Move generic VFS operations to linux/fs.h 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 Move the generic VFS operation stubs from ext4_uboot.h to include/linux/fs.h where they belong. This includes: - generic_file_read_iter(), generic_write_checks() - generic_perform_write(), generic_write_sync() - generic_atomic_write_valid() - generic_buffers_fsync_noflush() - generic_fillattr(), generic_fill_statx_atomic_writes() - generic_file_llseek_size() - generic_ci_validate_strict_name() - generic_read_dir(), generic_check_addressable() Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 21 +-------------------- include/linux/fs.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index d3ad76f2618..35626a95cf8 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -224,18 +224,10 @@ struct dx_hash_info { #define file_modified(file) ({ (void)(file); 0; }) #define file_accessed(file) do { (void)(file); } while (0) -/* Generic file operations - stubs for file.c */ -#define generic_file_read_iter(iocb, to) ({ (void)(iocb); (void)(to); 0L; }) -#define generic_write_checks(iocb, from) ({ (void)(iocb); (void)(from); 0L; }) -#define generic_perform_write(iocb, from) ({ (void)(iocb); (void)(from); 0L; }) -#define generic_write_sync(iocb, count) ({ (void)(iocb); (count); }) -#define generic_atomic_write_valid(iocb, from) ({ (void)(iocb); (void)(from); 0; }) #define vfs_setpos(file, offset, maxsize) ({ (void)(file); (void)(maxsize); (offset); }) #define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) -#define generic_ci_validate_strict_name(d, n) ({ (void)(d); (void)(n); 1; }) - #include /* Memory retry wait */ @@ -284,7 +276,6 @@ struct dx_hash_info { /* Sync operations - stubs */ #define sync_mapping_buffers(m) ({ (void)(m); 0; }) #define sync_inode_metadata(i, w) ({ (void)(i); (void)(w); 0; }) -#define generic_buffers_fsync_noflush(f, s, e, d) ({ (void)(f); (void)(s); (void)(e); (void)(d); 0; }) #define file_write_and_wait_range(f, s, e) ({ (void)(f); (void)(s); (void)(e); 0; }) #define file_check_and_advance_wb_err(f) ({ (void)(f); 0; }) @@ -311,8 +302,6 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); #define setattr_prepare(m, d, a) ({ (void)(m); (void)(d); (void)(a); 0; }) #define setattr_copy(m, i, a) do { } while (0) #define posix_acl_chmod(m, i, mo) ({ (void)(m); (void)(i); (void)(mo); 0; }) -#define generic_fillattr(m, req, i, s) do { } while (0) -#define generic_fill_statx_atomic_writes(s, u_m, u_M, g) do { } while (0) /* File operations */ #define file_update_time(f) do { } while (0) @@ -332,13 +321,6 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); /* FSTR_INIT - fscrypt_str initializer (fscrypt_str defined in ext4_fscrypt.h) */ #define FSTR_INIT(n, l) { .name = (n), .len = (l) } -/* File llseek */ -#define generic_file_llseek_size(f, o, w, m, e) ({ (void)(f); (void)(o); (void)(w); (void)(m); (void)(e); 0LL; }) - -/* generic_read_dir - stub function (needs to be a real function for struct init) */ -ssize_t generic_read_dir(struct file *f, char __user *buf, size_t count, - loff_t *ppos); - /* struct_size - use linux/overflow.h */ #include @@ -472,8 +454,7 @@ void free_page(unsigned long addr); void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, void *holder); -/* Block device size - declarations for stub.c */ -int generic_check_addressable(unsigned int blocksize_bits, u64 num_blocks); +/* Block device size - declaration for stub.c */ unsigned int bdev_max_discard_sectors(struct block_device *bdev); #include diff --git a/include/linux/fs.h b/include/linux/fs.h index f50a081b32b..3fa54146f44 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -638,4 +638,37 @@ struct inode_operations { umode_t); }; +/* + * Generic VFS operations - stubs for U-Boot + */ + +/* Generic file I/O operations */ +#define generic_file_read_iter(iocb, to) ({ (void)(iocb); (void)(to); 0L; }) +#define generic_write_checks(iocb, from) ({ (void)(iocb); (void)(from); 0L; }) +#define generic_perform_write(iocb, from) ({ (void)(iocb); (void)(from); 0L; }) +#define generic_write_sync(iocb, count) ({ (void)(iocb); (count); }) +#define generic_atomic_write_valid(iocb, from) ({ (void)(iocb); (void)(from); 0; }) + +/* Generic fsync operation */ +#define generic_buffers_fsync_noflush(f, s, e, d) \ + ({ (void)(f); (void)(s); (void)(e); (void)(d); 0; }) + +/* Generic attribute operations */ +#define generic_fillattr(m, req, i, s) do { } while (0) +#define generic_fill_statx_atomic_writes(s, u_m, u_M, g) do { } while (0) + +/* Generic seek operation */ +#define generic_file_llseek_size(f, o, w, m, e) \ + ({ (void)(f); (void)(o); (void)(w); (void)(m); (void)(e); 0LL; }) + +/* Case-insensitive name validation - not supported */ +#define generic_ci_validate_strict_name(d, n) ({ (void)(d); (void)(n); 1; }) + +/* Generic directory read - implemented in ext4l/stub.c */ +ssize_t generic_read_dir(struct file *f, char __user *buf, size_t count, + loff_t *ppos); + +/* Block addressability check - implemented in ext4l/stub.c */ +int generic_check_addressable(unsigned int blocksize_bits, u64 num_blocks); + #endif /* _LINUX_FS_H */ From patchwork Wed Jan 21 22:08:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1736 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=1769033393; bh=NNKkoRRnDFInCxTli1KUyyxIVSO2MTBi5l01zfckvs8=; 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=hRmc/oc0VcH1Zy8vsgHqNfOGZSklBP1+S5xVLF5HW4LHcPr1GZt6PlnBPuLLQ34En 2+eS7cDvHnB9sBoYlgNPQuG0ouKUF2VMnN74n+f8QNdqdw8aDZCrgsuuAR//+a8Axc VO2Ahg3Amdg4BpkzUYc1nq+cj3idqtaiud+g/XkwjTMqSRNGCEhYltpQl85Vp6ffz0 9PsXk/4qdyON2D5eQcvbATdLIsMw8n3OGmlqwznTDlc7tegSet9KrrJpNrDFievl3h 63I4Nh4aFOuDuAMdSvWvHeercvR6pstnJJqlw/jgaPODSjRXh6413m+2ARuX9Gtxzt R/CPTVyCEOKDA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D49A969601 for ; Wed, 21 Jan 2026 15:09:53 -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 ShKdVF-9S2s0 for ; Wed, 21 Jan 2026 15:09:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033393; bh=NNKkoRRnDFInCxTli1KUyyxIVSO2MTBi5l01zfckvs8=; 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=hRmc/oc0VcH1Zy8vsgHqNfOGZSklBP1+S5xVLF5HW4LHcPr1GZt6PlnBPuLLQ34En 2+eS7cDvHnB9sBoYlgNPQuG0ouKUF2VMnN74n+f8QNdqdw8aDZCrgsuuAR//+a8Axc VO2Ahg3Amdg4BpkzUYc1nq+cj3idqtaiud+g/XkwjTMqSRNGCEhYltpQl85Vp6ffz0 9PsXk/4qdyON2D5eQcvbATdLIsMw8n3OGmlqwznTDlc7tegSet9KrrJpNrDFievl3h 63I4Nh4aFOuDuAMdSvWvHeercvR6pstnJJqlw/jgaPODSjRXh6413m+2ARuX9Gtxzt R/CPTVyCEOKDA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BEED2695FB for ; Wed, 21 Jan 2026 15:09:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033391; bh=ETnnvwM6gXMFTF4twep0duezV2phPORDOq0MmLETh7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qGjVMnHlVSHbmLMIEgEk/b3w1ZskiALwN8wRQAVm3ivNz46Uw0xlBR40wgKeDQcZ5 N5Letl1bH7TqtLAAcobj33v+qfMeHFLLXUXkf87OoYzDqlILvj4xM7MzYhsmRksYT0 ZWk1y7cgsgajoNxNgaOtxqIdyi5pWGI2+oBXClmrGItPV5+aqa3e5ZyfzfwkkvcSoZ 46x7cnVR+ws3l8kaich54c+YIritw28YZRC1NSDOjz5RcZYd9DRwUr+b3dVWS489Or 2+BzksxRTO+5AJsnV6uTQjxlRV1B5yPp+wCFetYdA2HGboMjclspxX9MWUN0ylMUgo TxewMttVtpJvQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C68DB695FB; Wed, 21 Jan 2026 15:09:51 -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 seHi9dkS75Rr; Wed, 21 Jan 2026 15:09:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033386; bh=HQ8+QODphPaPS2BusZRynWTp57bheQ8kiWSR+k/k7pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rP7tSq1NnzaxitoyF/gag0Ov2of2J2qZevIH+XWuAAG/lGupnibDB+iCkg0FJJOg0 0d202JzpCTwC5dtjqfI9AMDiB1yoyH9eXli6ggTqdYtgEZR+yfXW+vfYuGWGRYHwWM DKlxJnrvllqTLUcsE0iGHNp7yqTONoPl9V5tyyeDyFCLTmsQQ2Vq/Wcuok3alXgVS/ 4IEHaamy7k8iaZOdiIF4wpMiRLf3zcv5H4HWEgsG3DtXO9yV9//T6zSFqSq7zSYFDC qphnWXKc9hFpJ5moTcvCGJ6NelgzZyR0mHXmcymnA311HXO+VlhpGy/sJLqooWzif/ Df52ySUUuxZOg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6CEE2695F7; Wed, 21 Jan 2026 15:09:46 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:23 -0700 Message-ID: <20260121220857.2137568-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: H6FFXCKXC6UD77ERNBEBMPR67GPOTGTW X-Message-ID-Hash: H6FFXCKXC6UD77ERNBEBMPR67GPOTGTW 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/33] ext4l: Move block device operations to linux/blkdev.h 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 Move block device operation stubs and declarations from ext4_uboot.h to include/linux/blkdev.h where they belong. This includes: - bdev_read_only(), bdev_write_zeroes_unmap_sectors() - bdev_dma_alignment(), bdev_nonrot(), bdev_discard_granularity() - bdev_max_discard_sectors(), bdev_fput(), bdev_file_open_by_dev() - bdev_getblk(), __bread(), set_blocksize() - sync_blockdev(), invalidate_bdev() - blkdev_issue_flush(), blkdev_issue_discard(), blkdev_issue_zeroout() - BLK_MAX_SEGMENT_SIZE constant Move bdev_read_only() implementation to stub.c since it needs the full struct block_device definition. Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 46 +----------------------------------------- fs/ext4l/stub.c | 5 +++++ include/linux/blkdev.h | 39 +++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 35626a95cf8..f12dbe2b76d 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -131,9 +131,6 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, bool is_create); #endif -/* Block device operations - stubs */ -#define blkdev_issue_flush(bdev) ({ (void)(bdev); 0; }) - #include #include @@ -175,11 +172,6 @@ struct readahead_control; struct fiemap_extent_info; struct folio; -static inline int bdev_read_only(struct block_device *bdev) -{ - return bdev ? bdev->read_only : 0; -} - #define WHITEOUT_DEV 0 #define WHITEOUT_MODE 0 @@ -233,9 +225,6 @@ struct dx_hash_info { /* Memory retry wait */ #define memalloc_retry_wait(g) do { } while (0) -/* bdev operations */ -#define bdev_write_zeroes_unmap_sectors(b) ({ (void)(b); 0; }) - /* indirect.c stubs */ /* ext4_sb_bread_nofail is stubbed in interface.c */ @@ -311,9 +300,6 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); #define iomap_bmap(m, b, o) ({ (void)(m); (void)(b); (void)(o); 0UL; }) #define iomap_swapfile_activate(s, f, sp, o) ({ (void)(s); (void)(f); (void)(sp); (void)(o); -EOPNOTSUPP; }) -/* Block device alignment */ -#define bdev_dma_alignment(bd) (0) - /* * Additional stubs for dir.c */ @@ -411,9 +397,7 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate); /* blockgroup_lock - use linux/blockgroup_lock.h */ #include -/* Buffer submission stubs - declarations for stub.c implementations */ -struct buffer_head *bdev_getblk(struct block_device *bdev, sector_t block, - unsigned int size, gfp_t gfp); +/* Buffer submission stubs - declaration for stub.c */ int trylock_buffer(struct buffer_head *bh); /* Trace stubs for super.c - declaration for stub.c implementation */ @@ -428,10 +412,6 @@ void fsnotify_sb_error(struct super_block *sb, struct inode *inode, int error); char *file_path(struct file *file, char *buf, int buflen); struct block_device *file_bdev(struct file *file); -/* Block device sync - declarations for stub.c */ -int sync_blockdev(struct block_device *bdev); -void invalidate_bdev(struct block_device *bdev); - /* kobject_put is now in linux/kobject.h */ /* wait_for_completion is now a macro in linux/completion.h */ @@ -454,26 +434,15 @@ void free_page(unsigned long addr); void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, void *holder); -/* Block device size - declaration for stub.c */ -unsigned int bdev_max_discard_sectors(struct block_device *bdev); #include /* xattr helper stubs for xattr.c */ #define xattr_handler_can_list(h, d) ({ (void)(h); (void)(d); 0; }) #define xattr_prefix(h) ({ (void)(h); (const char *)NULL; }) -/* Block device operations - declarations for stub.c */ -void bdev_fput(void *file); -void *bdev_file_open_by_dev(dev_t dev, int flags, void *holder, - const struct blk_holder_ops *ops); - /* Filesystem sync - declaration for stub.c */ int sync_filesystem(void *sb); -/* Block device file operations - stubs */ -#define set_blocksize(f, size) ({ (void)(f); (void)(size); 0; }) -struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned size); - /* * Stubs for mballoc.c */ @@ -488,18 +457,9 @@ struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned #define DEFINE_RAW_FLEX(type, name, member, count) \ type *name = NULL -/* Block layer constants */ -#define BLK_MAX_SEGMENT_SIZE 65536 - -/* Block device properties */ -#define bdev_nonrot(bdev) ({ (void)(bdev); 0; }) - /* raw_cpu_ptr - get pointer to per-CPU data for current CPU */ #define raw_cpu_ptr(ptr) (ptr) -#define bdev_discard_granularity(bdev) \ - ({ (void)(bdev); 0U; }) - /* * Stubs for page-io.c - bio types are in linux/bio.h */ @@ -556,10 +516,6 @@ int bmap(struct inode *inode, sector_t *block); /* Block device operations for journal.c */ #define truncate_inode_pages_range(m, s, e) \ do { (void)(m); (void)(s); (void)(e); } while (0) -#define blkdev_issue_discard(bdev, s, n, gfp) \ - ({ (void)(bdev); (void)(s); (void)(n); (void)(gfp); 0; }) -#define blkdev_issue_zeroout(bdev, s, n, gfp, f) \ - ({ (void)(bdev); (void)(s); (void)(n); (void)(gfp); (void)(f); 0; }) /* Memory allocation for journal.c */ #define __get_free_pages(gfp, order) ((unsigned long)memalign(PAGE_SIZE, PAGE_SIZE << (order))) diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 1b9c72a6cc2..3da511fa1cf 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -433,6 +433,11 @@ void invalidate_bdev(struct block_device *bdev) { } +int bdev_read_only(struct block_device *bdev) +{ + return bdev ? bdev->read_only : 0; +} + struct block_device *file_bdev(struct file *file) { return NULL; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index eaf2984c08f..89d284dab26 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -55,4 +55,43 @@ struct blk_plug { #define bdev_atomic_write_unit_max_bytes(bdev) ({ (void)(bdev); (unsigned int)0; }) #define bdev_atomic_write_unit_min_bytes(bdev) ({ (void)(bdev); 0UL; }) +/* Block device read-only check - implemented in ext4l/stub.c */ +int bdev_read_only(struct block_device *bdev); + +/* Block device property stubs */ +#define bdev_write_zeroes_unmap_sectors(b) ({ (void)(b); 0; }) +#define bdev_dma_alignment(bd) (0) +#define bdev_nonrot(bdev) ({ (void)(bdev); 0; }) +#define bdev_discard_granularity(bdev) ({ (void)(bdev); 0U; }) +#define set_blocksize(f, size) ({ (void)(f); (void)(size); 0; }) + +/* Block layer constants */ +#define BLK_MAX_SEGMENT_SIZE 65536 + +/* Block device I/O operations - stubs */ +#define blkdev_issue_flush(bdev) ({ (void)(bdev); 0; }) +#define blkdev_issue_discard(bdev, s, n, gfp) \ + ({ (void)(bdev); (void)(s); (void)(n); (void)(gfp); 0; }) +#define blkdev_issue_zeroout(bdev, s, n, gfp, f) \ + ({ (void)(bdev); (void)(s); (void)(n); (void)(gfp); (void)(f); 0; }) + +/* Block device sync - implemented in ext4l/stub.c */ +int sync_blockdev(struct block_device *bdev); +void invalidate_bdev(struct block_device *bdev); + +/* Block device size - implemented in ext4l/stub.c */ +unsigned int bdev_max_discard_sectors(struct block_device *bdev); + +/* Block device file operations - implemented in ext4l/stub.c */ +struct blk_holder_ops; +void bdev_fput(void *file); +void *bdev_file_open_by_dev(dev_t dev, int flags, void *holder, + const struct blk_holder_ops *ops); + +/* Buffer operations on block devices - implemented in ext4l/stub.c */ +struct buffer_head *bdev_getblk(struct block_device *bdev, sector_t block, + unsigned int size, gfp_t gfp); +struct buffer_head *__bread(struct block_device *bdev, sector_t block, + unsigned int size); + #endif /* _LINUX_BLKDEV_H */ From patchwork Wed Jan 21 22:08:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737 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=1769033398; bh=bPFBlPAyCUSjWlDmZlfjNxAgqAzSYPXF49t9m3ljjmU=; 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=rsg93P2IVpcB2YgcFBACQG7BhZ+BdZtGZ4hB2TvFMxDlP5hMmrF88GepYZwZWOJpP /JFvwH7Lmq5eS5INN2jR44h3lnV7lTLxeMLsVpHCfdD7xFeAezDAB5YfIiWQ5QI7BP QLPuv4ljT3a+Q44/0oYHovgvqlHD6FmQ79avZc1o3vTaK2ArYKViJmO2OgxKoHYwK1 3nu2GkNLpmNmNIjcRvKRZbrAjIqdbWanG8r+hMuClMGx/dfMhG9zZ/BWzQfWNz7bPZ tzqOUF6YL2nBdMbbBAE7OjlcpMW1ihA+KnCfSuQTTVD+DmAADP0TMDpG1DADhkC/yU mIg/iojVdCypg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D5BDC69605 for ; Wed, 21 Jan 2026 15:09:58 -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 TNCNnlrng0qg for ; Wed, 21 Jan 2026 15:09:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033398; bh=bPFBlPAyCUSjWlDmZlfjNxAgqAzSYPXF49t9m3ljjmU=; 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=rsg93P2IVpcB2YgcFBACQG7BhZ+BdZtGZ4hB2TvFMxDlP5hMmrF88GepYZwZWOJpP /JFvwH7Lmq5eS5INN2jR44h3lnV7lTLxeMLsVpHCfdD7xFeAezDAB5YfIiWQ5QI7BP QLPuv4ljT3a+Q44/0oYHovgvqlHD6FmQ79avZc1o3vTaK2ArYKViJmO2OgxKoHYwK1 3nu2GkNLpmNmNIjcRvKRZbrAjIqdbWanG8r+hMuClMGx/dfMhG9zZ/BWzQfWNz7bPZ tzqOUF6YL2nBdMbbBAE7OjlcpMW1ihA+KnCfSuQTTVD+DmAADP0TMDpG1DADhkC/yU mIg/iojVdCypg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C4B1E695F7 for ; Wed, 21 Jan 2026 15:09:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033396; bh=VY71oxc8JGiawaSvaP4CLPhPJsJB8mOrq+ZW3q5eTPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9Ts7gYFk0llA0AFNCIfVgbW8jKos/WyDH3NkTpHha8/xrH9maqZd1X1J9pKsutgf eSctnA2qKIx2DXqVwz8NzwaUyMaIrZ1EgD/cM0IHKTGPCxHHeo98D0IfRn7UugUW1T jtleuoDdzsdAbDZ5mzGPj2YYeiNmZQo420hAtZYxjt7vt4tGROJ2llSqCr5QNZyC66 YJogYkMC4locuDIRXsATBtuG693VB5O2l9gDbc/9Gf4SqQqCZJJtuEMKQN1K8rV/UY tF8P6qL5KFyxcrLIDK48b2hYy7nE1LRhknpSgKb606i/o2IKjrHHZjQAkYxlS2KH9J ytSA0V4ir4ZUw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 84FAB695FB; Wed, 21 Jan 2026 15:09:56 -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 SUeDkJGzDK_m; Wed, 21 Jan 2026 15:09:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033391; bh=+WAxnzkFU9gBHMzHgW0VLNOi7DFSSr9HDrxJqsqSbXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CaeT3BBFEH6aV3Tjudzls+olw9YFYgxHRUd9b7WPdNtKE4HhhLvcSwGPncMJCb8ne B77ZYdNhTMkpvBjEHxuLKC9VLHGS+vUX0C/0Ngl0jofYJ2tJ4LwcpQcwJ2Q7MLZJMv h29GIe+sWZgiLQCI5+St6jkdtBM81gUq0z074nGiYXM21Xh372Rwivx3yDH3jjktc+ ijK/uAwgflVKGV3/5F14G8RNyvK589ZaH8GJ/zMa74zsoWLNkBLts5Srron5Jjk35j DhnfcwWSAzBbhdT6YE+mK81USbc4Ub8Ec/JZjqiy53ixrIGj42YkPKhDewjgcNXU3X Gk7L9fRHgB3Tw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F22C9695F2; Wed, 21 Jan 2026 15:09:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:24 -0700 Message-ID: <20260121220857.2137568-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JJTGIRKOFSUQG5DQN4CBMPYOTUN6N7T3 X-Message-ID-Hash: JJTGIRKOFSUQG5DQN4CBMPYOTUN6N7T3 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 11/33] ext4l: Move file_ functions to linux/fs.h 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 Move file-related operations from ext4_uboot.h to the standard linux/fs.h header. This includes file_modified(), file_accessed(), file_update_time(), file_write_and_wait_range(), file_check_and_advance_wb_err(), file_path(), and file_bdev(). Also remove redundant forward declarations (file_kattr, dir_context, readahead_control, fiemap_extent_info, folio) that are already in fs.h. This reduces ext4_uboot.h from 568 to 553 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 15 --------------- include/linux/fs.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index f12dbe2b76d..746d4e9a748 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -166,11 +166,6 @@ BUFFER_FNS(Cached, cached) struct pipe_inode_info; struct kstat; struct path; -struct file_kattr; -struct dir_context; -struct readahead_control; -struct fiemap_extent_info; -struct folio; #define WHITEOUT_DEV 0 #define WHITEOUT_MODE 0 @@ -213,9 +208,6 @@ struct dx_hash_info { do { } while (0) #endif -#define file_modified(file) ({ (void)(file); 0; }) -#define file_accessed(file) do { (void)(file); } while (0) - #define vfs_setpos(file, offset, maxsize) ({ (void)(file); (void)(maxsize); (offset); }) #define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) @@ -265,8 +257,6 @@ struct dx_hash_info { /* Sync operations - stubs */ #define sync_mapping_buffers(m) ({ (void)(m); 0; }) #define sync_inode_metadata(i, w) ({ (void)(i); (void)(w); 0; }) -#define file_write_and_wait_range(f, s, e) ({ (void)(f); (void)(s); (void)(e); 0; }) -#define file_check_and_advance_wb_err(f) ({ (void)(f); 0; }) /* DAX stubs - DAX not supported in U-Boot */ #define IS_DAX(inode) (0) @@ -293,7 +283,6 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); #define posix_acl_chmod(m, i, mo) ({ (void)(m); (void)(i); (void)(mo); 0; }) /* File operations */ -#define file_update_time(f) do { } while (0) #define vmf_fs_error(e) ((vm_fault_t)VM_FAULT_SIGBUS) /* iomap stubs */ @@ -408,10 +397,6 @@ void trace_ext4_error(struct super_block *sb, const char *func, unsigned int lin /* Filesystem notification - declaration for stub.c */ void fsnotify_sb_error(struct super_block *sb, struct inode *inode, int error); -/* File path operations - declaration for stub.c */ -char *file_path(struct file *file, char *buf, int buflen); -struct block_device *file_bdev(struct file *file); - /* kobject_put is now in linux/kobject.h */ /* wait_for_completion is now a macro in linux/completion.h */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 3fa54146f44..ea4d1fdf97e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -321,6 +321,17 @@ static inline struct inode *file_inode(struct file *f) return f->f_inode; } +/* File modification tracking - stubs for U-Boot */ +#define file_modified(file) ({ (void)(file); 0; }) +#define file_accessed(file) do { (void)(file); } while (0) +#define file_update_time(f) do { } while (0) +#define file_write_and_wait_range(f, s, e) ({ (void)(f); (void)(s); (void)(e); 0; }) +#define file_check_and_advance_wb_err(f) ({ (void)(f); 0; }) + +/* File path operations - implemented in ext4l/stub.c */ +char *file_path(struct file *file, char *buf, int buflen); +struct block_device *file_bdev(struct file *file); + /* iattr - inode attributes for setattr */ struct iattr { unsigned int ia_valid; From patchwork Wed Jan 21 22:08:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1738 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=1769033402; bh=diqqB/k/JxuAxD4cgx4LC82hBcX6VxilheqxxLovooA=; 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=Kfl3i7hZXfuZpoj57/7FO44Y9wdwOr10/Q7w5BhXNY/6Im8YPDHlN669F/VGGZ2oi K8Q2zjifYAP4eVwfPFxoRgFwG70lh0VVcrvLMp78/tuLJjXg4dtFtTYYLgqebK2AXu ozNtG1mwJ5sj1H0mKZ1gjRc8JDDwgg7zu1gd/Rx28fNVjKaUV7V4vKRvuaYjDbEKxM AGfSnRDD+BvCoopv2UAi43IcrZ8w0KBCCAYF0YUNQ6uHHoMms8BuVm9g+O5FlY5Qk7 2K8xUwS3Zk5F4IcxiUbBi+SB3Tnqncq0gLRdMLqwJXdFnRZGPG6dqr1WhaGNmioZhh u3MuRg21PB+6w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D2221695FD for ; Wed, 21 Jan 2026 15:10:02 -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 mrHTDKkt12Pd for ; Wed, 21 Jan 2026 15:10:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033402; bh=diqqB/k/JxuAxD4cgx4LC82hBcX6VxilheqxxLovooA=; 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=Kfl3i7hZXfuZpoj57/7FO44Y9wdwOr10/Q7w5BhXNY/6Im8YPDHlN669F/VGGZ2oi K8Q2zjifYAP4eVwfPFxoRgFwG70lh0VVcrvLMp78/tuLJjXg4dtFtTYYLgqebK2AXu ozNtG1mwJ5sj1H0mKZ1gjRc8JDDwgg7zu1gd/Rx28fNVjKaUV7V4vKRvuaYjDbEKxM AGfSnRDD+BvCoopv2UAi43IcrZ8w0KBCCAYF0YUNQ6uHHoMms8BuVm9g+O5FlY5Qk7 2K8xUwS3Zk5F4IcxiUbBi+SB3Tnqncq0gLRdMLqwJXdFnRZGPG6dqr1WhaGNmioZhh u3MuRg21PB+6w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BAE85695FB for ; Wed, 21 Jan 2026 15:10:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033401; bh=RdCSq+eauiTmuBvub7uF4PVNxp+ftStj8z8k/vqi44Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QvuR0twXh4V7GeWtCsmCvQniAg3aHBlCID5Hd+UfNm7cKRMC5C2DB1zj4UErZujSx BHb4b6GiQvhKyQ9CuadF8KyLvsoiKhsvUtEspbulcDvERgZu8/M2Z8PIah9tlaTqD8 ueV+IEN9kAooUicmC96dpsqMwQ3MAMt+ihJPqDe99xgXw/NleIi+Lm4tvNv6KpYvY4 4WG6fqcNv0eCfg27jiuFLDb2BefPiDDzOAMZT/xh6sYvqV3KX4AkDlrJHJBHpFcdQl /GPysh3ZLlQjFWM1oA111F6yMyJLh+/2AU8STWuHMguPdbTpMa+i/VxY0DU7qxFbOy TSUpwQAczPGFw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 55A98695FB; Wed, 21 Jan 2026 15:10:01 -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 IxmCsK6ZwlpB; Wed, 21 Jan 2026 15:10:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033395; bh=WjZ+OGYQH1dUVaZzMY8cYnFBoCqEskN+Q+XJ3EJSssM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BNAPwsNpAIOG4R9Yg2jAmYw9CuMMpsSAnIIWSZeuwVXv1ehSWdsw5v5zilTsmoEin t3VNXSFnXka4cY58GDC6cN+U00ry0HdmTLFE6osFUYpkUU3rwJ6iisoxY2E9NXsWni Ub+DQBOfLP8SkzmOqmcYFLLTA8OhRuxd00O5FHWQI5j7NCBA1DrDQQ+1GhSbxmIzhm xY/H1ywg0dZcTuTScDpMkmqH2YdiJcJR8sRSpfBa9+w/TNfBCCrUk8wNVLPPTkWlEh ZKfEc53VUfwRMIaMWh+xRDjuzRqDmMGh6CP8tth2pGKEmvz/Lq3NNR3fTcvlCueGXQ U1oq6XA8wmZIQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9388F695FD; Wed, 21 Jan 2026 15:09:55 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:25 -0700 Message-ID: <20260121220857.2137568-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Z2LR52OTXXE272DENC52VUXVC3OGYLP7 X-Message-ID-Hash: Z2LR52OTXXE272DENC52VUXVC3OGYLP7 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 12/33] ext4l: Move fsnotify_sb_error() to linux/fs.h 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 Move fsnotify_sb_error() declaration to linux/fs.h alongside the existing fsnotify_change() stub. The implementation remains in ext4l/stub.c. This reduces ext4_uboot.h from 553 to 550 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 --- include/linux/fs.h | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 746d4e9a748..51fdcfab281 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -394,9 +394,6 @@ void trace_ext4_error(struct super_block *sb, const char *func, unsigned int lin /* ___ratelimit is now in linux/ratelimit.h */ -/* Filesystem notification - declaration for stub.c */ -void fsnotify_sb_error(struct super_block *sb, struct inode *inode, int error); - /* kobject_put is now in linux/kobject.h */ /* wait_for_completion is now a macro in linux/completion.h */ diff --git a/include/linux/fs.h b/include/linux/fs.h index ea4d1fdf97e..9ced2c78017 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -358,9 +358,12 @@ struct iattr { /* writeback_control - defined in linux/compat.h */ -/* fsnotify - stub */ +/* fsnotify - stubs */ #define fsnotify_change(d, m) do { } while (0) +/* fsnotify_sb_error - implemented in ext4l/stub.c */ +void fsnotify_sb_error(struct super_block *sb, struct inode *inode, int error); + /* inode_init_once - stub */ static inline void inode_init_once(struct inode *inode) { From patchwork Wed Jan 21 22:08:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1739 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=1769033405; bh=INOmP11fW70UYixmmwJJeaoc3/YOjbmVkvN3+WlL8FI=; 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=WMoLsUBdqlCdgRkyL2+QHJ3MjGiqq5Ny/oggCK4NzLxCBhtkHu3FtiWieVS25zd09 +DOVxbbOgEeZI6NDt0FWHsaSJC5s9aR0y90ZAoSC3X1w+121LvytbGthhXK4Pfel/g 8dNQQziAkc9OEncOz41sRe1m+peh7MObE5HPp/yeW7blHYMWeqo2KyFcbFGCyS42WA L/BmAtD5drShEAzifaq8ZM+lFNgxVcDpYnMDE3MqLihDmqUeb1+KaYpTOE2KzRZgrY DqHuEISXvfXfbEt+SZxczTa9Sm8XulLGO+SLcD6ThKkQQ9fzBI+1UrMyWE+9z+/nTn KACwmaGrR1Suw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D0C096960B for ; Wed, 21 Jan 2026 15:10:05 -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 KR_VUnlQevWs for ; Wed, 21 Jan 2026 15:10:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033403; bh=INOmP11fW70UYixmmwJJeaoc3/YOjbmVkvN3+WlL8FI=; 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=JGmPwK6K5emOHb6WSMT8hdnosOYwd49V107hJrtC9q+/SNQ4M9O4smKln8Jk1i/fc uF0oCKMhtbnUfj9AQZIrn5TREPxLdIzqa6ZsN+OSKli8+/o4D0RWDqOiJhnXJPBXCJ O3JaSGke33kBd+rPBJt78ZLKyL/BuQQOXoO5GsG2J1OW/pqFNhMhteuTXNf9J26ivE iFJr90C2oOBEHOXBzyLr5beMpFWOiKO7+xjGMHOM1x6yHA55y1C+Rx3GjHu7Dn5Gsw /qs/itbQuFCCyD3s4vDbH8kSVm+sAPAowAQGy+f3qzAYoj1hoihN1t4nW6w7RiSDqY ZzlwNLo/zWV1g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D39B369601 for ; Wed, 21 Jan 2026 15:10:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033401; bh=0WAoGIR4LFd9jEOq1W9xAgGV4SNNAtl/3xuoItdcxUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jeHba2a25xnVziDsRRpDXtGTNIrCHefzMbfL/B4ojiinGCUF9Mf/W03M367Fex875 nv7xi+6OOa5fOLr4VRWeXQqekUoWYy3AvauEyfnAljxDadJhjP043FX7WotmnCxh/Z X7yQZaIOePyMf4E5WGmVJqn7egh7sqDHjJ1n9t8t46GgiXjvMohgG+FgnRKy1TIA+n FuBFRUEoIuJSgsccXeR/9XfDLulHiKFgJbWqso0wj3QIFf5VPbYO8v/BMQp7Z1PK8n SjhuXTKGb4XZFUwciID4w0ky0nIRDk0t3Br7Td1wJQX8yybh+pvnDzlFKgq93k9x/H aUpoP6rl0bOUA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 55AA869605; Wed, 21 Jan 2026 15:10:01 -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 iMDWO12i8ODp; Wed, 21 Jan 2026 15:10:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033400; bh=x6Xz7W+hxZuwgERBUo6XokeooMyUp/l3+VMWJ14U0Lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RfdrshYRFkynqhBvHmrN6cG0EkDquR9wmzqdZLnuUNubxlU6CRbSYT1sfAKhFJhDg 3k2iLGvXZ4j/o0BH74z/Y7vzFq4OHcC9cXvP1/PbHhn5Gg4L6ZSG9zqeV3s1YDwa67 cOmwXt3WZMAkO128zYre25Q0YucS091tkHHRVVLcP3/tCbs8E5upsEzgeuicpJI6Dj VX0IcXlTlWyYkMLeLkzeTPBKI1wPLLZdJP625qeAwE50oyValFhvkl/31lxTivIwQF ABA5p3C0G05LGY2OQseGOyQutmPU0Chl1GnhzR/IFZWY+wH4Q66F+hPYMXWYgrFw87 ehAolxJa7INNg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 32193695F7; Wed, 21 Jan 2026 15:10:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:26 -0700 Message-ID: <20260121220857.2137568-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UNHPVVVA3CIKBMXBEKJ7SRJK7JWGYKYZ X-Message-ID-Hash: UNHPVVVA3CIKBMXBEKJ7SRJK7JWGYKYZ 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 13/33] ext4l: Move DEFINE_WAIT to linux/wait.h 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 Move the DEFINE_WAIT macro to linux/wait.h alongside the other wait queue stubs. This is a more appropriate location since it is a standard Linux kernel wait queue primitive. This reduces ext4_uboot.h from 550 to 547 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 --- include/linux/wait.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 51fdcfab281..0c214501cef 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -487,9 +487,6 @@ void ext4l_print_msgs(void); struct blk_desc *ext4l_get_blk_dev(void); struct disk_partition *ext4l_get_partition(void); -/* DEFINE_WAIT stub - creates a wait queue entry */ -#define DEFINE_WAIT(name) int name = 0 - /* JBD2 journal.c stubs */ int bmap(struct inode *inode, sector_t *block); diff --git a/include/linux/wait.h b/include/linux/wait.h index 70ebdc4919d..3dbcb100337 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -28,4 +28,7 @@ struct wait_queue_entry { #define wait_event(wq, condition) do { } while (0) #define wait_event_interruptible(wq, condition) 0 +/* DEFINE_WAIT - creates a wait queue entry (stub for U-Boot) */ +#define DEFINE_WAIT(name) int name = 0 + #endif /* _LINUX_WAIT_H */ From patchwork Wed Jan 21 22:08:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1740 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=1769033409; bh=BsCc5TsSZbx5flKhDBd9X0+zrw3IqdefrEeQbxk5dNc=; 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=Vh6FP+GtwQqI0CTyxTpPJYSTo4K2+W+0zRlEcVKUraulz8SKpHN3ewV1TCsRksnec If7oBDxEqeuqSuKwCi6UW3RMiDcFgNfzc8Cl2z/IFFn0HzWJU2SeqNasndeYERgpCa q+qWyZ+qj1FaoUCT8w5qBtcT37hx5krc5NzeB1U9Vtf7HmkgazaYYdTWEWZWC74A1L vorZF3mWfb9aTfM2z05xBsniMU9edByLNMVxBgOT8kgnDVdJoWP72nfrAwiAIUF37S CqfUZjcSemhShYYdo9RwPHxjIPKrIoC3OXpe19edmefT7GsQ4WOuZhHKd7s82AyXIb 4MARw9lOVm6Ww== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5EC0E69601 for ; Wed, 21 Jan 2026 15:10:09 -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 R0y1PnhmtIZf for ; Wed, 21 Jan 2026 15:10:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033409; bh=BsCc5TsSZbx5flKhDBd9X0+zrw3IqdefrEeQbxk5dNc=; 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=Vh6FP+GtwQqI0CTyxTpPJYSTo4K2+W+0zRlEcVKUraulz8SKpHN3ewV1TCsRksnec If7oBDxEqeuqSuKwCi6UW3RMiDcFgNfzc8Cl2z/IFFn0HzWJU2SeqNasndeYERgpCa q+qWyZ+qj1FaoUCT8w5qBtcT37hx5krc5NzeB1U9Vtf7HmkgazaYYdTWEWZWC74A1L vorZF3mWfb9aTfM2z05xBsniMU9edByLNMVxBgOT8kgnDVdJoWP72nfrAwiAIUF37S CqfUZjcSemhShYYdo9RwPHxjIPKrIoC3OXpe19edmefT7GsQ4WOuZhHKd7s82AyXIb 4MARw9lOVm6Ww== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D221695F7 for ; Wed, 21 Jan 2026 15:10:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033408; bh=M4McJ1H5uzOPgw2/8Q7B473/xCv8RlJ7qz5nCpo9Lls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OFgdjeNaZ8woXNCL9LWOcxtGuAYtBlt21YCGPXP/z8EZ7cB5U1uwK4StttfGRPQBA ngxKQWhJBHHIzx3L0yHlIf30A1ZzdzA18KvHAgz2CJc2uQwA23YDDguD8ShCBN+xvQ glWEFkbjNHW9/pgZUYmsedkNUW4xDkOzTu9AHyd8k/ob9IzGERH6sjnPu240RLKXTO EzQlq/FRlrziK6gP1L327DwNgmhyRlNGekoUZ6p+4mFn0nWW1s2h2u3sbqR9fBX7Jt KoOJDXEd4f4eMyqGaEPXFO6ye1NOn/J0wvbRx4Dck/pPlBgsrB/uEnYmTHWB7cNfbs vO1fh9p0mlrOA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 27204695F7; Wed, 21 Jan 2026 15:10:08 -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 tA2y--XIrK_w; Wed, 21 Jan 2026 15:10:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033401; bh=o1j0n9rcB48Pn074Vv9+j7Sw+nVK/XVJkdVCl06VZ8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n91mooLHmaQjzLZ/Ctujz4KZAKjbyD5EER80qyJNPiYCFoyOLOANxGSzfVVZq4vxU +SE8ucCa+stvePhyk2Mbgz24V8pDLykxVLO6Hsmn6MqTzRblxItNRBq6tgAc4hhfYX cye8bK2ZAVsdy0B/eUVRfAifCxcGSMfstroyM6A6sAR6LgrkCWKdT9qZ1mBfTl2AT2 IaPcCUpATNtkF5lTjdmHDYyKb8HaYMh5Q/NF6f2azrh/Vd9GDMpTD5hNX5kI2RcvWG IMiYqdmSu/jUTypu1wz8OTzqm14C8EDFcLsdUdeQKA2zM5CtUGcQRy7xuXUktDcJkL bdpxpG0Z2hAaw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F130C695F2; Wed, 21 Jan 2026 15:10:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:27 -0700 Message-ID: <20260121220857.2137568-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: C4Y7HVIO3DSTHD77WHCHDBYOWZADDVGJ X-Message-ID-Hash: C4Y7HVIO3DSTHD77WHCHDBYOWZADDVGJ 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 14/33] ext4l: Move filemap_fdatawait_range_keep_errors() to pagemap.h 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 Move this filemap function to linux/pagemap.h alongside the other filemap_ stubs already defined there. This reduces ext4_uboot.h from 547 to 545 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 2 -- include/linux/pagemap.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 0c214501cef..f1c4a5a0fca 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -467,8 +467,6 @@ int sync_filesystem(void *sb); #include /* smp_mb__after_atomic is now in linux/smp.h */ #define ktime_get_coarse_real_ts64(ts) do { (ts)->tv_sec = 0; (ts)->tv_nsec = 0; } while (0) -#define filemap_fdatawait_range_keep_errors(m, s, e) \ - ({ (void)(m); (void)(s); (void)(e); 0; }) #define crc32_be(crc, p, len) crc32(crc, p, len) /* ext4l support functions (support.c) */ diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index eb689fa885f..22c7f05c57e 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -155,6 +155,8 @@ void mapping_clear_folio_cache(struct address_space *mapping); #define filemap_fdatawrite_range(m, s, e) ({ (void)(m); (void)(s); (void)(e); 0; }) #define filemap_flush(m) ({ (void)(m); 0; }) #define filemap_write_and_wait(m) ({ (void)(m); 0; }) +#define filemap_fdatawait_range_keep_errors(m, s, e) \ + ({ (void)(m); (void)(s); (void)(e); 0; }) #define filemap_release_folio(folio, gfp) ({ (void)(folio); (void)(gfp); 1; }) #define mapping_tagged(m, t) (0) #define tag_pages_for_writeback(m, s, e) do { } while (0) From patchwork Wed Jan 21 22:08:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1742 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=1769033416; bh=C9KQEy1tQqo7BN5X6lFVjrJyHbGBToNT89wptFw9BoA=; 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=EUwpIxbro16005SSlFdlHCPO6b6RDQvB6w5Ymir9dBz/25IpwDQGHqyaapfnvTgPl mD4Nzy7tcKMommI22xXo47C/LcmpXI80ql6keB7EVPA2Mis1dqAt85Ok8LCugbWeuu SrVXvvLcPFjSa9yPPkBEkxWdWta2IbVai3sZfrqfq7KiRkH3clwg9o3755i9+zHLgJ dMjI/RizU1rIXsN84oFQna1FjCJhtYPCUXdzadd4BO2OIlXWzUg7MpOp8WBR8WR/db U6a5Druyk7QnoubLPHq9Rs92f7arkq5Rv1vBM0D0J72jLOcEEz7kUn0BEfwti5yu6z mES5AkmBeGX1A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 31BDD69601 for ; Wed, 21 Jan 2026 15:10:16 -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 hyNL2LqYWR3f for ; Wed, 21 Jan 2026 15:10:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033414; bh=C9KQEy1tQqo7BN5X6lFVjrJyHbGBToNT89wptFw9BoA=; 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=Cb5sonWDRzywG0EKv/65CDN7ca5f2UjASoLOkL7xuSn6S/CUZp5WbwCAAtmWUWvCI sr+hjya20E22Iybq4QrGr7W5BvDo3ZGg96qT1+78DT6jFceemMhfHdx3MZuNdaYiTi vFxeHYmzRhlHvm+gn9OolYRcgOWhEDDqQUaniCYWJRE8gLyG+N43Io9Nk5n2HqMS0o I4poHVmbM88S+17nCHc7Pq7yVN6u+2T7CbWs1Ij+EEqhqv6vuAKIxvid3zocECF6MN eLpQ8WzZXhE1vV0FgrZ+eHPE1ylbtSlbdjwuw/PuwReEbQR3sXk5dT7c+kWp+q1vXy gaxlH1qZQPTqA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ED50B6960A for ; Wed, 21 Jan 2026 15:10:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033411; bh=DTx67ZhupuFLyo+5HNQ6DIVz2kKsJawx+FK7AATmebQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+3sb4ao6RA7WgbIQ1WNGhOsgfKl9QvyBD4/BPEN9AeaYOUMDECRzrMSSSJCztmcC zFBha+wlc6WLDVxNetIYV5AWvF0IiJnRiF5LOI7bzKDjaPh84665ZmgvW4BiY0LZFO IpnwFtO3za80Sub5MbcRf1OZ0W7LoOPR5niRIYYnznk83gvNeNonJA8w1ZAFYn4qoG qdmfwr8Qq5/ecymeHGaF6rRWDGrB1I/joJwOP3azK0O/m9o5ryHed5mOWPOhiBmzki MYn6PkhjRqOOc3qfhW5oHJZptztWlOUpkyJg8cPv6i6o/EyxENwe30LAKLyH4L8UFm MBIFfd67zGZdg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C78E0695FD; Wed, 21 Jan 2026 15:10:11 -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 HsAiLW3y1FZl; Wed, 21 Jan 2026 15:10:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033405; bh=kovDswhn7pHFZH9cLXDMnMHTl3jteDeXwTLfrMTeYCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUKoOdbmqa5hz7QD7jFsPKl/GePT9Xg0P/xfC9MT5CJ9oMucpKdXTwBwcSUJKzkhz iLe7c9UwoVsiYMuHUlr4DMiqJ30KUIXrAmHus9LhfW1vKFJT3cHvT9txkgGClQw1c6 PFLNFFI+wgLGLyRJVKH5h7ukEiHG4hPHJTUoNmy4lmnKO2bGwWTH96HquKtntdfl7y W77peDknFNQjfpX9uLo/21y7t8rNpIwnBwW0jtXfYKbktTqNOoSPDXInhAIS1ef8K5 GjiEurcTeRx3sY94W1oI4mQW0SzDKwwREqFcYoZIixSn6uxGcGMxyprt8EA8gMP+BJ 7l8uBVfgrod5w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 94AA5695FB; Wed, 21 Jan 2026 15:10:05 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:28 -0700 Message-ID: <20260121220857.2137568-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JIEC2ZSUBNSUKBMGSUNH3ZLE6CJMRQM5 X-Message-ID-Hash: JIEC2ZSUBNSUKBMGSUNH3ZLE6CJMRQM5 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 15/33] ext4l: Move various stubs to proper 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 Move definitions to their appropriate standard headers: - sync_mapping_buffers(), sync_inode_metadata() to linux/fs.h - DAX stubs (IS_DAX, dax_break_layout_final, dax_writeback_mapping_range, dax_zero_range, dax_break_layout_inode, daxdev_mapping_supported) to linux/dax.h - ktime_get_coarse_real_ts64() to linux/ktime.h - Remove duplicate truncate_inode_pages_range (already in pagemap.h) Also fix linux/dax.h to use mm_types.h for vm_fault_t and VM_FAULT_* definitions, and update daxdev_mapping_supported to use the 3-arg signature expected by ext4. This reduces ext4_uboot.h from 545 to 528 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 19 +------------------ include/linux/dax.h | 23 +++++++++++++---------- include/linux/fs.h | 4 ++++ include/linux/ktime.h | 9 +++++++++ 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index f1c4a5a0fca..e21732da843 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -210,8 +210,6 @@ struct dx_hash_info { #define vfs_setpos(file, offset, maxsize) ({ (void)(file); (void)(maxsize); (offset); }) -#define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) - #include /* Memory retry wait */ @@ -254,18 +252,8 @@ struct dx_hash_info { #define finish_open_simple(f, e) (e) #define ihold(i) do { (void)(i); } while (0) -/* Sync operations - stubs */ -#define sync_mapping_buffers(m) ({ (void)(m); 0; }) -#define sync_inode_metadata(i, w) ({ (void)(i); (void)(w); 0; }) - -/* DAX stubs - DAX not supported in U-Boot */ -#define IS_DAX(inode) (0) -#define dax_break_layout_final(inode) do { } while (0) -#define dax_writeback_mapping_range(m, bd, wb) ({ (void)(m); (void)(bd); (void)(wb); 0; }) -#define dax_zero_range(i, p, l, d, op) ({ (void)(i); (void)(p); (void)(l); (void)(d); (void)(op); -EOPNOTSUPP; }) -#define dax_break_layout_inode(i, m) ({ (void)(i); (void)(m); 0; }) - #include +#include #include #include @@ -466,7 +454,6 @@ int sync_filesystem(void *sb); /* JBD2 checkpoint.c and commit.c stubs */ #include /* smp_mb__after_atomic is now in linux/smp.h */ -#define ktime_get_coarse_real_ts64(ts) do { (ts)->tv_sec = 0; (ts)->tv_nsec = 0; } while (0) #define crc32_be(crc, p, len) crc32(crc, p, len) /* ext4l support functions (support.c) */ @@ -490,10 +477,6 @@ int bmap(struct inode *inode, sector_t *block); #include -/* Block device operations for journal.c */ -#define truncate_inode_pages_range(m, s, e) \ - do { (void)(m); (void)(s); (void)(e); } while (0) - /* Memory allocation for journal.c */ #define __get_free_pages(gfp, order) ((unsigned long)memalign(PAGE_SIZE, PAGE_SIZE << (order))) #define free_pages(addr, order) free((void *)(addr)) diff --git a/include/linux/dax.h b/include/linux/dax.h index adc0f9411a2..7e80fc97cd3 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -4,6 +4,7 @@ #include #include +#include struct address_space; struct dax_device; @@ -12,11 +13,8 @@ struct iomap_ops; struct kiocb; struct iov_iter; struct vm_fault; - -typedef unsigned int vm_fault_t; - -#define VM_FAULT_SIGBUS 0x0002 -#define VM_FAULT_NOPAGE 0x0100 +struct file; +struct inode; /* DAX is not supported in U-Boot - provide stubs */ static inline ssize_t @@ -44,10 +42,15 @@ static inline bool dax_mapping(struct address_space *mapping) return false; } -static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, - struct dax_device *dax_dev) -{ - return false; -} +/* 3-arg version used by ext4 */ +#define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) + +/* DAX stubs */ +#define IS_DAX(inode) (0) +#define dax_break_layout_final(inode) do { } while (0) +#define dax_writeback_mapping_range(m, bd, wb) ({ (void)(m); (void)(bd); (void)(wb); 0; }) +#define dax_zero_range(i, p, l, d, op) \ + ({ (void)(i); (void)(p); (void)(l); (void)(d); (void)(op); -EOPNOTSUPP; }) +#define dax_break_layout_inode(i, m) ({ (void)(i); (void)(m); 0; }) #endif /* _LINUX_DAX_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 9ced2c78017..c8006d668b5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -667,6 +667,10 @@ struct inode_operations { #define generic_buffers_fsync_noflush(f, s, e, d) \ ({ (void)(f); (void)(s); (void)(e); (void)(d); 0; }) +/* Sync operations - stubs */ +#define sync_mapping_buffers(m) ({ (void)(m); 0; }) +#define sync_inode_metadata(i, w) ({ (void)(i); (void)(w); 0; }) + /* Generic attribute operations */ #define generic_fillattr(m, req, i, s) do { } while (0) #define generic_fill_statx_atomic_writes(s, u_m, u_M, g) do { } while (0) diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c853e694823..04767da5305 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -67,4 +67,13 @@ static inline ktime_t ktime_add_ns(ktime_t kt, s64 ns) */ #define ktime_get_ns() (0ULL) +/** + * ktime_get_coarse_real_ts64() - get coarse real time + * @ts: timespec64 to fill + * + * U-Boot stub - sets time to 0. + */ +#define ktime_get_coarse_real_ts64(ts) \ + do { (ts)->tv_sec = 0; (ts)->tv_nsec = 0; } while (0) + #endif /* _LINUX_KTIME_H */ From patchwork Wed Jan 21 22:08:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1741 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=1769033413; bh=fEchPZlLSgKAxntIPmbxoTlYXspruEq65dwdQgXXsbE=; 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=l/fuhPecFiLc38Zxyq3IbChrJTy5YktzHfRhRlS1+GqiMpiWczJC2Bpt+se2+ZSKO qtcC6s1g0EXvExma53BaKMAT9DUOsXorho+NsTmgcwvDY3Zu6tuLybGu4Swn8hUDB0 YZjYzLxNdnn7br2Mu9He/Vt6jwraj9MSzyyx5aeAuOBsTw2+khBOcz2r7xJQAl32MK c53gsAH9fzhSXGirQFJaYwWeL9bOXU2G6uKN/OFLkW9zAdUVFFZTmdCHqQrWQ4ySFv z46lm95MW7lykMSBvWHjkpTDgm5NZUgmZ9I1p9mi5HK2yBD5P1sdBEZ0PNRCGXw3Sh 22HaH71jXZaaA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D4E0269601 for ; Wed, 21 Jan 2026 15:10:13 -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 g-ZAefsEP_IF for ; Wed, 21 Jan 2026 15:10:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033413; bh=fEchPZlLSgKAxntIPmbxoTlYXspruEq65dwdQgXXsbE=; 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=l/fuhPecFiLc38Zxyq3IbChrJTy5YktzHfRhRlS1+GqiMpiWczJC2Bpt+se2+ZSKO qtcC6s1g0EXvExma53BaKMAT9DUOsXorho+NsTmgcwvDY3Zu6tuLybGu4Swn8hUDB0 YZjYzLxNdnn7br2Mu9He/Vt6jwraj9MSzyyx5aeAuOBsTw2+khBOcz2r7xJQAl32MK c53gsAH9fzhSXGirQFJaYwWeL9bOXU2G6uKN/OFLkW9zAdUVFFZTmdCHqQrWQ4ySFv z46lm95MW7lykMSBvWHjkpTDgm5NZUgmZ9I1p9mi5HK2yBD5P1sdBEZ0PNRCGXw3Sh 22HaH71jXZaaA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C16E2695FB for ; Wed, 21 Jan 2026 15:10:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033411; bh=Y1VdIJsUMTyRfxglx/zNJempdK0BBOo9enGCUs7OBVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9dwrT8H7oYTCpugu02f4ynV1448+OvkgRqPpah+oo52zeaUCBnvJPkzJT+g459TO KDjoIbpC/6BR4kty6U4FArixKScjBJzjGg0mtur9JGmAig4gwZvXvJ4LUOOdWkVpBK bllhLMdOj37UNWtSSzOwVRsO/Igs686ePOVdI+I9x+7eD+OfkZq++1qjm4qmMRu4eM vRciMJhEgizCxMszz0hB/oOr06LdN6muLm7FNXKDJmTnW/8ZSryzq1qtXKidF0OIAR OiluBAwH1E14tKjWEsJVni5wp2nsTukhvBkmoRDOjZVaRitassEHZkYtmXcoWt8m3t InPpudJJgGcFA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C790A69601; Wed, 21 Jan 2026 15:10:11 -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 6gwt5BO3xrGt; Wed, 21 Jan 2026 15:10:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033410; bh=ukkxcpWR3UbdQluLZe6bROTVqIhpvg5u/2BIgI/Z5vs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qwsQwD4IjIeD7hnMcVGooclKUCMZby7y9vbWWoOnsi6MjEhqNLxh3jf1Mv0zf1WdA UOq3eblN30yjQebt82ONVA6TjD39HeTE2ZPkKYBPjwdMbAgJdqxo69K1bA8I4aGtmu STv87LjfaZPS0hcRGf54HNJ+0AFH0r8YD0F2OmDlzUW7DYdyWT/y+vYPTqj9fjJ/i9 PXSSGvGlyXFgJxse8XTZeFaPUW2Za9Vhkfe37KfNllPHWcgyiCFlmJlWnqXjETcEh/ uH1ClixAa/vFe1Bx9r84q0dhVqg0isiZeXF1rRbK4nEPLVb0DWCPuuW46itikhnDng uFMfJw4e96YpQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3B101695F7; Wed, 21 Jan 2026 15:10:10 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:29 -0700 Message-ID: <20260121220857.2137568-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ONXVJRGTXQGIDCXEK5WWYU4MGB7EONRZ X-Message-ID-Hash: ONXVJRGTXQGIDCXEK5WWYU4MGB7EONRZ 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 16/33] ext4l: Consolidate DX_HASH_* into EXT4_UBOOT_NO_EXT4_H block 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 The DX_HASH_* and EXT4_HTREE_EOF_* constants are already defined in ext4.h. Move them inside the EXT4_UBOOT_NO_EXT4_H conditional block so they are only defined for files like hash.c that do not include ext4.h. Also merge adjacent EXT4_UBOOT_NO_EXT4_H blocks for cleaner code. This reduces ext4_uboot.h from 528 to 526 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index e21732da843..7356ddb6213 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -173,8 +173,8 @@ struct path; /* QSTR_INIT and dotdot_name are now in linux/dcache.h */ /* - * Hash info structure - defined in ext4.h. - * Only defined here for files that don't include ext4.h (like hash.c) + * Hash info structure and constants - defined in ext4.h. + * Only defined here for files that don't include ext4.h (like hash.c). * This is wrapped in EXT4_UBOOT_NO_EXT4_H which hash.c defines. */ #ifdef EXT4_UBOOT_NO_EXT4_H @@ -184,7 +184,6 @@ struct dx_hash_info { int hash_version; u32 *seed; }; -#endif /* Hash algorithm types */ #define DX_HASH_LEGACY 0 @@ -200,7 +199,6 @@ struct dx_hash_info { #define EXT4_HTREE_EOF_32BIT ((1UL << (32 - 1)) - 1) #define EXT4_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1) -#ifdef EXT4_UBOOT_NO_EXT4_H #define ext4_warning(sb, fmt, ...) \ do { } while (0) From patchwork Wed Jan 21 22:08:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1743 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=1769033420; bh=a4kx/qAq3bOB8LPi1FFVN3k7HDhW9JtpDHHCNMxjJy8=; 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=wC8o8CoerE9Ali2mBjaoGHox+M/Qgnnj1OCU72yaGXIN7PbNu5XWuXhOjrMLzVfeg k+0BC8lGwBoge3uZIQqNeiyXoQrYuPWKtj7V58Aqj4qFtYARE6js9erMMA2zLwnRO0 xPzvkiPbyn13V2jYeyZ9IbFxJ8vdqGhfGP2crLE4M/giApVS4RUwOFUq6FxdJQrjrz NQ+apnmRq6YCFkCDE3VSAcxhdin0l2sD8dI86xXQGa+rHMMQL96g7QcOIrZM8CtHSZ E3hh73n0lnZu4AED+vsKodzft8aaaSHCdiovjONBc4Ir2fKxPZe/ETfG7DJ28IMYBV AQ8sRXCM0r5IA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 795B16960A for ; Wed, 21 Jan 2026 15:10:20 -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 V11KjeGEVeRT for ; Wed, 21 Jan 2026 15:10:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033420; bh=a4kx/qAq3bOB8LPi1FFVN3k7HDhW9JtpDHHCNMxjJy8=; 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=wC8o8CoerE9Ali2mBjaoGHox+M/Qgnnj1OCU72yaGXIN7PbNu5XWuXhOjrMLzVfeg k+0BC8lGwBoge3uZIQqNeiyXoQrYuPWKtj7V58Aqj4qFtYARE6js9erMMA2zLwnRO0 xPzvkiPbyn13V2jYeyZ9IbFxJ8vdqGhfGP2crLE4M/giApVS4RUwOFUq6FxdJQrjrz NQ+apnmRq6YCFkCDE3VSAcxhdin0l2sD8dI86xXQGa+rHMMQL96g7QcOIrZM8CtHSZ E3hh73n0lnZu4AED+vsKodzft8aaaSHCdiovjONBc4Ir2fKxPZe/ETfG7DJ28IMYBV AQ8sRXCM0r5IA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 679F369605 for ; Wed, 21 Jan 2026 15:10:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033418; bh=RxwaLJTVobCjsJsxpBPkw1Ua8ZBih9VAg1FSY5Cowz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KcaY9jnx9BEOyTeOm1lonquNByBKqSB+VuTm50tW5IUOZe9/TskmTLpW+G+pWgdzN PYWVC2am3KDT3bnhmv6GOfJfO8/i3qtGtaRyAL89/Dn2szxGLxF6vCvWJpUoS5eACE YRyZH8pZu3XnL21MnnJwcKR4IqPovQD3/4JDTowijk4al8abND4EXhlpHVMMptxnd+ W119jfVXGK6w/TH7lG34E98j8P5W1bwlHR+g86yK9uxNzel8FMSRpcgv3X4/ZFFE99 9iswr2yWHQ91ERoHm1zpVatV2nbeKwKU8p0ygMbWPd85Bf0v2nwTlTSM44TSksUSoS bb9d+9opexY1Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 75DAF695FB; Wed, 21 Jan 2026 15:10:18 -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 K9i2h7ZCDnAe; Wed, 21 Jan 2026 15:10:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033411; bh=yh7mxZbykiGqcFhopOAuSuFBPLhis9WAE7li8AcUrsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YPzVOuomyefJAKIcA6CyLXuo3m3/1XybVIZcA35JElVrefCLaCa0jAqVU9zSGTHne 6ReybqQD/Ic4hPL+rMQjfM2zijWBBIu1WqVIIRPXxNo0gDtUwfdHVCeuvsjd7CFLxk 0+mTKKRYPXK/g05xdP2Lj82Tp4F3HN5F4ChLaaFnhSpO1yLlCYZE1vWsl33VIfOyux rO6gIw23EXHhnsIOMndNhQSZnYq5ssP6w7H+g1un/4H4Uc7+Aj4i18oR0BNnf02pW4 mVXkKjhbMPwGix9Ki4U1KVMVqgoPcS4eRWriGuwmIW4cOiouBQFFvbMp/TntUOzZw5 7XgMBAuWHaO7g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1141E695F2; Wed, 21 Jan 2026 15:10:11 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:30 -0700 Message-ID: <20260121220857.2137568-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XXWMY5YW6HJEFUKGMTMTXE3MRLRUAT24 X-Message-ID-Hash: XXWMY5YW6HJEFUKGMTMTXE3MRLRUAT24 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 17/33] ext4l: Have hash.c include ext4.h directly 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 Change hash.c to include ext4.h instead of using the EXT4_UBOOT_NO_EXT4_H workaround. This allows removal of the duplicated dx_hash_info struct, DX_HASH_* constants, EXT4_HTREE_EOF_* constants, and ext4_warning macros from ext4_uboot.h since they are already defined in ext4.h. This reduces ext4_uboot.h from 526 to 493 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 34 ---------------------------------- fs/ext4l/hash.c | 4 +--- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 7356ddb6213..14b3d075dd4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -172,40 +172,6 @@ struct path; /* QSTR_INIT and dotdot_name are now in linux/dcache.h */ -/* - * Hash info structure and constants - defined in ext4.h. - * Only defined here for files that don't include ext4.h (like hash.c). - * This is wrapped in EXT4_UBOOT_NO_EXT4_H which hash.c defines. - */ -#ifdef EXT4_UBOOT_NO_EXT4_H -struct dx_hash_info { - u32 hash; - u32 minor_hash; - int hash_version; - u32 *seed; -}; - -/* Hash algorithm types */ -#define DX_HASH_LEGACY 0 -#define DX_HASH_HALF_MD4 1 -#define DX_HASH_TEA 2 -#define DX_HASH_LEGACY_UNSIGNED 3 -#define DX_HASH_HALF_MD4_UNSIGNED 4 -#define DX_HASH_TEA_UNSIGNED 5 -#define DX_HASH_SIPHASH 6 -#define DX_HASH_LAST DX_HASH_SIPHASH - -/* EOF markers for htree */ -#define EXT4_HTREE_EOF_32BIT ((1UL << (32 - 1)) - 1) -#define EXT4_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1) - -#define ext4_warning(sb, fmt, ...) \ - do { } while (0) - -#define ext4_warning_inode(inode, fmt, ...) \ - do { } while (0) -#endif - #define vfs_setpos(file, offset, maxsize) ({ (void)(file); (void)(maxsize); (offset); }) #include diff --git a/fs/ext4l/hash.c b/fs/ext4l/hash.c index 58063a872d3..c033e44b2d5 100644 --- a/fs/ext4l/hash.c +++ b/fs/ext4l/hash.c @@ -5,9 +5,7 @@ * Copyright (C) 2002 by Theodore Ts'o */ -#define EXT4_UBOOT_NO_EXT4_H -#include "ext4_uboot.h" -#include +#include "ext4.h" #define DELTA 0x9E3779B9 From patchwork Wed Jan 21 22:08:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1744 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=1769033422; bh=e4XmTu7iCBj+GYM6jfbf2DCj6FEaeHgr72DOk0Kbo10=; 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=nVNR4o2VmULSkTulC6KTDXThJ4zk7g9xac3v+nq7CF2MN/c+jS3XBN/lXB0mxdUQz XQux4eiPl2nvMrMx2Zyc47FeNj7Y++P4x4EFuBfovKHA9e/1v3rbca9y3BBmig4fzv eV2UBRUwoiXJ3qOKMh1PRIBdQ2h0XtvKDAtdX+0E7cG7LMimvaFmYTUTQlY+ioLzlK oi4prMeOU9euYdShpq2DzCxFBsW4+/CMTUsQDHS2DPgVdRHQDMQ/BVZghiHSEkbUT2 A73Ios34URjhn9ln2tG2bUHDB/S3134C/zkfAvFIkwWRce4iU7x58LwK+lXoLz9opK s4VRtPz0bHLSw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ED4F569616 for ; Wed, 21 Jan 2026 15:10:22 -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 OtSIdbnmV1fs for ; Wed, 21 Jan 2026 15:10:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033421; bh=e4XmTu7iCBj+GYM6jfbf2DCj6FEaeHgr72DOk0Kbo10=; 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=ET4fA+Xe9ba9cYlb6CpKgmduqfXXjvd6bGYTinSqJAb5p8fLtI1pf3OtzDPnFxpTL itUxQxX8ylYmZ47LdK8J0T0c9Pf84yDlLgH23vFsDEuv4lMWfkxG2t49HeDzBQMS4n mldPlwNhmNMC5kU5X5LI8YzxhXADUqp7mbD8NoHHC7DpKaJ93Pm9RxAhM/7onnSa+h zxB4+1pOwPu2W69XvHXnXSlem585I3MLAOG5Mr/cQ2nbURoqraKfh2Gvx69qHgaWOf vrdN5HWnAqA+qZgksswFzcud/QjkDVK97cGmNHjQxs+/ufCwWshrjR5o8GWzoFqVRu fv+ogi9go5lqA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EEFF369605 for ; Wed, 21 Jan 2026 15:10:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033419; bh=wTwKYkZ4YLSyVFl06t/qGOg3iUltH245/Gc1pQJNwN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ngzaII454lf+SLO9mNEuwEIVV+du/BZ8aS5/RxBP3ELqB5Pd+PX8mGsqPNa1PS4Jp y6Z4f/Lk+7o4Acub78Yxd5Lcm8malpPNHzSQvw+19rAbG5L/c14taQXBOsXaRc1n69 Agan9yWFeQqSD6sxuluQzIXXBHmQmTODWK7xkgZyvGg76RNNbWaBoajnbfwOpvGuJW XDBUwfhJlhkzyomUA0uIBbHozsf0IpP9NOEPi97AB7J9vcybigdzH1YEsw4l1GtsjS J6Fclt29scai9WF8LCBbrhhZMR8CpUVd9AUaDnwd5z8Z/lSBJTKhtcgD4Fpfa6XVdq YbfeB1+/VQg0Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F16BA695F2; Wed, 21 Jan 2026 15:10:19 -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 Y7osEvtk9xbx; Wed, 21 Jan 2026 15:10:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033415; bh=MM2jvJj2zlzaTXcxrF3sDAu8ex/+OAavuvA+I6Jh9ww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gCxgo5pfQV936YMGqcHMPgJxV+DovyKU8lEEYncVBRGJpyLFLxiSpY9uspzGlayjt VK0vpSeb++f8uDBxwYfIIpe8AVlyxgnjZ6LRPqVbQs+0u4IJOFwY2JLeCiy/AB9Vnj lqt2qYr1TpDA7cjHmY17WkMw54E9eQpb0kMwECWdvwn1SWby7ORi3A6jXPneImQp6w rBi87Oz5JOlzqNmmth7JKVbl2zdpsd0tvZT1xnWGKyFRiWzhcnVSR7zrKmI9sQba42 KnLy+ykxM8pi4MdGEzuoSZhcUAR35Ihl2cYl9nndejxHY03PdNerNVzp8bvL9OWwZD tYxlfYn6QNTuA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A4C7A695F7; Wed, 21 Jan 2026 15:10:15 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:31 -0700 Message-ID: <20260121220857.2137568-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OKEBOIYPGD6MUGZYYQYE65NAZBH4DWUN X-Message-ID-Hash: OKEBOIYPGD6MUGZYYQYE65NAZBH4DWUN 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 18/33] ext4l: Move inode and filesystem helpers to linux/fs.h 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 Move inode lifecycle functions (new_inode, iget_locked, iput), block mapping (bmap), and simple filesystem helpers (simple_open, simple_get_link) from ext4_uboot.h to linux/fs.h where they belong. Also replace the list_sort and sort stub macros with proper includes of linux/list_sort.h and linux/sort.h. This reduces ext4_uboot.h from 492 to 466 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 30 +++--------------------------- include/linux/fs.h | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 14b3d075dd4..1228ced8e6c 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -117,9 +117,6 @@ #include #include -/* Inode operations - iget_locked and new_inode are in interface.c */ -extern struct inode *new_inode(struct super_block *sb); - /* Forward declarations for xattr functions */ struct super_block; struct buffer_head; @@ -134,8 +131,6 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, #include #include -void iput(struct inode *inode); - #include #include #include @@ -226,9 +221,6 @@ struct path; /* UID/GID bit helpers - use linux/highuid.h */ #include -/* Inode allocation/state operations */ -extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); - /* Attribute operations */ #define setattr_prepare(m, d, a) ({ (void)(m); (void)(d); (void)(a); 0; }) #define setattr_copy(m, i, a) do { } while (0) @@ -261,17 +253,6 @@ static inline void nd_terminate_link(void *name, loff_t len, int maxlen) ((char *)name)[min_t(loff_t, len, maxlen)] = '\0'; } -/* file open helper */ -#define simple_open(i, f) ({ (void)(i); (void)(f); 0; }) - -/* simple_get_link - for fast symlinks stored in inode */ -static inline const char *simple_get_link(struct dentry *dentry, - struct inode *inode, - struct delayed_call *callback) -{ - return inode->i_link; -} - /* * Additional stubs for super.c */ @@ -436,9 +417,6 @@ void ext4l_print_msgs(void); struct blk_desc *ext4l_get_blk_dev(void); struct disk_partition *ext4l_get_partition(void); -/* JBD2 journal.c stubs */ -int bmap(struct inode *inode, sector_t *block); - #include /* Memory allocation for journal.c */ @@ -483,10 +461,8 @@ int ext4_update_overhead(struct super_block *sb, bool force); /* fsmap is now in linux/fsmap.h */ #include -/* list_sort and sort stubs for fsmap.c - not used in U-Boot */ -#define list_sort(priv, head, cmp) \ - do { (void)(priv); (void)(head); (void)(cmp); } while (0) -#define sort(base, num, size, cmp, swap) \ - do { (void)(base); (void)(num); (void)(size); (void)(cmp); (void)(swap); } while (0) +/* list_sort and sort for fsmap.c */ +#include +#include #endif /* __EXT4_UBOOT_H__ */ diff --git a/include/linux/fs.h b/include/linux/fs.h index c8006d668b5..07fe8c5e711 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -557,11 +557,29 @@ enum { #define unlock_two_nondirectories(i1, i2) \ do { (void)(i1); (void)(i2); } while (0) -/* Inode allocation - implemented in ext4l/stub.c */ +/* Inode allocation and lifecycle - implemented in ext4l */ struct kmem_cache; void *alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, gfp_t gfp); int inode_generic_drop(struct inode *inode); +struct inode *new_inode(struct super_block *sb); +struct inode *iget_locked(struct super_block *sb, unsigned long ino); +void iput(struct inode *inode); + +/* Block mapping - implemented in ext4l/stub.c */ +int bmap(struct inode *inode, sector_t *block); + +/* Simple filesystem helpers */ +#define simple_open(i, f) ({ (void)(i); (void)(f); 0; }) + +/* simple_get_link - for fast symlinks stored in inode */ +struct delayed_call; +static inline const char *simple_get_link(struct dentry *dentry, + struct inode *inode, + struct delayed_call *callback) +{ + return inode->i_link; +} /** * get_block_t - block mapping callback type From patchwork Wed Jan 21 22:08:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1745 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=1769033427; bh=SE20nOfBN0oVw0lekMPgVkZlJHJ2f//Y51pvn2tWkKk=; 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=mQ+XpypQZGH7zKQd1mZesj3E3JCdlzA1O+tbdhdCoNLyKNUGPRVtRkMHHW4o5COff UBKX8sGA+B2scg6pRakeBoskTjCGCUGKxYamQuxJc5x9p6jyUDWUcwylxwqcOwHpiD 3fRiaOAEqPA1k5TctPFvTmVByEUz/egAbn6sFFo7VA3Gq0p2EkO+KUfDQG+zvgWDTg HEb1Aim8zdOzh8PVx6B8C5o+rvPuTTYZ+xsPl1TVPgU7t3NjqPgrXEUqXmXuCpa6g8 18sfZ4ZwtIIhRkIIfVELBwn+7u5x1rXFrCTreVR6ZviLC0GagQLWyFy+BJ/8Xrzc1h Jn4xBj5meHXjQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AB23869605 for ; Wed, 21 Jan 2026 15:10: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 67wXUE3e6sNR for ; Wed, 21 Jan 2026 15:10:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033427; bh=SE20nOfBN0oVw0lekMPgVkZlJHJ2f//Y51pvn2tWkKk=; 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=mQ+XpypQZGH7zKQd1mZesj3E3JCdlzA1O+tbdhdCoNLyKNUGPRVtRkMHHW4o5COff UBKX8sGA+B2scg6pRakeBoskTjCGCUGKxYamQuxJc5x9p6jyUDWUcwylxwqcOwHpiD 3fRiaOAEqPA1k5TctPFvTmVByEUz/egAbn6sFFo7VA3Gq0p2EkO+KUfDQG+zvgWDTg HEb1Aim8zdOzh8PVx6B8C5o+rvPuTTYZ+xsPl1TVPgU7t3NjqPgrXEUqXmXuCpa6g8 18sfZ4ZwtIIhRkIIfVELBwn+7u5x1rXFrCTreVR6ZviLC0GagQLWyFy+BJ/8Xrzc1h Jn4xBj5meHXjQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9A54A695FB for ; Wed, 21 Jan 2026 15:10:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033425; bh=36S7EBy+OWjYmnBe1A4mETQmG4Xx+WeK/HJF0gjg+q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tJWdJQUBRsheIkMDRywyKLcfMjnIH/3QFGaq3MVgrkUKnpvBW2hFsRQAiiK07zRGR up0p8ZGS2VDCpVVcHmpesJGPk4N1KgepiF+CiYA8UTatWEsJrYLeVY9tDgttsygOts tScwaYoOgVldT867NAJ2LHwQb++PrxmaUakFE2Nhm6dw4qlL5x57R7tmtP6QJ4T4j3 L/ewVCk92BqV4sPAkahRzsBVOo5G2zA4CsMGzqaz2KL9V1U8Uwo5Nbu3ZLplJ3Mxwp XhIIziF6tiVsqtKLDsL+EdvAbzQkwv5AmQ9aZXUxaFFMFvibbpdo6ZwM2mZ6hCKTxJ hXJBHjOEO5FFg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4555F695FB; Wed, 21 Jan 2026 15:10:25 -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 MHGRsc43lmY1; Wed, 21 Jan 2026 15:10:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033420; bh=jZS4G8nzRX/yQJ0lLIvYb84StZrp7vidw5ETwKpIjr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPOMBHI6lPUicSp7HGEEjFU2ChmipzMJuJMn5T61mC6+miaP1x5LVV80ReJP0MZDI 0TScCR8crAnw//Kv0GEfK32PDSh+4uMDEQwbHwwYiygH+nyRvMXKHH7QdMW5B0hgL6 y0j0RZMyaDS4Ld7l0dYrnYsl4IjSeqeRlJ3cuvox1Ur+S5YqfRxbRByB8h7DUFiNtU C9aW+AnapujXXGcwMKhF/V5zwBoNdugrHhvCqIvjYgA2n5S+IURyOU/nj7Sf/uLilg SuJpbh//NpzpvmONhrWeJZ6pXmMVS+9p1R+4gpFriZWz1ZDANE0bUzd/eimsXkF9qx KdWL/LpcKpxfQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3EC0C695F7; Wed, 21 Jan 2026 15:10:20 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:32 -0700 Message-ID: <20260121220857.2137568-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7HZ3FDRHSIINHMT4GN6XSYFOYYI7TPQX X-Message-ID-Hash: 7HZ3FDRHSIINHMT4GN6XSYFOYYI7TPQX 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 19/33] ext4l: Move time_is_before_jiffies() to linux/jiffies.h 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 Move the time_is_before_jiffies() stub macro to linux/jiffies.h where other jiffies-related definitions reside. This reduces ext4_uboot.h from 468 to 465 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 --- include/linux/jiffies.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 1228ced8e6c..9229fc7ffc3 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -448,9 +448,6 @@ struct disk_partition *ext4l_get_partition(void); * Stubs for resize.c */ -/* time_is_before_jiffies - check if time is before current jiffies */ -#define time_is_before_jiffies(a) ({ (void)(a); 0; }) - /* ext4_update_overhead - declaration for stub.c */ int ext4_update_overhead(struct super_block *sb, bool force); diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 153a2841bf5..161ec56f688 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -29,4 +29,7 @@ #define nsecs_to_jiffies(ns) ((ns) / (1000000000L / HZ)) #define round_jiffies_up(j) (j) +/* Time comparison - stub for U-Boot (jiffies is always 0) */ +#define time_is_before_jiffies(a) ({ (void)(a); 0; }) + #endif /* _LINUX_JIFFIES_H */ From patchwork Wed Jan 21 22:08:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746 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=1769033432; bh=n6pWnEkOIkOgEIMXrYqsr3trF/Cw1AIShtWTlA/y/Eg=; 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=agpu1zeghK11BQmNbEeGyGvfL4WeQOgqAH+Ik37Ri3NYyNbYA2Y+iHkwsNVbNFFPq D3tIWlZiPg/Yul2UcT5udPL6TTqcPU94HeNE8P4JPiXEWY2drElsMc7UqkWBnpIeE6 2729DathsMN/K5mJQraC69zDsZ49aRceWAO+Qy28G6uR7DKxk4DUHR/2W8XZF7/moM nPTzJGR1f7KM2HD2UX/ndI62Hx3Ksj907VyaTMFhx6655KaGf6MlyfnHddcQKOkcgl 5nVRBfDr74ckMwif/PqVCJcuburFH8KbjGqYqVS7bcbAfpTZ+JIv0Lr1ROuznlyz92 7qC0awjXv3pVQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 362DD69605 for ; Wed, 21 Jan 2026 15:10:32 -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 gDEgky93PujU for ; Wed, 21 Jan 2026 15:10:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033432; bh=n6pWnEkOIkOgEIMXrYqsr3trF/Cw1AIShtWTlA/y/Eg=; 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=agpu1zeghK11BQmNbEeGyGvfL4WeQOgqAH+Ik37Ri3NYyNbYA2Y+iHkwsNVbNFFPq D3tIWlZiPg/Yul2UcT5udPL6TTqcPU94HeNE8P4JPiXEWY2drElsMc7UqkWBnpIeE6 2729DathsMN/K5mJQraC69zDsZ49aRceWAO+Qy28G6uR7DKxk4DUHR/2W8XZF7/moM nPTzJGR1f7KM2HD2UX/ndI62Hx3Ksj907VyaTMFhx6655KaGf6MlyfnHddcQKOkcgl 5nVRBfDr74ckMwif/PqVCJcuburFH8KbjGqYqVS7bcbAfpTZ+JIv0Lr1ROuznlyz92 7qC0awjXv3pVQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 260F2695FB for ; Wed, 21 Jan 2026 15:10:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033430; bh=zdxdpoIxs0jtKkh4yeRuYqAsAv06hpqmJVUkrOyi0JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X/N7een+67YhsmA7v9ComGSfwiVUjKJRHwokcYPNS+zps5v9nk6cu9hYbansGgjJl BIbN14+jlNdduPNUCDpuLq/9a1WtDl9ZjcmF1GzqO+b8SkmV2SDN1X4WlIdfk+5W0k T6kn/sKbnqwDhp867HNREJI23zsHD2Ce+53b5EUU+DLXZheG2JNsXW3p4KnI2/kRNr vlJMMnrIzLu0skF6TVZxAWvHtxXwsKOnNL7i0C0Qf0HS+VEbeczKNX/yHtb/DVxTKQ BB6hYT9AybcW1PYJfdcN3Gzvl9Inqg3p2bZHg5bnk0v8d/BWmjetKTK/HoDjcuN66Q dz0hgbhsiwKmA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 22929695FB; Wed, 21 Jan 2026 15:10:30 -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 GufQ8zyuPYTK; Wed, 21 Jan 2026 15:10:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033425; bh=sFi8nkL3pbBmQ6MB8AqMZ+nV5G8Vy7epiW7shW1Oq+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qu+uvIl6VZ4LpRF1gUBSX85k4UkKyBJMtsQWqDhqgGbgA5QFCm+GOPMS6SLvcsfd1 BQZT/CaglMFSb78eggFsZCECqISXIwNmaKy7RXo5ZGcyIW2OdmVP+iFFBMksHuU+D5 EV9Vxbb/ib14K7D0cu9muY7PDANnVT0y63j6++2qLN3NztFaUN+pQX9sRIDAhqVD6T wLjkKjXcGremfbx3MyuObX7oDJbax4lJFXrA7EGYyDgxGiuYkFk9J7NuBV/awoLXri BGQ9HAn8o19c/fGafEwnlaVaE/vJ+N6JiZVJoSHZU2FU3DxX16CA3LT1f1RxZOYuLl lCx4zS9Js+v0A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F172A695F2; Wed, 21 Jan 2026 15:10:24 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:33 -0700 Message-ID: <20260121220857.2137568-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ONMNNWJHM634DFHQB2M6IBUCIZHPFL3K X-Message-ID-Hash: ONMNNWJHM634DFHQB2M6IBUCIZHPFL3K 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 20/33] ext4l: Remove duplicate ext4_update_overhead() declaration 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 This function is already declared in ext4.h, so remove the duplicate from ext4_uboot.h. This reduces ext4_uboot.h from 465 to 458 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 9229fc7ffc3..7b883f9a7ff 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -444,13 +444,6 @@ struct disk_partition *ext4l_get_partition(void); #define PAGE_MASK (~(PAGE_SIZE - 1)) #endif -/* - * Stubs for resize.c - */ - -/* ext4_update_overhead - declaration for stub.c */ -int ext4_update_overhead(struct super_block *sb, bool force); - /* * Stubs for fsmap.c */ From patchwork Wed Jan 21 22:08:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1747 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=1769033436; bh=pEI+p/RjT6aWcFgzkkTDljRWieslRUq5Fs0Qb/BkMb0=; 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=Jcr1+Augw3yQTvnTP9oPQ72UNNlNmHqOUs+dxlktIIusq1Y3K0rrsI6dgjy91K1qz QwR7NHnCPc4xb5gU1IxdxtpPdGOkm3BG3XbtBMDPzYWVK1MFaiqC9Sew8gTVsFLBsn VFkV9YnG7jNXCMaCyrX1jzj88PArzIUCEQp8D1/HfN/QfqxXDxyTuN0J/r8pIqYd49 8SOGpG8cT8Z8K/9WKO3t9dvhvWeBY569NA3u/8iFRwyixRtf8jQjnRo8kTImTr9+2g YtkSzQkdcztJuahIT96VtAPyLYyz7TUHMRxHuiQ1f6iWkfOtWwqWyuuyQsIWfZzgfv TyvQFV8pzznxA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A0C9E69605 for ; Wed, 21 Jan 2026 15:10:36 -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 oPwE3PeXIMKW for ; Wed, 21 Jan 2026 15:10:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033436; bh=pEI+p/RjT6aWcFgzkkTDljRWieslRUq5Fs0Qb/BkMb0=; 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=Jcr1+Augw3yQTvnTP9oPQ72UNNlNmHqOUs+dxlktIIusq1Y3K0rrsI6dgjy91K1qz QwR7NHnCPc4xb5gU1IxdxtpPdGOkm3BG3XbtBMDPzYWVK1MFaiqC9Sew8gTVsFLBsn VFkV9YnG7jNXCMaCyrX1jzj88PArzIUCEQp8D1/HfN/QfqxXDxyTuN0J/r8pIqYd49 8SOGpG8cT8Z8K/9WKO3t9dvhvWeBY569NA3u/8iFRwyixRtf8jQjnRo8kTImTr9+2g YtkSzQkdcztJuahIT96VtAPyLYyz7TUHMRxHuiQ1f6iWkfOtWwqWyuuyQsIWfZzgfv TyvQFV8pzznxA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 91105695FB for ; Wed, 21 Jan 2026 15:10:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033434; bh=bFVo0EtV7FXqh3ICXtcuocXRNTIsrAwAjO5qoyyu26Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KFF3ZNhq1XUZ0/SznowSA0gre4L2O4lfp1+2YtifufhVV/Rpm9IQziPArY0+3Ih3P QltnVH8FwTVA8WoV9TozwFOGOJbDSut9KIyVOFXF0Hrks9jvO9d2fGsv2Nuc9bjZeA t5t/NDtLxIL8fovJpJCt6SOMX9cAllkmXsfR84jD+XplGQTf0HYWEsHPmKlalPTR0v 4AeR4bfY/5ptwSfUcD6hFeF24J18twb0OPlGAMSFajIHeh/5hZA+R4WTLuA25CJYDK 4f1paxpTu1kluuPHjaf2e8TOVCg7AAg5FNsFgBLkda8JR8Dvs5NcucJ1e/+wu1nWfu 71ydTIixAO6LQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 940A9695FB; Wed, 21 Jan 2026 15:10:34 -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 QhuLn-9fMiqD; Wed, 21 Jan 2026 15:10:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033429; bh=t+HN7U3i9msXv8kpGxW1NH8TFYUBM2ugCHB1v8MuQqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GtqcdRkHHL8kAT2ZZhpee7Y9SZUFNCLQ2MkV9gu+yjEqOzw/6Ui26kbN91Zp0QtlN fnP7XhdWk9zl3sNl2zExGzy0ILmk7PEGB4xx2equWwwalV4IF4grESvFKE7ueV+g1Y 3MEUxdEgbCc33q2eOTdARPQjyKLcwibRhLSJzlHR6f5D7BFUKmMcHjmlzhINr5HvyR YSveNLkuJrAZn4Jq6lgBbouT6Q6LPVmm4umuug5/r+GkE4HqSq+7KHHfBhmCwo4p6P 89lfX05+yIa3Bm2Mk56P5GFSvHV8eJnKo2n8q1AgYO6RfKnHSE/JDtfRp5ldY4KOgm srfoCcPDdWBKw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9DDBC695F7; Wed, 21 Jan 2026 15:10:29 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:34 -0700 Message-ID: <20260121220857.2137568-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ONSM67EUF3ZJFXBBKQGC2FMLAFSQSE5S X-Message-ID-Hash: ONSM67EUF3ZJFXBBKQGC2FMLAFSQSE5S 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 21/33] ext4l: Move xattr helper stubs to linux/xattr.h 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 Move xattr_handler_can_list() and xattr_prefix() stubs to linux/xattr.h where they belong. This reduces ext4_uboot.h from 458 to 455 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 +---- include/linux/xattr.h | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 7b883f9a7ff..6b943934069 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -350,10 +350,7 @@ void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, void *holder); #include - -/* xattr helper stubs for xattr.c */ -#define xattr_handler_can_list(h, d) ({ (void)(h); (void)(d); 0; }) -#define xattr_prefix(h) ({ (void)(h); (const char *)NULL; }) +#include /* Filesystem sync - declaration for stub.c */ int sync_filesystem(void *sb); diff --git a/include/linux/xattr.h b/include/linux/xattr.h index db1bf4d3ee6..11cb3c8ad05 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -57,4 +57,8 @@ struct xattr_handler { #define XATTR_CREATE 0x1 #define XATTR_REPLACE 0x2 +/* xattr handler helpers - stubs for U-Boot */ +#define xattr_handler_can_list(h, d) ({ (void)(h); (void)(d); 0; }) +#define xattr_prefix(h) ({ (void)(h); (const char *)NULL; }) + #endif /* _LINUX_XATTR_H */ From patchwork Wed Jan 21 22:08:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1748 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=1769033440; bh=TeTd/fK2GEeD890Cj3J2ylKbOuCbwgT5Pgy0IwJXcis=; 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=VSKwE8qIILWGs5y49NFkFnh5Cvdi5Kcx7dJXZAMCDEd55L3fZyjcOpbCNkkkz+Gqz 3Ev3AkcfxK3Trqtj2WkLlnjfi+Mg0cDB8mnd28kD25JxDh/kov/1Z5TIllpfn3kfg2 hSs4gXcMVjeKoNhIRj8Bz1WRbEFfCmh9OI+hB5Q5guGnoS5n6czHBtzw86+RLg2fb5 6ncpVmCkThb8I0V5tyQ7JvOQ9CQKdy543+yownX5MPWj2gUzjZmG9pZWFJezp0P8HW m2GLlB2e8XMpgwkRgjVs+uRnBVjYfuZ7FdmYMnPaIT+YeAPsjoJL0Ibx9xIoj6jtOm nWoASHeWEwAzw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6EBF169605 for ; Wed, 21 Jan 2026 15:10:40 -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 xxAqE0dj7j_m for ; Wed, 21 Jan 2026 15:10:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033440; bh=TeTd/fK2GEeD890Cj3J2ylKbOuCbwgT5Pgy0IwJXcis=; 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=VSKwE8qIILWGs5y49NFkFnh5Cvdi5Kcx7dJXZAMCDEd55L3fZyjcOpbCNkkkz+Gqz 3Ev3AkcfxK3Trqtj2WkLlnjfi+Mg0cDB8mnd28kD25JxDh/kov/1Z5TIllpfn3kfg2 hSs4gXcMVjeKoNhIRj8Bz1WRbEFfCmh9OI+hB5Q5guGnoS5n6czHBtzw86+RLg2fb5 6ncpVmCkThb8I0V5tyQ7JvOQ9CQKdy543+yownX5MPWj2gUzjZmG9pZWFJezp0P8HW m2GLlB2e8XMpgwkRgjVs+uRnBVjYfuZ7FdmYMnPaIT+YeAPsjoJL0Ibx9xIoj6jtOm nWoASHeWEwAzw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5C2D5695F7 for ; Wed, 21 Jan 2026 15:10:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033439; bh=YvEggTw1d8LCO2Mlh5NSzJgZf5L8OwmDejadzCOLcWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OfnJHSp3d9fBHRLflh+DsYN7tlI3t4EjIvuSV2sWhwMMrwTfZP0XrZ0iTWE6ws/iO r8q0ep1Mge/zveuSivbdgCUHPqmvqf2clpQvuNJY+FVYT9Hrx+yAEXXPlfp50AJJ89 F5OrXjtcTwmg1McZ9Svpxc3NAU/kcWO5ayrZdIzdA5Lm6Yz3lzCQen6MxKM6bP9bL2 Ye5p7iwGOmm4Tks6VQR92Kxgw+s/rpnZhd5Elc5/fLFDukK1EmWNDw8958Q7dCOPpz 3AAKymBNKGlpICqduDHIl20k2LuRYRSF7DRVS7TYu3DqC96a1YDacOKzPrm5e0Z/ty G0JM9rsK5O9uA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 08098695F7; Wed, 21 Jan 2026 15:10:39 -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 UOXzxqLsx1BZ; Wed, 21 Jan 2026 15:10:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033434; bh=a/+kg6+RY0dUDrW83hK3hThK4H3MF2vBk8+aOFU1eZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQR04HAcTtjFUO7fUoU3XiDue5M1fHKClU+aFk3VC2MidAi4+WpF83QzaFpLTZOa+ C/WwBS8fbA47+HOuyizHpnGQMjp32xY50CDqM6aGYzghExjYPlvyc46H7CiXgb0vTl Rbxamsy2hDFOFXW6OXHozhaTLh3fHEwC3ba0ZvkDzqBCgM2Wm5h4d7vMk5yar0L+wO iAlq9kvFn+IxD4jbQx96kkXshBZXv9+e3vSch6o6+C/vmWUkyRA/F5Hom2IRP2C/9V 0czJRy3FtuTHJ1tINlz1q6uRVo/pS5xif2aUO2b6H8OI/Oe2J9bDpeuy1fapUcFvsT nnzm1WkcoFYUA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 41554695F2; Wed, 21 Jan 2026 15:10:34 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:35 -0700 Message-ID: <20260121220857.2137568-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EZCW7JOZJ54AKVGXGBAPRRUX6LXEYBSP X-Message-ID-Hash: EZCW7JOZJ54AKVGXGBAPRRUX6LXEYBSP 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 22/33] ext4l: Remove duplicate __ext4_xattr_set_credits() declaration 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 This function is already declared in fs/ext4l/xattr.h, so remove the duplicate from ext4_uboot.h. This reduces ext4_uboot.h from 455 to 445 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 6b943934069..240d3bf2fb2 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -117,17 +117,6 @@ #include #include -/* Forward declarations for xattr functions */ -struct super_block; -struct buffer_head; -struct qstr; - -#ifdef CONFIG_EXT4_XATTR -int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, - struct buffer_head *block_bh, size_t value_len, - bool is_create); -#endif - #include #include From patchwork Wed Jan 21 22:08:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1749 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=1769033444; bh=WZbN/GLdP0DIoK8k8hIfc/ZMK4cPBiMn+ZE1OnVVR+w=; 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=XdVFUx7A2bhP0WPDcSE5drWNb/OTqI/ZZbpdZx5zzLTcPCBpiGIitInv+hBsBDni7 /ptI+JgdvUBJYGK/PoPlY6JDQtmabrEfQqD8bnYxUCBBpgSRhfSTRYpLZtOj+lLy+o 3NEQ0SwzT9rb0m7ymswM5BwMbMI4yGltK3342EHcNGi8gmA6dNHQe1sHuht52m8cSr SvB9/D84JdeBcnN6NbRVoabT1Ygi9OXMamyZmk6btD+oeUMchq0nb6J6LTF63KKwex ze+1bnEpgMvYoy78RlQrG8zMabB3MOhrUqKCeHbDZM+ZLgJbJ69vs9KFiK0/oLjpAP rSdx93H1lfOlA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB34A69605 for ; Wed, 21 Jan 2026 15:10:44 -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 Let1jWNBxUBf for ; Wed, 21 Jan 2026 15:10:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033444; bh=WZbN/GLdP0DIoK8k8hIfc/ZMK4cPBiMn+ZE1OnVVR+w=; 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=XdVFUx7A2bhP0WPDcSE5drWNb/OTqI/ZZbpdZx5zzLTcPCBpiGIitInv+hBsBDni7 /ptI+JgdvUBJYGK/PoPlY6JDQtmabrEfQqD8bnYxUCBBpgSRhfSTRYpLZtOj+lLy+o 3NEQ0SwzT9rb0m7ymswM5BwMbMI4yGltK3342EHcNGi8gmA6dNHQe1sHuht52m8cSr SvB9/D84JdeBcnN6NbRVoabT1Ygi9OXMamyZmk6btD+oeUMchq0nb6J6LTF63KKwex ze+1bnEpgMvYoy78RlQrG8zMabB3MOhrUqKCeHbDZM+ZLgJbJ69vs9KFiK0/oLjpAP rSdx93H1lfOlA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DB2A5695FB for ; Wed, 21 Jan 2026 15:10:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033443; bh=PuBuy76pvYFIAoOi1AYRS6DYAievsfDLkldmnrEBXII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L9HMKbDDjrhImbMS+D1fvKa92NB+RoCvpCUa2Ih/JEsAVa4elcqNIMsGL0ibiA1NM P4WWJXCkuWNnTF//lPbXtF0eULPK2UO0kEs6+Pj+KGBjYKRQPI42xMyckE8QLxyjF9 GRhgtthP0i7U1XbF352evqhCdXUkoID3kcseQ40emxSKHESj7L5kHdaJwYK7TgJdhG LncEZIpIHRWdCtMuDv7Hfqci4X5goM+aMS5x+26M40XQv+L+5AMj3TBg/+gDbhJbwe medNKfLChJ8Dc5P4lDf2ShoWWp7sm+weQ5x+9kTKIi9S+eT5D7v43k7lU2A4vfxQLb 1i0Ng5+qbuKVw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 19271695F2; Wed, 21 Jan 2026 15:10:43 -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 sahyjxya4gNu; Wed, 21 Jan 2026 15:10:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033439; bh=DLqGBIHnHnKIcL3PlV+9+/AxSg4aJ4WcyF8c0hwN+iY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jKaOFQB0B/abX63hsNfy+FM4yGOA0SwYLf5M/tYB37lNo8Uj/+oVxwMbrahq+nWpO w9rmZ1J6GFo8pDly/XuGIenCFh5xCck00XztFN7vs/D7Fyr93zvnsrNo6tV6H6uZz+ tJpIBrIxkPSMVLm2gaOoCDVCJKW7sjQVNjxowA08OcBQD++0qsTpwdUW5+5r8DzO7l 5WhiRO6ZW+fZDET+zou0VdDA0tOlSCshvu5MsqRGvIkVfp1MRG9tJQ49/cQm6Cnfgq Ei9FtdRISl2jZX8/f3Mh52saSAkLdEgNb2gTzQ8AqunWa3ZoflMskgSa0IM67FTmlp HLyXoLCCSESZg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C48FE695FB; Wed, 21 Jan 2026 15:10:38 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:36 -0700 Message-ID: <20260121220857.2137568-24-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FZ5NYRHSWJYMLUVLXYQDDG45XZBG2HZ3 X-Message-ID-Hash: FZ5NYRHSWJYMLUVLXYQDDG45XZBG2HZ3 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 23/33] ext4l: Move iomap stubs to linux/iomap.h 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 Move iomap_bmap() and iomap_swapfile_activate() stubs to linux/iomap.h where other iomap stubs are already defined. This reduces ext4_uboot.h from 444 to 440 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ---- include/linux/iomap.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 240d3bf2fb2..2954723e2de 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -218,10 +218,6 @@ struct path; /* File operations */ #define vmf_fs_error(e) ((vm_fault_t)VM_FAULT_SIGBUS) -/* iomap stubs */ -#define iomap_bmap(m, b, o) ({ (void)(m); (void)(b); (void)(o); 0UL; }) -#define iomap_swapfile_activate(s, f, sp, o) ({ (void)(s); (void)(f); (void)(sp); (void)(o); -EOPNOTSUPP; }) - /* * Additional stubs for dir.c */ diff --git a/include/linux/iomap.h b/include/linux/iomap.h index a426cf35f40..9240ef443bd 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -105,4 +105,8 @@ iomap_seek_data(struct inode *inode, loff_t pos, const struct iomap_ops *ops) return -EOPNOTSUPP; } +#define iomap_bmap(m, b, o) ({ (void)(m); (void)(b); (void)(o); 0UL; }) +#define iomap_swapfile_activate(s, f, sp, o) \ + ({ (void)(s); (void)(f); (void)(sp); (void)(o); -EOPNOTSUPP; }) + #endif /* LINUX_IOMAP_H */ From patchwork Wed Jan 21 22:08:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1750 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=1769033449; bh=xkJixmCK0xz9IMXrPliRk0vcfwBM65PzBFblgVN8d90=; 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=Z2wji87loIXfYyEYbvXevOddGqOqxYQ+OWRTnWOEEnbNSe0pyunIWtSpVR3cbNlTc tInTb/tztJTj6mHksKSxPR8VpIPqg4kOTWqYq6EdmqkcQgLXIwkPbP5NiDiIPZea4p xYh3hiZeYGUOiN3JP39+JtabLdav9hxuYIIwxr6U1XVN6zcBH33WeoQnx8Eb5QRE60 oHO6xQb5DDZHAxEHPbmqBnz/eDx4BH9LdKu2OFoZXYcw3vThbrhcsPPA7r5pi9kIcM d8eQyW8f/pFNNu4mDPvGkfIbzc7McFflU7kUxfXUb7DV7xxQolkFWYMVi/Q0CmKM3t qzQnKjwrp7spg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 62D5969605 for ; Wed, 21 Jan 2026 15:10:49 -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 mjr_nnWljStf for ; Wed, 21 Jan 2026 15:10:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033449; bh=xkJixmCK0xz9IMXrPliRk0vcfwBM65PzBFblgVN8d90=; 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=Z2wji87loIXfYyEYbvXevOddGqOqxYQ+OWRTnWOEEnbNSe0pyunIWtSpVR3cbNlTc tInTb/tztJTj6mHksKSxPR8VpIPqg4kOTWqYq6EdmqkcQgLXIwkPbP5NiDiIPZea4p xYh3hiZeYGUOiN3JP39+JtabLdav9hxuYIIwxr6U1XVN6zcBH33WeoQnx8Eb5QRE60 oHO6xQb5DDZHAxEHPbmqBnz/eDx4BH9LdKu2OFoZXYcw3vThbrhcsPPA7r5pi9kIcM d8eQyW8f/pFNNu4mDPvGkfIbzc7McFflU7kUxfXUb7DV7xxQolkFWYMVi/Q0CmKM3t qzQnKjwrp7spg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 52B7969601 for ; Wed, 21 Jan 2026 15:10:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033447; bh=Ns/wwYZ6VuWefKSnGX5TObKovEL2MLk3l4kEoJ1nUMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XL745qtqFwTgH9//3i8Se2hwvlPSIKA8rhNkFKjrsjFyTLRV5Kj1qunmgCA765SO5 ID4ivjc5pq7mGPIRelUr/Er1UTOVu1QnZvVPlwFz+5/thQFy95kyNh6nOYcOip4GYa gj4Vu6X0eFP5rYCcxgDcjGrtVKTLXYmJa0I7GTTjD8Iqg9cLn3ZwcF2QgOjUpd8XPA 6Z/WEX+Rd6pOI6xUu2aSWhtTeewbZHPCLiCL0fyTD14tDR8ICovZxLKVwEimpJyD/A BMtPzPcPlrlhWGYKfF/Smwt/Rup5mzbV+Hi3ygtxAONY/XoJOZUhSE2HNGZGdiszcx 2uIgAz9ekmGsg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D08BD695F2; Wed, 21 Jan 2026 15:10:47 -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 hXQEpHP7OB_o; Wed, 21 Jan 2026 15:10:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033443; bh=vKlg4CDB0BwiDidk+2wBD1l5y3H7UfSb3RNrem7TKqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rVEWnytMJYK4vQfG9nI0h25gZ6k9hZT79M/e1ZB86QkNUu6X+9B/CBzDfa5/WJVso xMxmVa1Z70cluuQtzKYC/v2R4oWtJc2ZaSPoDiRq3O/OiNX3xZGpeMoNWoY4OEvMQG Kft45gffdZDch888Qc7QdavWUO1E6KdmVEEtx/b78zYOaX/GkbGp7NNaeBKBLaX9cv muOdMLz6w+Ty5jstqOHfEfHkD1808Lw3RQcniSdutB+wmIi7JuRoj+cpkoZL4HTOKI fP1oWdkS8qMn1sWUVq++Pc+5lXVDG+Kzwyut4SoQ2mc5r5na+rIrjIIt4n9UGTu5k2 xSKEt7pjFoVrQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 84D79695F7; Wed, 21 Jan 2026 15:10:43 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:37 -0700 Message-ID: <20260121220857.2137568-25-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AJ3NUUMKUZH2UD6CRYVA43WRRC2FUYU5 X-Message-ID-Hash: AJ3NUUMKUZH2UD6CRYVA43WRRC2FUYU5 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 24/33] ext4l: Move setattr stubs to linux/fs.h 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 Move setattr_prepare(), setattr_copy(), and posix_acl_chmod() stubs to linux/fs.h alongside the iattr structure and ATTR_* flags. This reduces ext4_uboot.h from 440 to 435 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 ----- include/linux/fs.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 2954723e2de..9ddd88d78aa 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -210,11 +210,6 @@ struct path; /* UID/GID bit helpers - use linux/highuid.h */ #include -/* Attribute operations */ -#define setattr_prepare(m, d, a) ({ (void)(m); (void)(d); (void)(a); 0; }) -#define setattr_copy(m, i, a) do { } while (0) -#define posix_acl_chmod(m, i, mo) ({ (void)(m); (void)(i); (void)(mo); 0; }) - /* File operations */ #define vmf_fs_error(e) ((vm_fault_t)VM_FAULT_SIGBUS) diff --git a/include/linux/fs.h b/include/linux/fs.h index 07fe8c5e711..0f3e44214c5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -356,6 +356,11 @@ struct iattr { #define ATTR_KILL_SGID (1 << 12) #define ATTR_TIMES_SET (ATTR_ATIME_SET | ATTR_MTIME_SET) +/* Attribute operations - stubs for U-Boot */ +#define setattr_prepare(m, d, a) ({ (void)(m); (void)(d); (void)(a); 0; }) +#define setattr_copy(m, i, a) do { } while (0) +#define posix_acl_chmod(m, i, mo) ({ (void)(m); (void)(i); (void)(mo); 0; }) + /* writeback_control - defined in linux/compat.h */ /* fsnotify - stubs */ From patchwork Wed Jan 21 22:08:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1751 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=1769033451; bh=kM+SW5WGo14g+qu5iHISHwkS2xxIudydqzRRLXT59Co=; 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=DBiVhX06fDs6jecjP0xKvEyhgKJqAYt2As7nGmn0AcHUcEAL7o2wYxoz6ixT9HA2x RGUHy5kSzNm8SEjYK0KvFdspLhLdllFQzJ0QrALStfP/oWX1F3/UgL80H2W5vwvBKW KegElD143pZfZMau3nRMtrACjZn1SWTHM71ge7FoFAk/KZhOj4uPXW5QdXPj6Ql3/V L5Y4aX2vennQFIfPU9SAKqAlDtQ55iwKSjv53CHvN22fMd63l0eJCGJMiBd64gJ2V9 noo8KjTGrdW4BjhRnlMF9qnDgtBEpwJKW9Sr8dxMJglLmC58m7tlUzkDLTZ+i3XlC0 m0MH84EGICTRA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BE0E5695F7 for ; Wed, 21 Jan 2026 15:10:51 -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 VKA8SptqfXR5 for ; Wed, 21 Jan 2026 15:10:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033450; bh=kM+SW5WGo14g+qu5iHISHwkS2xxIudydqzRRLXT59Co=; 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=ImaFzIwzbBK4XaxoPCfZe9U+9GlvaIOIl+SSSqVVAw93MnouIJzFnwjtV2bHxT/uS gLGxrIuxSeeDCbFX7seEavMd94Pxh/TSiCBYfRwwIzfozOqSoHYfj2+taaElKDaBeT wkS1IOEgxtGy9wgKT7Ab3ezoo03HczWwI8bGjiGKsJnMQ0u1sXl7L3YMs5kEnCUx86 2cv1bcewsZsie/5HIlZeFvk2UGReyVbYXD0QeOjyz8Cgcwh2CxsM2Kw6aA+KsuFfYn nHlPc429aVMT6w6xHB/FPan4iM+mRpHXA+gcwejVDpURx/Jm0qvV5LJYFeZDy3wQBf F6T/hi8I8tpfA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B2292695FB for ; Wed, 21 Jan 2026 15:10:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033448; bh=GlFcRKiJT0l1Lmdss32RUwq0LQ+0EPB1L0JmFT6T70w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bqBJSADxDeZVqYjr2adhpIzyXpf1MCQlA7I71Ur7wq5O03W12PGfR66UbR9Ig9xHH 1mlLeFG57o+/ES83DSI5dkLORTqIqBbcSXIwadaOqAjt2Tx+qttEP1/hPh1BTsoSvp rDb5Op8/LKlVZ350fyEXDSXolQGN+R0w9LU3nMNXQ4MCDPasxlhHENVPTV0p75qzTc N5u2hLgsMLV0QU8bWyjTFCjKA1Luu+GLFlOuQnFYm5pkRTp+3fEuKjKE0BDb3PJyyp i5fT6Z984R6615RidoIQfVJQIScZpNxeG6ylfnotm0PEwxt5VQB0ek62slJVE93IMB kpkp/bongYbgA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 96F8D695FB; Wed, 21 Jan 2026 15:10:48 -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 bUC8-MrSa-3H; Wed, 21 Jan 2026 15:10:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033448; bh=Tw3qnn5p0K6eIbuUjxoEZKQTpra8mCvGDUs8t1WGMbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SOezGcdB+sdUKLikXbuoqYUdYRSBtjCWo7R96BRSXhgiG4mgxQ5hugx1mjHKXooHO 9IXmqdMXeKI7n1PkPR87Vv/35YEIHcMCioTV+iIYfzzeqU+73/EmqsbOckXhrFOUmb 9vQjXdJqBP+MoRMkA28zFDDOKZbIMbdGd0pg1taL5d32SXRALSU5nyEIJHv0xK9Gss 5jlbRK4Rvc4hoIEiWGN7MTsRrsEufDHZWsXumzWKQmi9BJlHzNuVAXXtANxb53uLlO yyyWe6PGGion6HPwZ9FwyMVxnDtlSd3e6u357hGnCqUI8feHxRblbk6+ZbGIjqJPWK 0vesWy17mLPKw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 231E2695F7; Wed, 21 Jan 2026 15:10:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:38 -0700 Message-ID: <20260121220857.2137568-26-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ALHNKPTWHJKM45QYWAVSRYNAREJRVRIS X-Message-ID-Hash: ALHNKPTWHJKM45QYWAVSRYNAREJRVRIS 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 25/33] ext4l: Move finish_open_simple() and ihold() to linux/fs.h 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 Move these filesystem helpers to linux/fs.h where related functions reside. This reduces ext4_uboot.h from 435 to 431 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ---- include/linux/fs.h | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 9ddd88d78aa..8d1aa0e504e 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -196,10 +196,6 @@ struct path; /* hash_64 - use linux/hash.h */ #include -/* Dentry operations are now in linux/dcache.h */ -#define finish_open_simple(f, e) (e) -#define ihold(i) do { (void)(i); } while (0) - #include #include diff --git a/include/linux/fs.h b/include/linux/fs.h index 0f3e44214c5..5b865715d51 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -570,12 +570,14 @@ int inode_generic_drop(struct inode *inode); struct inode *new_inode(struct super_block *sb); struct inode *iget_locked(struct super_block *sb, unsigned long ino); void iput(struct inode *inode); +#define ihold(i) do { (void)(i); } while (0) /* Block mapping - implemented in ext4l/stub.c */ int bmap(struct inode *inode, sector_t *block); /* Simple filesystem helpers */ #define simple_open(i, f) ({ (void)(i); (void)(f); 0; }) +#define finish_open_simple(f, e) (e) /* simple_get_link - for fast symlinks stored in inode */ struct delayed_call; From patchwork Wed Jan 21 22:08:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1752 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=1769033454; bh=4ydvfayrO4nxa91joSiOYSIpIfmB+7RnT9Tlu9wnlqs=; 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=vN0gD04PJYd23j3NoDuET0K+pYOC5xOD2WNiitpzl7Gb0WLhh+i7PU/nS8G9dLRH0 L9BcEwGrqoG+JtU/QihyO1e73aEqh3NYdZ36TOQMLZYqwwVf92yCZhGRAXokgfpCmE Jhjn4LbXUaG+xo58qdSufFeAZZAjud/osxQaXKTLwRG4tqrsE8aDAGe9RHeNIucfxF DvrGBPyDdTsOed3HKEpzJcj04wYgT0TWcT0xHZLKKSt2Plr/qxDuuPzli6eg/O+x0U Cjt18ohLK9/RMadlEffYSVOfKrCqkLub9JGW7dsGMiAjpqXyW0dyObxSP2cbfAcFOJ 4PDWrOkM1gnMA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0A88669601 for ; Wed, 21 Jan 2026 15:10:54 -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 V1wWFm1rJPxO for ; Wed, 21 Jan 2026 15:10:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033452; bh=4ydvfayrO4nxa91joSiOYSIpIfmB+7RnT9Tlu9wnlqs=; 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=uCI9iwf1T1fmQMvy/HsTvGl9baraqKy9odmFYms2suotmeEotCGmKJHurcb0okuBI Hv+xYxoF4rqNd7CQR8Tn8fbHvXM7aVn4DQhUZbwB0jNS77VYKEKpG1DYAIwTcaD+r7 cMjZ75YfTIDmfOn4TQWd88XyETVIvc2JXRxu8Qg5aRprQUivnWzd18VQxfkTSG/dCj FswSPLrXXKPD1StucKg1+NxCU6gbm/WvfHxqelpdEQn+bGTPm00/Lcu7qoS4jO6ZIj JWkORI4bYPZ2iP7QuhTtmPX+o6NaA7o72qQx1ZW0CjpVh6HEQMY5fxwjcIBLWJnqVx U1MWXLQmy2FBA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6F15C695F7 for ; Wed, 21 Jan 2026 15:10:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033449; bh=3i42E4dTNxsftPHA2JHUrAyPbDRzj0JBSaroEIEYEzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CSbDuhkJl1jmDJSBer7cvwwG/LHrYWWw7JnKxFsW9NiY1k1mmHJEDm1zz3CNpnwQF ddWCwz1/blYihtZQs8o1lCxpq43dLfk2sh7sggTSuXIHZ9yz5s/Xzj41GwOYqZTkl3 Cy+HpvsPI7sxgTyLeAbNa7wIvMNZ1j+DvuTSDzW0wdGo/UGe8WgA/VRZ/+Vu1cOtLb 9O2vsgMjALPc3evl2tnhNSKAwwulr2196DQ4nQwCqaOe6Dop0ai2EUD802DAnPZGA2 4dfZ+9apczRBtrbF8yV7heUcoLseQWxXOR+4v0wbRKwO3ZtyFzKX87TPqdk3CEG0ii 2c1jvrXkh4M6w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6B52F69601; Wed, 21 Jan 2026 15:10:49 -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 CaelumBA3QGx; Wed, 21 Jan 2026 15:10:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033449; bh=R/cMCwM1Piln7qnJBVWO4kbtRG5xPRo8yHDj2GfZGks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XRmKM9Hbf2w1b5GGegr3OiKgZdyg4CQHYRHy/Oszz4t4YDYvX7u3mPqt0cYGh/LdV jXlIeItPrQR/47n49TLvWa8Kzj5tIeMd+4bog03kPX5w2etNFvzZ87ze7hmiFluEfV 905/zlN9+l2KYjLSpnYK7ZCFl0zkb4Nidk3bY9ZQhss981NGf4Ou4Pq8XwWOz4VLAw V1axml51sIimS7NNEjuZaTxhBWn4GuRi/MwsGBz3Euu039S22pwEVAmliduuew80VW HnoY+KzkxOckf5kNGX1510cvX9ExC6hi8VO9DcCL1hYjxMvaLEoCPMXnkwM/KeF95D Vqh6f63rsyaUg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DBE9E695F2; Wed, 21 Jan 2026 15:10:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:39 -0700 Message-ID: <20260121220857.2137568-27-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JY4QTYQUJTSSL7WJ4G7BTHXCV5VV2SHN X-Message-ID-Hash: JY4QTYQUJTSSL7WJ4G7BTHXCV5VV2SHN 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 26/33] ext4l: Move nd_terminate_link() to linux/namei.h 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 Move this pathname lookup helper to linux/namei.h where it belongs. This reduces ext4_uboot.h from 431 to 425 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 ------ include/linux/namei.h | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 8d1aa0e504e..4e8c2199800 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -223,12 +223,6 @@ struct path; #define kfree_link kfree -/* nd_terminate_link - terminate symlink string */ -static inline void nd_terminate_link(void *name, loff_t len, int maxlen) -{ - ((char *)name)[min_t(loff_t, len, maxlen)] = '\0'; -} - /* * Additional stubs for super.c */ diff --git a/include/linux/namei.h b/include/linux/namei.h index 7b66fb242d6..10ea86dc49d 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -23,4 +23,12 @@ #define LOOKUP_EXCL 0x40000 /* Exclusive create */ #define LOOKUP_RENAME_TARGET 0x80000 /* Rename target */ +#include + +/* nd_terminate_link - terminate symlink string */ +static inline void nd_terminate_link(void *name, loff_t len, int maxlen) +{ + ((char *)name)[min_t(loff_t, len, maxlen)] = '\0'; +} + #endif /* _LINUX_NAMEI_H */ From patchwork Wed Jan 21 22:08:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1753 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=1769033459; bh=qmNg4+l/Ab+vB5NZByObsPdwemufcowJ108v8mludT0=; 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=aBtK5g+b4+F2HdUDFBV7BEJalBVO092VyD1O3y0Y5sFOFAYs+etAbr8IgaxclqNRt dUdRXh4VZEU2MYkkFcXJ/fBOn5gbgqVHKRN3SXKXZUad6qPYdw71WdmUadskkVklr+ 7WiEavXZDSQM+Zd/OhevgMI52jQq3lvRdFaq8YJzp4bg1CY31PxuOrNz4tX1Iiukvk OF3wWa8LjPSzcvFrgvv3utRBZRGXfej2h9PpXpspDqoAdxS4/UBYMKaA3cXjM+aMZY hkQEdVWGMjOQEqHJCE9LWnPrxA0NpF+8hJ3JeGLm08MEZfO7T6dzZcO2N4/dE9qqg9 0GvF7SYi14/ug== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 026D969611 for ; Wed, 21 Jan 2026 15:10:59 -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 ukTes20FrOvt for ; Wed, 21 Jan 2026 15:10:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033458; bh=qmNg4+l/Ab+vB5NZByObsPdwemufcowJ108v8mludT0=; 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=sIZkcJW5A4ZBa1Wir05G0yhkxQEGEYHVQn7CQoFnOv7fV3IQEOxrqHXMjPxvAYGCV MsQVAiYnhlEThT9NhLdSmpJWwYYjp2LgMu9vMIzOwxnLBsDj+hiahGkW9oSGg9ZmHY TAYW9Tu3Y8t5qZYFslTlpRW5pUH4A+9JeVHZHnU08csbnTjjBRevXyqyRO+HuplV/R QTWSR80xxlCPrCpJsEtMrN6OdzVIJZ+N3b6vzaKnuZ7IFvfvPXLU5wTdrAJiie/sVE uPbZ2bRyKp/2iyLB2ikGp2ziEyZHHj7rfGkzfiTIcvl2NCo7TO2bdn3m6VIo0kefiW YDYKmZ2IwygoA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E4DC469601 for ; Wed, 21 Jan 2026 15:10:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033456; bh=TDBQvH17ljKZznT+GBa2iw2RioVl1no8ocRogFu6fV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9FP1E1EeOwB4GmIYIScM9vG5SPOc6aqDgrxmwX6KOXcRmur40SLhUPFPtSIXrblp Tc/+ouLFK2BujyUGFHpHzV7Bwbqx+fME3FIMrcdrg3bZTwqaqjH/FF2C2wSSClXVuK hxeZFccj39aFETkxUzwkn9iMxGd0VA7lxQyYvgWyW2PGGwKl5HsW7MhS//rfjTntkc enN9rAnerLIHHoDGbDFc1vtMT/0MTxgYhooCGLeW0lrhOPnoc8gSa/s0rpNJSHO31Y ADTGKk0/fwjIrPXIU/K5MFk8jQh8zVArj6xSlvmkjv8dZgpBABgd0io6Ba/3BRmgYH HxfcZNulQ61rg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 52FF2695F2; Wed, 21 Jan 2026 15:10:56 -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 mQObfDZytYbG; Wed, 21 Jan 2026 15:10:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033449; bh=ZHTQWGCgg6ge1HWoV8zZoHufGGbIxFDg4Hq2XJvKPYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vF1ySzjdCikN+vjHJ/uiEGCjYSThrl7fNeP6SkXI80uURr4iqA9PGleKLgeonSDiN 0Vce+jD1S9bbyhl0mmu46+/HtmX/rL9F/Y1ddjOSHfkIWaX1KY+cH9NZvuEshdpuCR Ub8fWg3c03YNdMfpU4naTaYGFt6ay6bA3WMvtRst6oJLWPovC0rYo2kjZr/ogP5PXP ho3okRYUkFqWXD0apCTOMwN1FsJFP/W1OuOHNYWPH32DMyA6NiK/3raFuzJiBUpNor w9gM6beGFuo67kPMPmJppcn0X87/Qh318OBg8V+AuxEiEonQED433mtfhsA0KmGFta V7+ClhWlK0wEQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A993E6961F; Wed, 21 Jan 2026 15:10:49 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:40 -0700 Message-ID: <20260121220857.2137568-28-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TSNQDUMCRUMERDVBPT3KVGBUTKNT5VLM X-Message-ID-Hash: TSNQDUMCRUMERDVBPT3KVGBUTKNT5VLM 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 27/33] ext4l: Move blk_holder_ops to linux/blkdev.h 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 Move the blk_holder_ops struct definition and fs_holder_ops to linux/blkdev.h where other block device operations reside. This reduces ext4_uboot.h from 425 to 420 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 ------ include/linux/blkdev.h | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4e8c2199800..6f8c78bdeb0 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -269,12 +269,6 @@ void ext4_unregister_li_request(struct super_block *sb); /* I/O priority classes - use linux/ioprio.h */ #include -/* blk_holder_ops for block device */ -struct blk_holder_ops { - void (*mark_dead)(struct block_device *, bool); -}; -static const struct blk_holder_ops fs_holder_ops; - /* end_buffer_write_sync - implemented in support.c */ void end_buffer_write_sync(struct buffer_head *bh, int uptodate); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 89d284dab26..1ee5b33da72 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -83,7 +83,10 @@ void invalidate_bdev(struct block_device *bdev); unsigned int bdev_max_discard_sectors(struct block_device *bdev); /* Block device file operations - implemented in ext4l/stub.c */ -struct blk_holder_ops; +struct blk_holder_ops { + void (*mark_dead)(struct block_device *, bool); +}; +static const struct blk_holder_ops fs_holder_ops; void bdev_fput(void *file); void *bdev_file_open_by_dev(dev_t dev, int flags, void *holder, const struct blk_holder_ops *ops); From patchwork Wed Jan 21 22:08:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1754 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=1769033461; bh=TWQb57cqvUNHt2vpPsV2zwg0l0lNObUcVPtA6TAQLRA=; 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=QfaQzYw0J55nTlyCMeVCK6Byh3gd+o/nYYe9zUDn5GLuyoi3z3rM6Bm/NRmWaGgIv 9Yzv//pd4Wejjv2w267ufWYmzi89IQJTYF1l2BdHBfBA9aLCDI7cFmt5S8iOzTjbSk 0P4quSK/F5osYcOx/1lSAMv+Rbaz60/k9+WgvaPewm1XDILUtHgVVkhttmwx/8uLMs wOVCKCtTDoW/IQOoO5JDG5spgTRCIcFylqW4FP82us/wji360klJ0LBGvEWnCkbyXb XUtcaM+IHJDN+dr6BCMEIb3WsH5YiUWEOeWlaLwr+Unb35Q46li6gfUc3Nl33yI3GR 0rdI/mw6ZljXA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6DDE669605 for ; Wed, 21 Jan 2026 15:11:01 -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 HH-V3DLP6ZWH for ; Wed, 21 Jan 2026 15:11:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033461; bh=TWQb57cqvUNHt2vpPsV2zwg0l0lNObUcVPtA6TAQLRA=; 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=QfaQzYw0J55nTlyCMeVCK6Byh3gd+o/nYYe9zUDn5GLuyoi3z3rM6Bm/NRmWaGgIv 9Yzv//pd4Wejjv2w267ufWYmzi89IQJTYF1l2BdHBfBA9aLCDI7cFmt5S8iOzTjbSk 0P4quSK/F5osYcOx/1lSAMv+Rbaz60/k9+WgvaPewm1XDILUtHgVVkhttmwx/8uLMs wOVCKCtTDoW/IQOoO5JDG5spgTRCIcFylqW4FP82us/wji360klJ0LBGvEWnCkbyXb XUtcaM+IHJDN+dr6BCMEIb3WsH5YiUWEOeWlaLwr+Unb35Q46li6gfUc3Nl33yI3GR 0rdI/mw6ZljXA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 59464695F7 for ; Wed, 21 Jan 2026 15:11:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033458; bh=86dYRkVPnWLApHq7V+KZrJl/bwPq54GnbQNPR4lf1PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EevHBrfwLOF2DOThdr3n0+jX7EqVLJeNEeglstAIS7yp9Hhn2sUVDUHm2skzGfmdu R02xT+00A1hkEqT+ayxSm5YREroJnvWAzJ64w/sVSJD0p9EhTomVa0pmmQhwpCx/Ou RrsCdPoiiEqj9ruQ2QfCB/Ovdx55uIE+pZgwfWdkqI/9SYsF+iHtmfmJNWykxJPPH7 tpc5/WLcNyRHDfTC3G/GIQiyw4kbJWtQ2LdK8Vevj/vwkZBEgDz5Ze0E32pp43ZY53 kKmTYZbWwhkPfHnBy9weSdfQPARbSPBxljsUkAlDZgji0eZc3vCSmhU5MKHzGk3BiK Ksx2GvfZq9zIg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9D2EB695F2; Wed, 21 Jan 2026 15:10:58 -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 t3M_XeXw-KAe; Wed, 21 Jan 2026 15:10:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033454; bh=HMVycO8k3NnmcRbaguwI9qi25sTuzW+Hki8mW1lRwAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ob8oO5oC/TpKk/u5D/6WGoSM3+/ZZwzHn8ZmAmKQjHGGF3PmqdwUPS+yi9HAO5EO1 q7Oss4IXfJawTkXXX+88NQaaLCQVNMnHP4X/nbuO+z5XKr+vepQNFyZFBho5853bYN 6UXPjQRb+QcLBVCaDWrm+MahYfrXtx++y08RAjak6+5BhTtDizdjSPK0fL7PkyQlbA EIH00gmPoEsv7miDPERjh3yW6xvm3o0JEuf8KWBzOrDhV1QzTmmpK2UpxrNYVMLFQ2 QZYlNtOZkOkjeH1X7D1bzC0yiJSvpCvECgjRQGt91X3GfR1Sf1XhXWtTGVHXtdOVzJ GPr33jJLydwhA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 466E169621; Wed, 21 Jan 2026 15:10:54 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:41 -0700 Message-ID: <20260121220857.2137568-29-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: K4HU7JEKO773Z3CCKEGVWSGFJZWHHPUM X-Message-ID-Hash: K4HU7JEKO773Z3CCKEGVWSGFJZWHHPUM 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 28/33] ext4l: Move more stubs to standard 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 Move definitions to their canonical Linux kernel locations: - vfs_setpos(), FS_MGTIME, BLOCK_SIZE to linux/fs.h - vmf_fs_error() to linux/mm_types.h - down_write_nested() to linux/rwsem.h - pde_data() to linux/proc_fs.h - memalloc_retry_wait() to linux/sched/mm.h - raw_cpu_ptr() to linux/percpu.h - prefetchw() now via include of linux/prefetch.h Also fix linux/prefetch.h to use expression form ((void)0) instead of do-while(0) statement, as list.h uses prefetch() in comma expressions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 27 +-------------------------- include/linux/fs.h | 10 ++++++++++ include/linux/mm_types.h | 3 +++ include/linux/percpu.h | 1 + include/linux/prefetch.h | 4 ++-- include/linux/proc_fs.h | 1 + include/linux/rwsem.h | 2 ++ include/linux/sched/mm.h | 3 +++ 8 files changed, 23 insertions(+), 28 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 6f8c78bdeb0..5c6a8711a9f 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -156,13 +156,8 @@ struct path; /* QSTR_INIT and dotdot_name are now in linux/dcache.h */ -#define vfs_setpos(file, offset, maxsize) ({ (void)(file); (void)(maxsize); (offset); }) - #include -/* Memory retry wait */ -#define memalloc_retry_wait(g) do { } while (0) - /* indirect.c stubs */ /* ext4_sb_bread_nofail is stubbed in interface.c */ @@ -206,9 +201,6 @@ struct path; /* UID/GID bit helpers - use linux/highuid.h */ #include -/* File operations */ -#define vmf_fs_error(e) ((vm_fault_t)VM_FAULT_SIGBUS) - /* * Additional stubs for dir.c */ @@ -272,12 +264,6 @@ void ext4_unregister_li_request(struct super_block *sb); /* end_buffer_write_sync - implemented in support.c */ void end_buffer_write_sync(struct buffer_head *bh, int uptodate); -/* File system management time flag */ -#define FS_MGTIME 0 - -/* Block size */ -#define BLOCK_SIZE 1024 - #define EXT4_SUPER_MAGIC 0xEF53 /* blockgroup_lock - use linux/blockgroup_lock.h */ @@ -326,16 +312,10 @@ int sync_filesystem(void *sb); #include #include -/* pde_data - proc dir entry data (not supported in U-Boot) */ -#define pde_data(inode) ((void *)NULL) - /* DEFINE_RAW_FLEX - define a flexible array struct on the stack (stubbed to NULL) */ #define DEFINE_RAW_FLEX(type, name, member, count) \ type *name = NULL -/* raw_cpu_ptr - get pointer to per-CPU data for current CPU */ -#define raw_cpu_ptr(ptr) (ptr) - /* * Stubs for page-io.c - bio types are in linux/bio.h */ @@ -347,8 +327,7 @@ int sync_filesystem(void *sb); #include -/* prefetch operations */ -#define prefetchw(addr) do { (void)(addr); } while (0) +#include /* * Stubs for fast_commit.c @@ -396,10 +375,6 @@ struct disk_partition *ext4l_get_partition(void); * Stubs for move_extent.c */ -/* down_write_nested - nested write lock acquisition */ -#define down_write_nested(sem, subclass) \ - do { (void)(sem); (void)(subclass); } while (0) - /* PAGE_MASK - mask for page alignment */ #ifndef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE - 1)) diff --git a/include/linux/fs.h b/include/linux/fs.h index 5b865715d51..2fa12a40aa7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -412,6 +412,16 @@ static inline void inode_init_once(struct inode *inode) #define SB_FREEZE_FS 3 #define SB_FREEZE_COMPLETE 4 +/* Filesystem management time flag */ +#define FS_MGTIME 0 + +/* Block size constant */ +#define BLOCK_SIZE 1024 + +/* VFS position helper */ +#define vfs_setpos(file, offset, maxsize) \ + ({ (void)(file); (void)(maxsize); (offset); }) + /* fallocate() flags */ #define FALLOC_FL_KEEP_SIZE 0x01 #define FALLOC_FL_PUNCH_HOLE 0x02 diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 57a52769b05..1d1a0fcd6c1 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -44,6 +44,9 @@ typedef unsigned int vm_fault_t; #define VM_FAULT_NOPAGE 0x0010 #define VM_FAULT_LOCKED 0x0200 +/* VM fault error helper */ +#define vmf_fs_error(e) ((vm_fault_t)VM_FAULT_SIGBUS) + /* Maximum order for page cache allocations */ #define MAX_PAGECACHE_ORDER 12 diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 3aa71c1451f..969cf152a7c 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -17,6 +17,7 @@ #define DEFINE_PER_CPU(type, name) type name #define per_cpu(var, cpu) (var) #define per_cpu_ptr(ptr, cpu) (ptr) +#define raw_cpu_ptr(ptr) (ptr) #define this_cpu_inc(var) ((var)++) #define this_cpu_read(var) (var) diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h index 4b9bbfbe7e9..c62da091eba 100644 --- a/include/linux/prefetch.h +++ b/include/linux/prefetch.h @@ -11,7 +11,7 @@ #ifndef _LINUX_PREFETCH_H #define _LINUX_PREFETCH_H -#define prefetch(x) do { } while (0) -#define prefetchw(x) do { } while (0) +#define prefetch(x) ((void)0) +#define prefetchw(x) ((void)0) #endif /* _LINUX_PREFETCH_H */ diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index ba674440c44..572ed2759bb 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -34,5 +34,6 @@ struct proc_ops { (struct proc_dir_entry *)NULL; }) #define remove_proc_entry(n, p) \ do { (void)(n); (void)(p); } while (0) +#define pde_data(inode) ((void *)NULL) #endif /* _LINUX_PROC_FS_H */ diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 7beaf5062ed..e3480b276b4 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -22,6 +22,8 @@ struct rw_semaphore { #define up_read(sem) do { } while (0) #define down_write(sem) do { } while (0) #define down_write_trylock(sem) 1 +#define down_write_nested(sem, subclass) \ + do { (void)(sem); (void)(subclass); } while (0) #define up_write(sem) do { } while (0) #define downgrade_write(sem) do { } while (0) #define rwsem_is_locked(sem) (1) diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index 7a105f768cb..956bbaf18a8 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -29,4 +29,7 @@ static inline void memalloc_nofs_restore(unsigned int flags) { } +/* Memory allocation retry wait - stub for U-Boot */ +#define memalloc_retry_wait(g) do { } while (0) + #endif /* _LINUX_SCHED_MM_H */ From patchwork Wed Jan 21 22:08:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1755 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=1769033465; bh=kteDcQEeJAUztP64Uc+0t/H0UXAvA+xxOYjYvSk6qEE=; 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=WsAy0Mckdo9n9vXv5SQ44Rk8yX/mcTKg2mcFPE4WXaPIY9eDsIuM9T7w3EPh1K5L+ KRLwWLHPR2XPO74+L5474R269rTAkTNCW7ncNhXUNyznrKWwNMJOtlvAZm1OS9kEMA 2SSezUC5hBr+xXYsWNoXuyDT/HuuBgLCzVMekdLvCv1PEqtIoGH7vTimozobxtoaWN sm5hfYlDNExuLhI0KyTBmXBIYqDmT1IlhcuI6Pw3AxTwOcIGMRCfLq0hQS/M6GatW2 zqN0wu23T6q05URRcEjGP28jZY1Xtpe0ElgpkQPvBo/TYcUEwbQC2vxLoQxnsofqVc BuyvwNSuyKtaQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DE1C369605 for ; Wed, 21 Jan 2026 15:11:05 -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 A22DjD-s-V1k for ; Wed, 21 Jan 2026 15:11:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033465; bh=kteDcQEeJAUztP64Uc+0t/H0UXAvA+xxOYjYvSk6qEE=; 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=WsAy0Mckdo9n9vXv5SQ44Rk8yX/mcTKg2mcFPE4WXaPIY9eDsIuM9T7w3EPh1K5L+ KRLwWLHPR2XPO74+L5474R269rTAkTNCW7ncNhXUNyznrKWwNMJOtlvAZm1OS9kEMA 2SSezUC5hBr+xXYsWNoXuyDT/HuuBgLCzVMekdLvCv1PEqtIoGH7vTimozobxtoaWN sm5hfYlDNExuLhI0KyTBmXBIYqDmT1IlhcuI6Pw3AxTwOcIGMRCfLq0hQS/M6GatW2 zqN0wu23T6q05URRcEjGP28jZY1Xtpe0ElgpkQPvBo/TYcUEwbQC2vxLoQxnsofqVc BuyvwNSuyKtaQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CB10F695FB for ; Wed, 21 Jan 2026 15:11:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033463; bh=NqH6NqYOOQql3rKKr1a4YrRXtzAVHGTOoTROwHzav0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gfN018968fIBv39Q37uDbFljZoMn6Na7X2yGQIbpIuGYUQy/wLIG/sSx3tC9z83NN tflXgIfgDpnR0P4ClLMx3Pjiv7MzHlAjoA/5wI6HMpnJ6SkoGfDjHZgVISaUxAgONB Ec8QVW1xY46BJK2RbWlrRYJWoyG6kHBdMNcmC+Mer04K0WnlcR//ohwMllJA9z7E5c jAQOZIdqhniJ4e10omnWEXsHOAQMRggmyoo4SGlAj/BRINTogqJH2xYaEXA/4OpkPU MZoSgtQWyK//ogipqcY5kCMxlcnAeTATxOrJ88X/+gvBiOfUJZErd9IOFs24AUaO1a ALZyq5+V6XgTQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CD112695F7; Wed, 21 Jan 2026 15:11: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 10026) with ESMTP id IT6vPC75dVQE; Wed, 21 Jan 2026 15:11:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033459; bh=ltx/uJftz6hyUDXFNwfEN64oEH1K2INVyP3W1qZwESE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FLUSzavHUWS8BCiqXnA/d34WbVgXsXJCsOmH6uTsc54ED9otFW/4mChlGAlrqnk2y xOdtLqmhktBZ8n/mHU6RMFuzc7rdy2X5S0fVLdyFib5LuWmQxwseWuj1/rvmORyTOZ bWlKFByruHVzJQ79Z5pFuWM1x8+d0rADsGvS3jXKZe6PScEw40ohc6AUmqQf4VEEFr BUGIOWTbBtL16mtvvH5wBKoe2MPdKaJrLOBXt2KCn+6Sbv8oJD/640tIGS+Y274gIn NrnZ6kg+Nx+DkqSMv0K5YquP5iYLhDIrnvQVy3O6QvtIaBO4CpbKnfb+33mUpAb5AU rMKcH+t3cLxRA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DB494695FB; Wed, 21 Jan 2026 15:10:58 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:42 -0700 Message-ID: <20260121220857.2137568-30-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PGS4F6QB3G5575OXOYRSIWJCWD56R64Z X-Message-ID-Hash: PGS4F6QB3G5575OXOYRSIWJCWD56R64Z 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 29/33] ext4l: Move WHITEOUT and usercopy stubs to 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 Move definitions to their canonical Linux kernel locations: - WHITEOUT_DEV and WHITEOUT_MODE to linux/fs.h - kmem_cache_create_usercopy() to linux/slab.h Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 ------- include/linux/fs.h | 4 ++++ include/linux/slab.h | 2 ++ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 5c6a8711a9f..a7c7abf30b8 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -151,9 +151,6 @@ struct pipe_inode_info; struct kstat; struct path; -#define WHITEOUT_DEV 0 -#define WHITEOUT_MODE 0 - /* QSTR_INIT and dotdot_name are now in linux/dcache.h */ #include @@ -283,10 +280,6 @@ void trace_ext4_error(struct super_block *sb, const char *func, unsigned int lin /* DAX - declaration for stub.c */ void fs_put_dax(void *dax, void *holder); -/* slab usercopy - use regular kmem_cache_create */ -#define kmem_cache_create_usercopy(n, sz, al, fl, uo, us, c) \ - kmem_cache_create(n, sz, al, fl, c) - /* Memory allocation - declarations for stub.c */ void *kvzalloc(size_t size, gfp_t flags); #define kvmalloc(size, flags) kvzalloc(size, flags) diff --git a/include/linux/fs.h b/include/linux/fs.h index 2fa12a40aa7..69178235141 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -397,6 +397,10 @@ static inline void inode_init_once(struct inode *inode) #define RENAME_EXCHANGE (1 << 1) #define RENAME_WHITEOUT (1 << 2) +/* Whiteout device - used for overlayfs */ +#define WHITEOUT_DEV 0 +#define WHITEOUT_MODE 0 + /* Superblock flags */ #define SB_RDONLY (1 << 0) /* Read-only mount */ #define SB_POSIXACL (1 << 16) /* POSIX ACL support */ diff --git a/include/linux/slab.h b/include/linux/slab.h index 628126e0a3b..6722450a5cc 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -126,6 +126,8 @@ struct kmem_cache { struct kmem_cache *get_mem(int element_sz); #define kmem_cache_create(a, sz, c, d, e) ({ (void)(a); (void)(e); get_mem(sz); }) +#define kmem_cache_create_usercopy(n, sz, al, fl, uo, us, c) \ + kmem_cache_create(n, sz, al, fl, c) /** * KMEM_CACHE - shorthand for creating a named kmem_cache From patchwork Wed Jan 21 22:08:43 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1756 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=1769033471; bh=HeB3Cu/Qsp6GG6hanhwOiM09Q2TvANGPtU+OFfjsKM4=; 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=lkkix0S/DXBEiC02Q2LCefj7VDaZAzw/lEfTKDu7KClNHyGTQYU66aBSDJSxvRhQe 7lBTKU3NFPSedGsP2lWz+497c+Rhw/nhxJYrs4LlGscB6897GHoLU3GwcTuDf5dR3c P8oX+u2Eg47fxOZa41nQzUryOPSCUYHYp4biI3OI+LWmM+1/yQn1ZADRTav0KraZig PY3RGs5Mu/1DRX02c0Ervnk55pA0yejBvHQTtf17puKYpg3ytzFHVsqwoZ3k2hjd5y onr6MU7L+giAUXmHXYoiCbNlnqJkqRz47PAx9M+hFO7WEVHDVqZjOQDt07iiWKqcOm WO/tc7L9jN1LQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C00F269601 for ; Wed, 21 Jan 2026 15:11:11 -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 rYLE3H_51V1B for ; Wed, 21 Jan 2026 15:11:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033471; bh=HeB3Cu/Qsp6GG6hanhwOiM09Q2TvANGPtU+OFfjsKM4=; 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=lkkix0S/DXBEiC02Q2LCefj7VDaZAzw/lEfTKDu7KClNHyGTQYU66aBSDJSxvRhQe 7lBTKU3NFPSedGsP2lWz+497c+Rhw/nhxJYrs4LlGscB6897GHoLU3GwcTuDf5dR3c P8oX+u2Eg47fxOZa41nQzUryOPSCUYHYp4biI3OI+LWmM+1/yQn1ZADRTav0KraZig PY3RGs5Mu/1DRX02c0Ervnk55pA0yejBvHQTtf17puKYpg3ytzFHVsqwoZ3k2hjd5y onr6MU7L+giAUXmHXYoiCbNlnqJkqRz47PAx9M+hFO7WEVHDVqZjOQDt07iiWKqcOm WO/tc7L9jN1LQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ABD9E695F7 for ; Wed, 21 Jan 2026 15:11:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033468; bh=c5rjPkEXQi6WC8NwjWNFJCednsGn5GnRZ3jEnSZmJyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R/yheWlLoI8GX+5Td/j3mKTuhkcoGR771nW5bujbhw18vpFzd/T7eZJ3DvApe8jqr SNfTtB2dm4Tlyc7Cb2S9XV9BV44DPzomNpeuJU7pe96Iw2za7Af4ElB0xVgUKfUFas uTwuAFuq2nSPQBd1QuddAAMsjtkeyXWYwYwVvvL96xJvqUkxDLslXsldzVL3w0LzNF 90YPoK7t9iVMkRvVIVxUqjBc0kTKxtTnHynTyZqDKajOSdo90BvhIMOraUHsV6Ee5z 6hJxc5uwTpAkhr5OVAyax6yBIq+MF1FoOEXhN6pryjD7wgK1M8wSRATpQYAC8/ZHfL TRBbPtMg7RC1Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0776695F7; Wed, 21 Jan 2026 15:11:08 -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 g-iTsWlxoDMm; Wed, 21 Jan 2026 15:11:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033463; bh=MorQlXKJcr1KZUuzZpgVoI3aVUxCczdQjDUdifU619Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hKTi3ZHjrTdxYM1/HE+x/gcLHLixFk8FY+PMxNOQ7W/1RUigdeIMRqnU018/QmMMS /B6Esdkk49ttJlMGV3VWbZPxY8IIWTuqkQgnFilBZddyLWyPoMQB7pyKH4SQgiAUw9 gQOcbUC5fOcjlFKxNy91Vlpm4sDectIC6vaCokaWjWw7Sya5mVVGCHhweyRconnFMu dMOl1nRAsqAKqjm++GOGsUhvGmFIXd6cVuopzPDZdXFkDfi05QKfPNay1s+5nvaEIp IijZTVLwGh8622DBzaOcWhZtA3sLFY14gL50tz8f6olhDUu3o6e3CHSYepYRUdrv2/ qIwD3Jkd2NqbQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7FE3D695F2; Wed, 21 Jan 2026 15:11:03 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:43 -0700 Message-ID: <20260121220857.2137568-31-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MKPWLX2AQLJ6MSL6U67MFXO736HYG3RH X-Message-ID-Hash: MKPWLX2AQLJ6MSL6U67MFXO736HYG3RH 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 30/33] ext4l: Move O_SYNC, S_NOQUOTA and kfree_link to 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 Move definitions to their canonical Linux kernel locations: - O_SYNC and S_NOQUOTA to linux/fs.h - kfree_link to linux/namei.h Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 ----- include/linux/fs.h | 4 ++++ include/linux/namei.h | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index a7c7abf30b8..11d1d8b0d48 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -94,9 +94,6 @@ #include #define EXT4_FIEMAP_EXTENT_HOLE 0x08000000 -#define O_SYNC 0 -#define S_NOQUOTA 0 - #ifndef PAGE_SHIFT #define PAGE_SHIFT 12 #endif @@ -210,8 +207,6 @@ struct path; #include -#define kfree_link kfree - /* * Additional stubs for super.c */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 69178235141..0d6da467026 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -387,6 +387,10 @@ static inline void inode_init_once(struct inode *inode) #define S_ENCRYPTED 64 /* Encrypted */ #define S_CASEFOLD 128 /* Case-folded */ #define S_VERITY 256 /* Verity enabled */ +#define S_NOQUOTA 0 /* No quota (stub) */ + +/* Open flags - stubs for U-Boot */ +#define O_SYNC 0 /* Permission mode constants */ #define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) diff --git a/include/linux/namei.h b/include/linux/namei.h index 10ea86dc49d..0b9000e8472 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -31,4 +31,7 @@ static inline void nd_terminate_link(void *name, loff_t len, int maxlen) ((char *)name)[min_t(loff_t, len, maxlen)] = '\0'; } +/* kfree_link - free a symlink target allocated with kmalloc */ +#define kfree_link kfree + #endif /* _LINUX_NAMEI_H */ From patchwork Wed Jan 21 22:08:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1757 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=1769033475; bh=k+dxP1ZEn024pm+ashlbxci78KzB894BJGzGuxBBCL4=; 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=YKCj9vE6cpwJWx5n/QcQOmV0RElqSUZiau80H7TfLU19ZCsfU9J5S2hM3OaP8zuLp G6yQTRCmqNJey03R9tLTzesN/i1M+DnMu+fspd9Sz5qCSjfs/BIKqDp/eAtUSrT7zl kjnaf7iM29OWFAXL87vNhETuTpDNDF5MDYd8GySRiRmb4lXmHd9mv1qnWt0zP/csG2 8ubOvmrpLrWl9gDS67ZyjRrd7rJG/85IN3oINg4k+J7B+q658fqW8wdhcooqJWRqtA /8vfrRsTz0HSPdSDhVma1NRM37bCkZA/TzsSkn2nd6kmtaaLkr44xnxiyUt6UkAuEU ZPniWVhyAYwIw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3D6CD69601 for ; Wed, 21 Jan 2026 15:11:15 -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 b1VDsyytvrBP for ; Wed, 21 Jan 2026 15:11:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033475; bh=k+dxP1ZEn024pm+ashlbxci78KzB894BJGzGuxBBCL4=; 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=YKCj9vE6cpwJWx5n/QcQOmV0RElqSUZiau80H7TfLU19ZCsfU9J5S2hM3OaP8zuLp G6yQTRCmqNJey03R9tLTzesN/i1M+DnMu+fspd9Sz5qCSjfs/BIKqDp/eAtUSrT7zl kjnaf7iM29OWFAXL87vNhETuTpDNDF5MDYd8GySRiRmb4lXmHd9mv1qnWt0zP/csG2 8ubOvmrpLrWl9gDS67ZyjRrd7rJG/85IN3oINg4k+J7B+q658fqW8wdhcooqJWRqtA /8vfrRsTz0HSPdSDhVma1NRM37bCkZA/TzsSkn2nd6kmtaaLkr44xnxiyUt6UkAuEU ZPniWVhyAYwIw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2CD7A695F7 for ; Wed, 21 Jan 2026 15:11:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033474; bh=7VbitzUmrdaJHbg9KL53WR0HTmuUnV8idK5OSTAd0w8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l0vKj/VS6XW40ngy85MSuI3c8t8fa+xnMdbZJ7yVGfhagy01JvreKWcqiZ6c7Ngoc 9Y1M41fihjRFHu1wrYcQa6cOZf7zIdwUjaPya4OHBvtZ7wDtJMv/fXr6xpVjDXSRTI /KvwTbMn3Koq18k0OLz6LF3ARAXBDHWyt6lQ/v8GiqrmhrpP2ewwjsdPCnEc8NTPTM kk4Gx/AVFBBtao6bu9JnRyeVea7f/yTlulR9tW7ERV1sTskE4V9pgTQAZRSP4AvlY6 tAiSfEHM3wE5EnTWD08tJ1Ajp2D4Qtg5ZZ7CyDnTZtqSdEZWeh8GL58b87czIfdhaA tWO1yb2qu18eg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2BE8E695F7; Wed, 21 Jan 2026 15:11:14 -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 C2Y_uWTBZsSD; Wed, 21 Jan 2026 15:11:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033468; bh=CWGyVcEqP7jWfeJqQsQTLRwGhlo0dbPFHZUIfFQgQIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=le+cd9TXsuWHi8Iq/yxcLwtSnAer7zUuQzeIb5xRG82nCB3+jBXJbY0kI5c7UxFQ8 IdiHZGfA7f90uUtMYy6zamZdLi5AoR78fRKVDcAd6NLbL6+WRBXF0O0nFNNiJK06q8 IPyK3F+XZwWue2uLadEVoWo0wnodH2qbl/GGfDehYvRWPJwjCUX2jhDZG9kho5MfC8 03RK40VeRXeeNJFgiv3NOglPWJcRUGX9edyqG1w0gjT4T/waKp9CDk/I2Lf/H7bA7u l1Tr8ToFF/DYVbQ4ycvznzsa3kImp89Q1XMBfXeppsifhZaWpilwLBleXGB6iOMyWW 95rG9w2LuJcGg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 57CBB6954C; Wed, 21 Jan 2026 15:11:08 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:44 -0700 Message-ID: <20260121220857.2137568-32-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 46V4UTP75REPNTAKLJN4W2ESUM6UBXJG X-Message-ID-Hash: 46V4UTP75REPNTAKLJN4W2ESUM6UBXJG 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 31/33] linux: Add PAGE_SHIFT and PAGE_MASK to linux/compat.h 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 PAGE_SHIFT and PAGE_MASK definitions alongside the existing PAGE_SIZE definition in linux/compat.h. This allows ext4l to use these standard page-related constants from a common header. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 12 ------------ include/linux/compat.h | 7 +++++++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 11d1d8b0d48..ad3e59a7f6c 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -94,9 +94,6 @@ #include #define EXT4_FIEMAP_EXTENT_HOLE 0x08000000 -#ifndef PAGE_SHIFT -#define PAGE_SHIFT 12 -#endif /* * BUG_ON / BUG - stubs (not using linux/bug.h which panics) @@ -359,15 +356,6 @@ struct disk_partition *ext4l_get_partition(void); /* init_utsname - use linux/utsname.h */ #include -/* - * Stubs for move_extent.c - */ - -/* PAGE_MASK - mask for page alignment */ -#ifndef PAGE_MASK -#define PAGE_MASK (~(PAGE_SIZE - 1)) -#endif - /* * Stubs for fsmap.c */ diff --git a/include/linux/compat.h b/include/linux/compat.h index df67b775b5b..9699f5274b5 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -90,6 +90,13 @@ typedef struct unused unused_t; #define PAGE_SIZE 4096 #endif +#ifndef PAGE_SHIFT +#define PAGE_SHIFT 12 +#endif + +#ifndef PAGE_MASK +#define PAGE_MASK (~(PAGE_SIZE - 1)) +#endif /* include/linux/leds.h */ struct led_trigger {}; From patchwork Wed Jan 21 22:08:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1758 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=1769033479; bh=pZ8baHfKGEHiDcm0dexJtNs8dAjobZD0nT5RFaJJLl8=; 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=jyru6Ob/aqz56GFODm9YmdChMM8ORCd3rm95LRjfcjkSjHKbRrqQPmDU992iVZFLd mwL61Jqy1rdcRKX9ZJ1AJPZMtHSqW5skUWccsNfxemObmetH+nbrd3Quqiz6FwJIQi YPXs8KyRvhZbAJ5aa8ARPDo8brM2o+c2iBOjP1cKdCJU9qp60iGxhliRYMf/LaBRSM ruDYedDrm9F5RHK0W3eWaeUPqVAYvPPXtPgiIN1V9JzhQULZmG1CxnqAMFg8LIqz3j zT7HQTJ/Nw/2p5WQnSYHrzIGi5crCnETwTlCbAzmpuqi88F9SMjKb36rbzNdoaeLQN uXVP39x+I5DOQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A732169601 for ; Wed, 21 Jan 2026 15:11:19 -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 PPlkVGmUqg9G for ; Wed, 21 Jan 2026 15:11:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033479; bh=pZ8baHfKGEHiDcm0dexJtNs8dAjobZD0nT5RFaJJLl8=; 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=jyru6Ob/aqz56GFODm9YmdChMM8ORCd3rm95LRjfcjkSjHKbRrqQPmDU992iVZFLd mwL61Jqy1rdcRKX9ZJ1AJPZMtHSqW5skUWccsNfxemObmetH+nbrd3Quqiz6FwJIQi YPXs8KyRvhZbAJ5aa8ARPDo8brM2o+c2iBOjP1cKdCJU9qp60iGxhliRYMf/LaBRSM ruDYedDrm9F5RHK0W3eWaeUPqVAYvPPXtPgiIN1V9JzhQULZmG1CxnqAMFg8LIqz3j zT7HQTJ/Nw/2p5WQnSYHrzIGi5crCnETwTlCbAzmpuqi88F9SMjKb36rbzNdoaeLQN uXVP39x+I5DOQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 960A6695F7 for ; Wed, 21 Jan 2026 15:11:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033477; bh=2ExnwQRNB3iLjBqXPYbSMcGLb9Fxcc2j9TUnke3O2c0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eA8ppvG7u0UMevLz8kMImgNoNywVzXMEVEdvH3XY1l/WuOAvweMsK8uqjn2EYWqZ2 Zaq2RvU8phFEMqgxQFRcoumQpsXkvSP9fA0FfwCW+N6yZbH5kXjHy8xtjTfvQMK4Oc N2BGYvs/Xrjwz59lAoPJplSIFhtz50ilN0HVicdC2Yfaokr6HYdlzPLQ8gbyCrH/7N Q3rhfa9N44qTFnjP5KwcuyaOU95gWdfMlnn3Rc4vxLiFNYXh6/8RY1pmpsB4fdI4Pe oVY+5C+VBjIh339xJi0l3PvBsfXI/Y9z1X1JrXpk48cy2PBuT3SpMIxNrCRTor7Vus G/5pdjy7snXJA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 98F456954C; Wed, 21 Jan 2026 15:11:17 -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 AhgMoUfQn3_L; Wed, 21 Jan 2026 15:11:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033473; bh=Na23soMcghw3Sre3QwX42HYW+IiDNfHG90uDiXSRIFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gbUXlguMcmzaXt3VTEoDQUzsHLBARPKF5RUSjO/0ErkiQ2+Y6Ez13CaY5CX11jIbq XnW168rETn81AeZ1fGQKhWq60GjeAVZPUoeEIBdq8RB52dG1xkGPNbNRz8mLFEABfR 1j4TsuYMHB7UkRb+ocrw6Z6MmEn2++ylzf3fLhrnI3+sZh9wX19MMOlfhfxW3wY0R4 7k7f1mhVmzXtf8l/5elzFDC/bO/OnATyMaiATdNPGYM33SscS6vgeh15TbKEwAkGTt WymVmK+whx0KFY8pIti6N1cS+o8n4A6wvcmhIWGjy7+PLwncsEmiSaEGQfSBd2QOM/ 5lo0vWoqxamQQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F1D2069490; Wed, 21 Jan 2026 15:11:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:45 -0700 Message-ID: <20260121220857.2137568-33-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: B3EGGSEKB3F2WJ64JWB3GCG6G57WBXA7 X-Message-ID-Hash: B3EGGSEKB3F2WJ64JWB3GCG6G57WBXA7 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 32/33] linux: Add DEFINE_RAW_FLEX to linux/overflow.h 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 Move DEFINE_RAW_FLEX macro from ext4_uboot.h to linux/overflow.h where it belongs alongside struct_size() and other size helpers. In the kernel this macro allocates a flexible array struct on the stack. In U-Boot it is stubbed to NULL since the code paths that use it are not exercised. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ---- include/linux/overflow.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index ad3e59a7f6c..04ed9c3c846 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -297,10 +297,6 @@ int sync_filesystem(void *sb); #include #include -/* DEFINE_RAW_FLEX - define a flexible array struct on the stack (stubbed to NULL) */ -#define DEFINE_RAW_FLEX(type, name, member, count) \ - type *name = NULL - /* * Stubs for page-io.c - bio types are in linux/bio.h */ diff --git a/include/linux/overflow.h b/include/linux/overflow.h index 672377ede42..75e8ad44ecf 100644 --- a/include/linux/overflow.h +++ b/include/linux/overflow.h @@ -20,4 +20,16 @@ #define struct_size(p, member, count) \ (sizeof(*(p)) + sizeof((p)->member[0]) * (count)) +/** + * DEFINE_RAW_FLEX() - Define a flexible array struct on the stack + * @type: Structure type containing flexible array + * @name: Variable name for the struct pointer + * @member: Name of the flexible array member + * @count: Number of elements + * + * In the kernel this allocates on stack; U-Boot stubs it to NULL. + */ +#define DEFINE_RAW_FLEX(type, name, member, count) \ + type *name = NULL + #endif /* _LINUX_OVERFLOW_H */ From patchwork Wed Jan 21 22:08:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1759 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=1769033483; bh=0DXaiiqmEcBBl5C492c1rvd+fUeacUtMqq0J9PjBWKM=; 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=WzdL3x74fHyTnPdKppI6ahPZf9U3kt6jQvWioiBBujdJbKyxm2LRV7T8QqALMGJh5 viqhvkmiG4yhvPqElXfXIPzfCmaW21mrD3dhUFN1kSVpdc4SbruMhi0Ozc2HaX4G3+ 6Nz9qAA89S5z/ncckMmrPSZBaJa82H3V8i5lm1mMnzdqekJpExWf+UrxJ0+Pjs7+5x 1Sz9aeZnGB6rEvfjSH3DP75QCr+sToohyYqHJG5CGDjRBnj6eYTbiPaV4Y/LtQ7/aD 9OYVbGPtRj5kv/ZxIU7eAKXZ6Ys4ZQy7dAi/X8WBXVV+L6nEcl3P18jE9ygFVWKBFa tS2u76rW8IKig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 926F569490 for ; Wed, 21 Jan 2026 15:11:23 -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 yQXR6I4Tkytm for ; Wed, 21 Jan 2026 15:11:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033483; bh=0DXaiiqmEcBBl5C492c1rvd+fUeacUtMqq0J9PjBWKM=; 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=WzdL3x74fHyTnPdKppI6ahPZf9U3kt6jQvWioiBBujdJbKyxm2LRV7T8QqALMGJh5 viqhvkmiG4yhvPqElXfXIPzfCmaW21mrD3dhUFN1kSVpdc4SbruMhi0Ozc2HaX4G3+ 6Nz9qAA89S5z/ncckMmrPSZBaJa82H3V8i5lm1mMnzdqekJpExWf+UrxJ0+Pjs7+5x 1Sz9aeZnGB6rEvfjSH3DP75QCr+sToohyYqHJG5CGDjRBnj6eYTbiPaV4Y/LtQ7/aD 9OYVbGPtRj5kv/ZxIU7eAKXZ6Ys4ZQy7dAi/X8WBXVV+L6nEcl3P18jE9ygFVWKBFa tS2u76rW8IKig== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7CBBF6954C for ; Wed, 21 Jan 2026 15:11:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033482; bh=7plm7lHhtTEXTtCCi0+rUnG+/FQiXaMnF4cz2RgjH+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Df83MKQTsx+F2zyBPHsjV8+09CNKzNtbX/34+MJvKEAImAS+PNqjTjaSL/SZBHsa7 hNlgOvnVaIHYkga+nslTq44lth1GlPNzzTC5rYERXtH+PZpjN1E+srjI037Z3p+7PQ owd2VgaSsSoVipWX6dhWOlDqTHsvWEsqJbm4mu7w4h0hWim4maRrVzG4idP549i8u0 lMrnc15Nk7az8m/UN60ckCdshTRIyaLMfzwJDMDqN03qr/MHm8CrSaRM3neD2Zud+U /dR9x4vIxwQOmpi6IPC3jUPkmZGhgAZr/vuaeKq7ZcEhYaZg2pNHlLN/8GuOT9XEsX QP7QjstEYp+IQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3C3396954C; Wed, 21 Jan 2026 15:11:22 -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 Plm_ktV0eL1K; Wed, 21 Jan 2026 15:11:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033478; bh=0yDwVUDiHKPcVRkby6x1blZJ2nMpfMsXy9AASdHPmig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQyP4TEhM/w0ROzJ2GkY8kzhMKQGr5PN3mS5EF8YT/3+DlsZ6I3HJY6FjCp7s4/bw +Got5oXjvP0fZgoHtla2vWAGDZHcxbWvhoksowpOIZA+j88zgV25WAMeUwpAUneeZL v2BQhisWr2yDCGFxN19ky2SoaLg4w4Jy84TvQ3j4BGHVKHtb61Xsi15fmwa/N+AGSL w/5+QiZXpUi1Oey2s/NTFjq+Tr+G86vuCOgzz1vv1GS5KceLm47orOPbOufpNbSgO0 ktshB8JhkodguXQ0ZlLMpaK7XG5l7XR1iXsHiv+l8DFuja8pvTdwSxIppq8BbxL0zs 6mvrAO9o7t6wQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B662E69490; Wed, 21 Jan 2026 15:11:17 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:46 -0700 Message-ID: <20260121220857.2137568-34-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CGBM3G2PMBDUKIT2MDQU5KDC23YSVFIY X-Message-ID-Hash: CGBM3G2PMBDUKIT2MDQU5KDC23YSVFIY 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 33/33] ext4l: Consolidate and sort includes in ext4_uboot.h 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 Reorganise ext4_uboot.h to: - Move all #include directives to the top of the file - Sort includes alphabetically within each section - Place BUG_ON/BUG override immediately after linux/bug.h - Sort forward declarations and function declarations alphabetically The include order is preserved where dependencies require it, particularly for no_printk and BUG_ON/BUG overrides which must come after certain headers are included. This reduces the file from 366 to 270 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 402 ++++++++++++++++-------------------------- 1 file changed, 153 insertions(+), 249 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 04ed9c3c846..24402f21790 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -19,48 +19,52 @@ #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-variable" +/* U-Boot headers */ #include +#include +#include +#include + +/* Linux types - must come first */ #include -#include -#include /* For panic() */ -#include -#include + +/* Linux headers (alphabetical) */ #include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include -#include #include -#include -#include -#include -#include +#include +#include +#include #include -#include /* Real rbtree implementation */ -#include /* For timespec64, time64_t */ -#include /* For struct folio_batch */ -#include /* For BUILD_BUG_ON */ -#include /* For WARN_ON, WARN_ONCE */ -#include /* For crc32() used by crc32_be */ -#include "ext4_trace.h" /* Trace event stubs */ -#include "ext4_fscrypt.h" /* fscrypt stubs */ +#include +#include +#include +#include /* - * __CHAR_UNSIGNED__ - directory hash algorithm selection - * - * The ext4 filesystem uses different hash algorithms for directory indexing - * depending on whether the platform's 'char' type is signed or unsigned. - * GCC automatically defines __CHAR_UNSIGNED__ on platforms where char is - * unsigned (e.g., ARM), and leaves it undefined where char is signed - * (e.g., x86/sandbox). - * - * The filesystem stores EXT2_FLAGS_UNSIGNED_HASH or EXT2_FLAGS_SIGNED_HASH - * in the superblock to record which hash variant was used when the filesystem - * was created, ensuring correct behavior regardless of the mounting platform. - * - * See super.c:5123 and ioctl.c:1489 for the hash algorithm selection code. + * BUG_ON / BUG - stubs (not using linux/bug.h which panics) + * In Linux, these indicate kernel bugs. In ext4l, some BUG_ON conditions + * that check for race conditions can trigger in single-threaded U-Boot, + * so we stub them out as no-ops. */ +#undef BUG_ON +#undef BUG +#define BUG_ON(cond) do { (void)(cond); } while (0) +#define BUG() do { } while (0) + +/* Local ext4l headers */ +#include "ext4_fscrypt.h" +#include "ext4_trace.h" /* * Override no_printk to avoid format warnings in disabled debug prints. @@ -70,53 +74,111 @@ #undef no_printk #define no_printk(fmt, ...) ({ 0; }) +/* More Linux headers (alphabetical) */ #include -#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include - -#define EXT4_FIEMAP_EXTENT_HOLE 0x08000000 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* - * BUG_ON / BUG - stubs (not using linux/bug.h which panics) - * In Linux, these indicate kernel bugs. In ext4l, some BUG_ON conditions - * that check for race conditions can trigger in single-threaded U-Boot, - * so we stub them out as no-ops. + * Hex dump - Linux kernel print_hex_dump has a different signature + * (includes log level) than U-Boot's, so we stub it out here. */ -#undef BUG_ON -#undef BUG -#define BUG_ON(cond) do { (void)(cond); } while (0) -#define BUG() do { } while (0) +#undef print_hex_dump +#define print_hex_dump(l, p, pt, rg, gc, b, len, a) do { } while (0) -#include -#include -#include -#include +/* + * __CHAR_UNSIGNED__ - directory hash algorithm selection + * + * The ext4 filesystem uses different hash algorithms for directory indexing + * depending on whether the platform's 'char' type is signed or unsigned. + * GCC automatically defines __CHAR_UNSIGNED__ on platforms where char is + * unsigned (e.g., ARM), and leaves it undefined where char is signed + * (e.g., x86/sandbox). + * + * The filesystem stores EXT2_FLAGS_UNSIGNED_HASH or EXT2_FLAGS_SIGNED_HASH + * in the superblock to record which hash variant was used when the filesystem + * was created, ensuring correct behavior regardless of the mounting platform. + * + * See super.c:5123 and ioctl.c:1489 for the hash algorithm selection code. + */ -#include -#include +/* ext4-specific constants */ +#define EXT4_FIEMAP_EXTENT_HOLE 0x08000000 +#define EXT4_SUPER_MAGIC 0xEF53 -#include -#include -#include +#define EXT4_GOING_FLAGS_DEFAULT 0 +#define EXT4_GOING_FLAGS_LOGFLUSH 1 +#define EXT4_GOING_FLAGS_NOLOGFLUSH 2 /* * U-Boot buffer head private bits. @@ -134,143 +196,30 @@ BUFFER_FNS(OwnsData, ownsdata) #define BH_Cached (BH_JBDPrivateStart + 2) BUFFER_FNS(Cached, cached) -#include -#include -#include -#include -#include - /* Forward declarations */ -struct pipe_inode_info; +struct fid; struct kstat; +struct kstatfs; struct path; - -/* QSTR_INIT and dotdot_name are now in linux/dcache.h */ - -#include - -/* indirect.c stubs */ - -/* ext4_sb_bread_nofail is stubbed in interface.c */ - -/* extents_status.c stubs */ - -/* shrinker - use linux/shrinker.h */ -#include - -/* ktime functions - use linux/ktime.h */ -#include - -/* hrtimer - use linux/hrtimer.h */ -#include - -/* folio and pagemap - use linux/pagemap.h */ -#include -#include - -/* wbc_to_tag, WB_REASON_* - use linux/writeback.h */ -#include - -/* projid_t is now in linux/projid.h */ - -/* - * Additional stubs for inode.c - */ - -/* try_cmpxchg is now in asm-generic/atomic.h */ - -/* hash_64 - use linux/hash.h */ -#include - -#include -#include - -#include -#include -#include - -/* UID/GID bit helpers - use linux/highuid.h */ -#include - -/* - * Additional stubs for dir.c - */ +struct pipe_inode_info; /* FSTR_INIT - fscrypt_str initializer (fscrypt_str defined in ext4_fscrypt.h) */ #define FSTR_INIT(n, l) { .name = (n), .len = (l) } -/* struct_size - use linux/overflow.h */ -#include - -#include - -/* - * Additional stubs for super.c - */ - /* Part stat - not used in U-Boot. Note: sectors[X] is passed as second arg */ -#define STAT_WRITE 0 #define STAT_READ 0 +#define STAT_WRITE 0 static u64 __attribute__((unused)) __ext4_sectors[2]; #define sectors __ext4_sectors #define part_stat_read(p, f) ({ (void)(p); (void)(f); 0ULL; }) -/* - * Hex dump - DUMP_PREFIX_* types are in hexdump.h. - * However, the Linux kernel print_hex_dump has a different signature - * (includes log level) than U-Boot's, so we stub it out here. - */ -#include -#undef print_hex_dump -#define print_hex_dump(l, p, pt, rg, gc, b, len, a) do { } while (0) - -/* Forward declarations for super_operations and export_operations */ -struct kstatfs; -struct fid; - -#include -#include -#include - -/* EXT4_GOING flags */ -#define EXT4_GOING_FLAGS_DEFAULT 0 -#define EXT4_GOING_FLAGS_LOGFLUSH 1 -#define EXT4_GOING_FLAGS_NOLOGFLUSH 2 - -/* ext4 superblock initialisation and commit */ -int ext4_fill_super(struct super_block *sb, struct fs_context *fc); -int ext4_commit_super(struct super_block *sb); -void ext4_unregister_li_request(struct super_block *sb); - -#include - -#include -#include - -/* I/O priority classes - use linux/ioprio.h */ -#include - -/* end_buffer_write_sync - implemented in support.c */ -void end_buffer_write_sync(struct buffer_head *bh, int uptodate); - -#define EXT4_SUPER_MAGIC 0xEF53 - -/* blockgroup_lock - use linux/blockgroup_lock.h */ -#include - -/* Buffer submission stubs - declaration for stub.c */ -int trylock_buffer(struct buffer_head *bh); - -/* Trace stubs for super.c - declaration for stub.c implementation */ -void trace_ext4_error(struct super_block *sb, const char *func, unsigned int line); - -/* ___ratelimit is now in linux/ratelimit.h */ - -/* kobject_put is now in linux/kobject.h */ -/* wait_for_completion is now a macro in linux/completion.h */ +/* CRC32 big-endian - map to U-Boot's crc32() */ +#define crc32_be(crc, p, len) crc32(crc, p, len) -/* DAX - declaration for stub.c */ -void fs_put_dax(void *dax, void *holder); +/* Memory allocation for journal.c */ +#define __get_free_pages(gfp, order) ((unsigned long)memalign(PAGE_SIZE, PAGE_SIZE << (order))) +#define free_pages(addr, order) free((void *)(addr)) +#define get_order(size) ilog2(roundup_pow_of_two((size) / PAGE_SIZE)) /* Memory allocation - declarations for stub.c */ void *kvzalloc(size_t size, gfp_t flags); @@ -280,87 +229,42 @@ void *kvzalloc(size_t size, gfp_t flags); unsigned long get_zeroed_page(gfp_t gfp); void free_page(unsigned long addr); -/* DAX - declaration for stub.c */ +/* DAX - declarations for stub.c */ void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, void *holder); +void fs_put_dax(void *dax, void *holder); -#include -#include +/* Buffer submission - declaration for stub.c */ +int trylock_buffer(struct buffer_head *bh); /* Filesystem sync - declaration for stub.c */ int sync_filesystem(void *sb); -/* - * Stubs for mballoc.c - */ - -#include -#include - -/* - * Stubs for page-io.c - bio types are in linux/bio.h - */ -#include - -/* - * Stubs for readpage.c - */ - -#include - -#include - -/* - * Stubs for fast_commit.c - */ +/* Trace stubs for super.c - declaration for stub.c */ +void trace_ext4_error(struct super_block *sb, const char *func, unsigned int line); -/* Wait bit operations - use linux/wait_bit.h */ -#include +/* end_buffer_write_sync - implemented in support.c */ +void end_buffer_write_sync(struct buffer_head *bh, int uptodate); -/* JBD2 checkpoint.c and commit.c stubs */ -#include -/* smp_mb__after_atomic is now in linux/smp.h */ -#define crc32_be(crc, p, len) crc32(crc, p, len) +/* ext4 superblock initialisation and commit */ +int ext4_commit_super(struct super_block *sb); +int ext4_fill_super(struct super_block *sb, struct fs_context *fc); +void ext4_unregister_li_request(struct super_block *sb); /* ext4l support functions (support.c) */ -void ext4l_crc32c_init(void); -void bh_cache_release_jbd(void); -void bh_cache_clear(void); int bh_cache_sync(void); int ext4l_read_block(sector_t block, size_t size, void *buffer); int ext4l_write_block(sector_t block, size_t size, void *buffer); -void ext4l_msg_init(void); -void ext4l_record_msg(const char *msg, int len); struct membuf *ext4l_get_msg_buf(void); +void bh_cache_clear(void); +void bh_cache_release_jbd(void); +void ext4l_crc32c_init(void); +void ext4l_msg_init(void); void ext4l_print_msgs(void); +void ext4l_record_msg(const char *msg, int len); /* ext4l interface functions (interface.c) */ struct blk_desc *ext4l_get_blk_dev(void); struct disk_partition *ext4l_get_partition(void); -#include - -/* Memory allocation for journal.c */ -#define __get_free_pages(gfp, order) ((unsigned long)memalign(PAGE_SIZE, PAGE_SIZE << (order))) -#define free_pages(addr, order) free((void *)(addr)) -#define get_order(size) ilog2(roundup_pow_of_two((size) / PAGE_SIZE)) - -/* - * Stubs for mmp.c - */ - -/* init_utsname - use linux/utsname.h */ -#include - -/* - * Stubs for fsmap.c - */ - -/* fsmap is now in linux/fsmap.h */ -#include - -/* list_sort and sort for fsmap.c */ -#include -#include - #endif /* __EXT4_UBOOT_H__ */