From patchwork Mon Jan 19 06:15:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1612 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=1768803370; bh=5RslPj7gJe9VRZcG2QGz1d/FlSJff3b9iZzTZu4ccvg=; 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=ZT5+9JJ7Q5xpR5juGls1NJPUUE+p4p5SSVEgFYFgE4jS56YyS4eccNTJu7owLffAN r+q3Z/DLnUTtDrR9avWoFgNjnbNv/M49T4IyNxtu7ybYGNJ1Jfstb1VbRzfHv42hpg TwFK/6TVWp2vDM4QpSuJgYgm236GJU9/1KCPmxgi4kU5otQDR5U1LNKL+UVQnI3vCf V7oZMgHbJB5slLfiWHdTj5hqQuZ/olKMNVnrzEKHrdfyleSEbchOFJb6jmVJeXAwYu +zOA6OJ6xCY8Fbstw9ZXzEuEHa6nxjhqdE/VvlK+yweXwdBgu4rL6wUTmkD3/6pypM 4z5WPodpJYUFw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 745DD6938F for ; Sun, 18 Jan 2026 23:16:10 -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 sXQ2mWjykaYm for ; Sun, 18 Jan 2026 23:16:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803370; bh=5RslPj7gJe9VRZcG2QGz1d/FlSJff3b9iZzTZu4ccvg=; 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=ZT5+9JJ7Q5xpR5juGls1NJPUUE+p4p5SSVEgFYFgE4jS56YyS4eccNTJu7owLffAN r+q3Z/DLnUTtDrR9avWoFgNjnbNv/M49T4IyNxtu7ybYGNJ1Jfstb1VbRzfHv42hpg TwFK/6TVWp2vDM4QpSuJgYgm236GJU9/1KCPmxgi4kU5otQDR5U1LNKL+UVQnI3vCf V7oZMgHbJB5slLfiWHdTj5hqQuZ/olKMNVnrzEKHrdfyleSEbchOFJb6jmVJeXAwYu +zOA6OJ6xCY8Fbstw9ZXzEuEHa6nxjhqdE/VvlK+yweXwdBgu4rL6wUTmkD3/6pypM 4z5WPodpJYUFw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 63F01694C7 for ; Sun, 18 Jan 2026 23:16:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803369; bh=17Mv9xYhKcgU1qhFQfnUozTNhOqgwE7PlgzW6sKJ6mk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v3wqRidc+vAQQNBaToQRtyZRblhlEbt3ZFX5qer5+d6f0YPKlc4FOhBRLy1qDDW6d L1i7eoPqRZYuf4/vrcbMyNarMMadszL9bWITTeS4voYUcBhkinc9aXqJyFh98wTen2 +j8Yn35/NNzO4sNP8RrayaLJ9lRZ2VOWPX+c2YFH9B+JfZQhhKf9LMOJKyhz6VCriY 2uF9aj3UhLDT+jbuXW5rxm6q7DOIXCK7qZJI89gnl9R+wxg9e5UqVbNYR0NzBhjhpf RkACSAYyxt0sr1amJ2uxuXmVeD1i5v0Ffq7CUmKpf2WNLBzAtrvIAf3p02QB2RhkbQ 7fsGRlUNM0yuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1D035694C7; Sun, 18 Jan 2026 23:16: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 10026) with ESMTP id Z9ZCcREEmydf; Sun, 18 Jan 2026 23:16:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803364; bh=s/vz7l4CIdRjUq9HQxZutfrvita5W0/471HMl9HbcpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RT6Oo97emFP4eNsa86S1CSew/bxhUrQNFhVUh7uPnYWYHJt50hOVmBEK8nD1C9MW8 EhVQ0JLmqOluCwWNJQT8ltZmL3yneTZRKr4CmHHj0w0lT8txq8zdAiwNE5tId6xSXR 5HxckCh/Grg5iIQFCB8xMUI6tS30k791TsUm47FQqxeIfZJrFBfGnyypwybVGExXL7 q0NbUUcL4KeV1azwvcXIJRKSg+MrKiSD8O8wurCNlrZNrxhPHB4lM6Gy0CF+5S4qRq yqcHr4t9sSLEWev/P6VZMlQtLqZ9MAOgjwpl4y8tNvtwumOxDNpg9U3QiMSDUwXhju EdKtE3C37rztQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 94835693AE; Sun, 18 Jan 2026 23:16:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:03 -0700 Message-ID: <20260119061529.3383191-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ILOAEFMLUL2TC65XINZXYI5NXREHEVLT X-Message-ID-Hash: ILOAEFMLUL2TC65XINZXYI5NXREHEVLT 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 05/23] linux: Add iversion.h with inode version 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/iversion.h with inode version operation stubs including inode_peek_iversion(), inode_set_iversion(), inode_inc_iversion(), inode_eq_iversion(), and inode_query_iversion(). U-Boot does not track inode versions, so these are all no-ops or return constant values. Update ext4_uboot.h to use linux/iversion.h and remove the inode_set_iversion() implementation from stub.c since it is now a macro. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 14 ++---- fs/ext4l/stub.c | 4 +- include/linux/iversion.h | 96 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 13 deletions(-) create mode 100644 include/linux/iversion.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 873f02cf508..35d1c8125df 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -982,13 +982,9 @@ static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, return ts; } -/* Inode version operations */ -#define inode_peek_iversion_raw(i) (0ULL) -#define inode_peek_iversion(i) (0ULL) +/* Inode version operations - use linux/iversion.h */ +#include #define inode_set_flags(i, f, m) do { } while (0) -#define inode_set_iversion_raw(i, v) do { } while (0) -#define inode_set_iversion_queried(i, v) do { } while (0) -#define inode_inc_iversion(i) do { } while (0) /* Inode credential helpers */ static inline unsigned int i_uid_read(const struct inode *inode) @@ -1062,9 +1058,7 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); /* Readahead operations are in linux/pagemap.h */ -/* Inode version operations */ -#define inode_eq_iversion(i, v) ({ (void)(i); (void)(v); 1; }) -#define inode_query_iversion(i) ({ (void)(i); 0ULL; }) +/* Inode version operations are in linux/iversion.h */ /* dir_emit, dir_relax_shared are in linux/fs.h */ @@ -1344,7 +1338,7 @@ void fs_put_dax(void *dax, void *holder); /* Inode allocation - declaration for stub.c */ void *alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, gfp_t gfp); -void inode_set_iversion(struct inode *inode, u64 version); +/* inode_set_iversion is in linux/iversion.h */ int inode_generic_drop(struct inode *inode); /* rwlock_init is a macro in linux/spinlock.h */ diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index c14132815cd..e223ec21936 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -346,9 +346,7 @@ void *alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, return NULL; } -void inode_set_iversion(struct inode *inode, u64 version) -{ -} +/* inode_set_iversion is now a macro in linux/iversion.h */ /* rwlock_init is now a macro in linux/spinlock.h */ diff --git a/include/linux/iversion.h b/include/linux/iversion.h new file mode 100644 index 00000000000..be0ccc64c6d --- /dev/null +++ b/include/linux/iversion.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Inode version definitions for U-Boot + * + * Based on Linux iversion.h - inode version management. + * U-Boot stub - version tracking not supported. + */ +#ifndef _LINUX_IVERSION_H +#define _LINUX_IVERSION_H + +#include + +/* Forward declarations */ +struct inode; + +/** + * inode_peek_iversion_raw() - read inode version without side effects + * @inode: inode to read + * + * U-Boot stub - always returns 0. + * + * Return: inode version + */ +#define inode_peek_iversion_raw(inode) (0ULL) + +/** + * inode_peek_iversion() - read inode version + * @inode: inode to read + * + * U-Boot stub - always returns 0. + * + * Return: inode version + */ +#define inode_peek_iversion(inode) (0ULL) + +/** + * inode_set_iversion_raw() - set inode version directly + * @inode: inode to modify + * @version: version to set + * + * U-Boot stub - no-op. + */ +#define inode_set_iversion_raw(inode, version) \ + do { (void)(inode); (void)(version); } while (0) + +/** + * inode_set_iversion() - set inode version + * @inode: inode to modify + * @version: version to set + * + * U-Boot stub - no-op. + */ +#define inode_set_iversion(inode, version) \ + do { (void)(inode); (void)(version); } while (0) + +/** + * inode_set_iversion_queried() - set inode version as queried + * @inode: inode to modify + * @version: version to set + * + * U-Boot stub - no-op. + */ +#define inode_set_iversion_queried(inode, version) \ + do { (void)(inode); (void)(version); } while (0) + +/** + * inode_inc_iversion() - increment inode version + * @inode: inode to modify + * + * U-Boot stub - no-op. + */ +#define inode_inc_iversion(inode) do { (void)(inode); } while (0) + +/** + * inode_eq_iversion() - check if inode version matches + * @inode: inode to check + * @version: version to compare + * + * U-Boot stub - always returns true. + * + * Return: true if versions match + */ +#define inode_eq_iversion(inode, version) \ + ({ (void)(inode); (void)(version); true; }) + +/** + * inode_query_iversion() - query inode version + * @inode: inode to query + * + * U-Boot stub - always returns 0. + * + * Return: inode version + */ +#define inode_query_iversion(inode) ({ (void)(inode); 0ULL; }) + +#endif /* _LINUX_IVERSION_H */