From patchwork Sun Jan 18 20:37: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: 1585 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=1768768751; bh=8ql9vViCYotS1OsDm+vbA2nPBJzBC5dcs7lnj7iCY7w=; 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=uUcig9loQ8ovvvyidEiY7Y9CofkRxsHFS3aYyxERQrJuEhJv8YnwlUZuH650ZsN1D c+fyweGo6FzsIUuULqnofG7jTcph2H3sDMUupYD260PA85XuBiY0UegRiQxSEHfbwH itJmjFN/mVKuLC7MUJq2AZIRWULlIR4sSG20oHB0gXvUnKpqxkjT31t60IqUHZvbZ1 geNVcFu95aK+6TNXeLCfhKOseaJ9cXpmF96fok13l66cGhIuaqonkoaZ3fpFGE98oW M+dTV5H4aI3saWWMzE2CWxwQQfQ2ePh3L+SWBwG01yS37A2sHKU/DFxAqhWiDoYLxI bVMFhK1kfz4NQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 504FF69476 for ; Sun, 18 Jan 2026 13:39: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 FQHLaSdtPOiu for ; Sun, 18 Jan 2026 13:39:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768751; bh=8ql9vViCYotS1OsDm+vbA2nPBJzBC5dcs7lnj7iCY7w=; 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=uUcig9loQ8ovvvyidEiY7Y9CofkRxsHFS3aYyxERQrJuEhJv8YnwlUZuH650ZsN1D c+fyweGo6FzsIUuULqnofG7jTcph2H3sDMUupYD260PA85XuBiY0UegRiQxSEHfbwH itJmjFN/mVKuLC7MUJq2AZIRWULlIR4sSG20oHB0gXvUnKpqxkjT31t60IqUHZvbZ1 geNVcFu95aK+6TNXeLCfhKOseaJ9cXpmF96fok13l66cGhIuaqonkoaZ3fpFGE98oW M+dTV5H4aI3saWWMzE2CWxwQQfQ2ePh3L+SWBwG01yS37A2sHKU/DFxAqhWiDoYLxI bVMFhK1kfz4NQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2A0E26919C for ; Sun, 18 Jan 2026 13:39:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768746; bh=Dwxyo4XoLEfUIS7wpl5RksZ5+tzWPpUY/vK78bQ+RRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cBJowGPaekPkuAfInz+yn2sN5LI/cp3hBZpNzeVU4MlIbN9SluYV8IwA5wYFdadBv lN5DgRGKvfS1h6P4kvxQuhSEXDbOV5K8X38cdWsI38jaUp4eeFWZCFs2T7VZN74/5e cDX0za3Af8NS2/DuKva9iN/rqqT6NysjrdfziVlE3rNWjq6w5IbSBzN9k4PkMbGWvl Nc41ckRhU0wBA2MTwPsLf/Gk42k7snlEQJfpItP8TZI9cLiyRHmtXzYCO6gG2O8/cS mO5DpeObDeaaTKWMsKwnKBBdGZJSpShThf6Bvf6xzPLyEkMxqEp9YS5tG5QfHMD7yq 7gxiTbpdilkVw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6C9906919C; Sun, 18 Jan 2026 13:39:06 -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 h6kuyYaLCXZX; Sun, 18 Jan 2026 13:39:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768738; bh=UqGBIgzPEw3NXk8buF5Y1Ig/yVh6/6c3DZJGRHyck0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=opw5yT3NgNsC38AP0Kv+sDNliqH3ovQ/RsFoFyQjd0PHvLAta3wXF2B/B1xJrCcfI k72bXnQVjNFcqNTncGQK/+NlQomEKqsyxL/zl0LRBsOGVJyfnbWxCQghjUDTdhZLkr H0P6t/p4u7xQRV/sahPRN1vkXnU5dMZfQsZZt1Evoi/OyKIM2GBxdIJKLCL+cm62b1 NiZYNlcv+UOqXRc9Hz+bW3Ivvmo5II5YJevHuXrPvOs4h7RDYIp8T7xr/dh5C5E7C0 J3Ria8NXm+YQgmA8DKIeRa9xgreoaS4cCo8GOPs7rnJ3FdlxP2hLEvwL3ML+zr26/q VctCLxEpeoOdg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 39EDF6948B; Sun, 18 Jan 2026 13:38:58 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 13:37:28 -0700 Message-ID: <20260118133734.6.986fa9e239675f821c683f38d325bfb4a4c31183@changeid> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260118203739.1974323-1-sjg@u-boot.org> References: <20260118203739.1974323-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RGMFVDCI6UUMCWYKP36VNF3TG7664EER X-Message-ID-Hash: RGMFVDCI6UUMCWYKP36VNF3TG7664EER X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/12] linux: Add mbcache.h header with metadata cache stubs 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 Create linux/mbcache.h with mb_cache structure and cache operation stubs. Metadata block caching is not supported in U-Boot. Update ext4_uboot.h to use the new header instead of duplicating these definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 29 ++------------------ include/linux/mbcache.h | 60 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 include/linux/mbcache.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index b6744894169..ba90cce3e67 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1477,33 +1477,8 @@ static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, /* super_set_sysfs_name_bdev is now in linux/kobject.h */ -/* - * mb_cache - metadata block cache stubs for xattr.c - * Not supported in U-Boot - xattr caching disabled - */ -struct mb_cache { - int dummy; -}; - -struct mb_cache_entry { - u64 e_value; - unsigned long e_flags; -}; - -/* MB cache flags */ -#define MBE_REUSABLE_B 0 - -#define mb_cache_create(bits) kzalloc(sizeof(struct mb_cache), GFP_KERNEL) -#define mb_cache_destroy(cache) do { kfree(cache); } while (0) -#define mb_cache_entry_find_first(c, h) ((struct mb_cache_entry *)NULL) -#define mb_cache_entry_find_next(c, e) ((struct mb_cache_entry *)NULL) -#define mb_cache_entry_delete_or_get(c, k, v) ((struct mb_cache_entry *)NULL) -#define mb_cache_entry_get(c, k, v) ((struct mb_cache_entry *)NULL) -#define mb_cache_entry_put(c, e) do { (void)(c); (void)(e); } while (0) -#define mb_cache_entry_create(c, f, k, v, r) ({ (void)(c); (void)(f); (void)(k); (void)(v); (void)(r); 0; }) -#define mb_cache_entry_delete(c, k, v) do { (void)(c); (void)(k); (void)(v); } while (0) -#define mb_cache_entry_touch(c, e) do { (void)(c); (void)(e); } while (0) -#define mb_cache_entry_wait_unused(e) do { (void)(e); } while (0) +/* mb_cache - use linux/mbcache.h */ +#include /* xattr helper stubs for xattr.c */ #define xattr_handler_can_list(h, d) ({ (void)(h); (void)(d); 0; }) diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h new file mode 100644 index 00000000000..b2383891211 --- /dev/null +++ b/include/linux/mbcache.h @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Metadata block cache definitions for U-Boot + * + * Based on Linux mbcache.h - cache for filesystem metadata blocks. + * U-Boot stubs - metadata caching is not supported. + */ +#ifndef _LINUX_MBCACHE_H +#define _LINUX_MBCACHE_H + +#include +#include + +/** + * struct mb_cache - metadata block cache + * + * U-Boot stub - caching not supported. + */ +struct mb_cache { + int dummy; +}; + +/** + * struct mb_cache_entry - cache entry + * @e_value: cached value + * @e_flags: entry flags + */ +struct mb_cache_entry { + u64 e_value; + unsigned long e_flags; +}; + +/* MB cache flags */ +#define MBE_REUSABLE_B 0 + +/* MB cache operations - all stubbed as no-ops */ +#define mb_cache_create(bits) \ + kzalloc(sizeof(struct mb_cache), GFP_KERNEL) +#define mb_cache_destroy(cache) \ + do { kfree(cache); } while (0) +#define mb_cache_entry_find_first(c, h) \ + ((struct mb_cache_entry *)NULL) +#define mb_cache_entry_find_next(c, e) \ + ((struct mb_cache_entry *)NULL) +#define mb_cache_entry_delete_or_get(c, k, v) \ + ((struct mb_cache_entry *)NULL) +#define mb_cache_entry_get(c, k, v) \ + ((struct mb_cache_entry *)NULL) +#define mb_cache_entry_put(c, e) \ + do { (void)(c); (void)(e); } while (0) +#define mb_cache_entry_create(c, f, k, v, r) \ + ({ (void)(c); (void)(f); (void)(k); (void)(v); (void)(r); 0; }) +#define mb_cache_entry_delete(c, k, v) \ + do { (void)(c); (void)(k); (void)(v); } while (0) +#define mb_cache_entry_touch(c, e) \ + do { (void)(c); (void)(e); } while (0) +#define mb_cache_entry_wait_unused(e) \ + do { (void)(e); } while (0) + +#endif /* _LINUX_MBCACHE_H */