From patchwork Mon Jan 19 21:48: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: 1658 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=1768859346; bh=VV95iiTy6vcvR3Jikqg/JwrfB0l+GsPqYGVy7BucgfA=; 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=QcHAsSzM5JM38+VRKX0fp7wabvl/8UK/w49RZptS5WegDO5CQoDapBryW9nkspDxc jdvNOH/veE+dDuI1iTmtv3+M+hZw6EkaplmbljAi3GKs8RWYHvPu5+Xi6JgXd5SSZd OoLWJX2JxR8jOV+mnY6FDr7WZovzcBqAVLbYDnMqauvNPvTJbsNiH4agX51DuC+y9C 646h4Ll+wQdIjxMWuZ5eELKaAMy840gOO4IFseJZ8cKPq63jZOCNlRXXhVNWm4m2rk SvxchCjsKojzkZ9RXDni2i1qDGD8NLRzs3woYqZOBfCH14ZrKivCLqcsb5yvRN1BE8 WW9tpJ/F3lidA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 768D369536 for ; Mon, 19 Jan 2026 14:49: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 10024) with ESMTP id DaDjUATMosys for ; Mon, 19 Jan 2026 14:49:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859346; bh=VV95iiTy6vcvR3Jikqg/JwrfB0l+GsPqYGVy7BucgfA=; 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=QcHAsSzM5JM38+VRKX0fp7wabvl/8UK/w49RZptS5WegDO5CQoDapBryW9nkspDxc jdvNOH/veE+dDuI1iTmtv3+M+hZw6EkaplmbljAi3GKs8RWYHvPu5+Xi6JgXd5SSZd OoLWJX2JxR8jOV+mnY6FDr7WZovzcBqAVLbYDnMqauvNPvTJbsNiH4agX51DuC+y9C 646h4Ll+wQdIjxMWuZ5eELKaAMy840gOO4IFseJZ8cKPq63jZOCNlRXXhVNWm4m2rk SvxchCjsKojzkZ9RXDni2i1qDGD8NLRzs3woYqZOBfCH14ZrKivCLqcsb5yvRN1BE8 WW9tpJ/F3lidA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6616D69525 for ; Mon, 19 Jan 2026 14:49:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859344; bh=KpbIol5i8hcCFx1lCrc8QTgsRh7mDRh00EAqetU5ha4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iZIOtMambWTQdlZ7gCOjapSVdNQH6JCw7w/MqoW8PG2ndslK/RRNzY0EIxqjYPMsA ojzG8t8Kr/tXAXqwDgwOmG6FGFYGfura6pqHF3g/cpPXxvkdym4UIsLpuJjwhtsj5i SStGD0tfxCEq8oJHyxaPXD1i3bw4lPeP3Hb25v3I5OJbgxAZG5K8b7GuVaQB/p0y1T fBoCJwQK4s/pcwsjzWlzwQGUl2CMWXXS1Pu5WhtVWyyjM7a9QAijrRWOy0DOtgyhO2 57EeTz3up1Avinr87E9J0ANoauSyMdoFNg1Zl9FyTCcJV6q7PmnM0bjikhwTQXGCRN oQCl68bgywI8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6E7E0693E1; Mon, 19 Jan 2026 14:49:04 -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 neVeLmFNfhVX; Mon, 19 Jan 2026 14:49:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859340; bh=DY/E1xAjv/BBIHt/Gzb8gfn7fS33CqqWOi+BkoRirBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WHLCJqZBRWjjPjkdOP+XAnzmxNUiCUmMdUyA5e3krB0sbmlRjw0RhgHgxv2R60ZAu wA4aBtgTPBZI1EcIK3LCA5jkM9G6+7es+Z35Ov7bo9YJtQ23u8MEWnWdDySawp9GGS UaOfWKO5PgqwVxBPQ8Ifrb4gGQ6RzOoIIknV3OPA9N8Z7mSRHEKZTWcYWtYJSJXLpg e7NkiC0uNVi58Ue9i09xp+uVA4at2Q+Ud190piBuz2vAGlF5+I0T39d+KbvmbuwOQ6 rh0iEQMVVs/gHziyy0WtfaCxVoWtoLEJH03zFCd+I5VSzpca86ybFhY/+gwXFBs5Tm PkPYtoYgb6J2Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 23A1E69537; Mon, 19 Jan 2026 14:49:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:26 -0700 Message-ID: <20260119214846.3087611-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2M2H3LFKODEHGFSJM22VND3YIC2PBV5Q X-Message-ID-Hash: 2M2H3LFKODEHGFSJM22VND3YIC2PBV5Q 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/16] ext4l: Move inode locking 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 U-Boot is single-threaded, so inode locking is a no-op. Move the stub macros (inode_lock, inode_unlock, inode_lock_shared, inode_unlock_shared, inode_trylock, inode_trylock_shared, inode_dio_wait, inode_lock_nested) and the I_MUTEX_* enum to include/linux/fs.h where they belong. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 15 ++------------- include/linux/fs.h | 13 +++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index ba462af45e4..8daf01779c5 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -719,15 +719,7 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) #define bh_uptodate_or_lock(bh) (1) /* ext4_read_bh is stubbed in interface.c */ -/* Inode locking */ -#define inode_lock(inode) do { } while (0) -#define inode_unlock(inode) do { } while (0) -#define inode_lock_shared(inode) do { } while (0) -#define inode_unlock_shared(inode) do { } while (0) -#define inode_trylock(inode) (1) -#define inode_trylock_shared(inode) (1) -#define inode_dio_wait(inode) do { } while (0) - +/* Inode locking stubs are in linux/fs.h */ /* Lock debugging stubs are in linux/lockdep.h */ /* File operations */ @@ -1344,10 +1336,7 @@ 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_* inode lock classes are in linux/fs.h */ - -/* Nested inode locking stub */ -#define inode_lock_nested(i, c) do { (void)(i); (void)(c); } while (0) +/* I_MUTEX_* constants and inode locking stubs are in linux/fs.h */ /* PF_MEMALLOC_NOFS is in linux/sched.h */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 5c357cdacd2..6d8b9b5c79b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -270,4 +270,17 @@ enum { I_MUTEX_PARENT2, }; +/* + * Inode locking stubs - U-Boot is single-threaded, no locking needed. + */ +#define inode_lock(inode) do { (void)(inode); } while (0) +#define inode_unlock(inode) do { (void)(inode); } while (0) +#define inode_lock_shared(inode) do { (void)(inode); } while (0) +#define inode_unlock_shared(inode) do { (void)(inode); } while (0) +#define inode_trylock(inode) ({ (void)(inode); 1; }) +#define inode_trylock_shared(inode) ({ (void)(inode); 1; }) +#define inode_dio_wait(inode) do { (void)(inode); } while (0) +#define inode_lock_nested(inode, subclass) \ + do { (void)(inode); (void)(subclass); } while (0) + #endif /* _LINUX_FS_H */ From patchwork Mon Jan 19 21:48: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: 1659 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=1768859349; bh=nUuC8wA0Gmml1NRQ8V7s0j2cWOgvLmbAM9n/tjA+7L4=; 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=GkKCYpTSXFZimxAKPAMuYZFizN4RG1/vTOyEUIHINSB03Xc1l05OtVo2+PJx6mAHv QlrkqHB++1mMU9OUR6wLeoJMcoit0RK+kK8wXv3+YykO7GP29TgBZLXYyfGsSgIuig bNE7VQlwSJkyEDtSo1xXszlBW+rSuiw9Ze8Dhy63eJpm4k6+VjzZuftkHnDLxcn3qH VKv8YFlK1hl+EAos/jnRyZWcsmmXnrcR9ekE3xPKWZBVxFTNDOWZdftGV/XR9jI96X /TGZvDW2jdQG/DWkllgIw85dkTBbyf8Jxr1nuZAmra2rq9gBtXfG3UWHpghLCFr9x3 CSOijcSz+vvoA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE55169533 for ; Mon, 19 Jan 2026 14:49: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 YWLO6KqzGRJ3 for ; Mon, 19 Jan 2026 14:49:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859349; bh=nUuC8wA0Gmml1NRQ8V7s0j2cWOgvLmbAM9n/tjA+7L4=; 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=GkKCYpTSXFZimxAKPAMuYZFizN4RG1/vTOyEUIHINSB03Xc1l05OtVo2+PJx6mAHv QlrkqHB++1mMU9OUR6wLeoJMcoit0RK+kK8wXv3+YykO7GP29TgBZLXYyfGsSgIuig bNE7VQlwSJkyEDtSo1xXszlBW+rSuiw9Ze8Dhy63eJpm4k6+VjzZuftkHnDLxcn3qH VKv8YFlK1hl+EAos/jnRyZWcsmmXnrcR9ekE3xPKWZBVxFTNDOWZdftGV/XR9jI96X /TGZvDW2jdQG/DWkllgIw85dkTBbyf8Jxr1nuZAmra2rq9gBtXfG3UWHpghLCFr9x3 CSOijcSz+vvoA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DD29569525 for ; Mon, 19 Jan 2026 14:49:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859349; bh=cjOhMe3e6euACnA2VWmPMn0KMhmjeZ3ZdeZIVkoBaoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n04JLnY82YYW1YUKZKJ926/mHGePoVZN2cvRRxGq8jOWV/NJKeR+UALxmB0M/03GW JsN1/VjpDhLuOL6Tq7TvboChMbteKUs29ptqBlDnus6dFf1xuG/sYpEi8zubZw/5ji noNyZqXerL/UfrJNNyBhS26xMTp57xxSNujEj3L1egObU+/kxkUS/mxx4jGU/a+r3g 73gY/hrJX4MPUmenPGlA1VE0L/d1UiQSMOHbj9/8JgciqSYeanko/Rr8OO2nsqNALm pYwpz18x1gzmzkbpDXiYvNR1y7blMDDok3aIvKiYq4Z6xuYBiEthFIV0UO/4PuYLzI r736Sj7bJxKUQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1785469525; Mon, 19 Jan 2026 14:49: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 5P3aXPJ0TtiK; Mon, 19 Jan 2026 14:49:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859345; bh=YdRom0zwN6chuWVRmmiPoORY7TmKQTy1tdPnwpsjndA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r7Qc6hKZP6dUrELc9+0HtdPbLP1PObhhl1Rd8s7Zwr97Y4OwU2RBtJrPZOryXvVvU 6DCzW7pMROCCtEheZU/z0unvigcPkPoXdze1Kp199eS4FzFwMGI0JTUKVr8DOiixBm Qwi+Cwj3ZzKarz4fvaE6s/A6eUUxvyl1eQ1YD2rp0D3eHhpTNF25S1PL1sFv7l8V4h 28I028g71qcXdGR/FBZN4cuGDaaRDz+1vKuiXqd8QdzrTZ0NH4oJQnQ/WTM36u/f4x 7tY0yrKW50rxzTI6q8E4sawJh9BfQq3SGc0UYP2DUGZHq4qzgNCFZM+h5AduKnt7eA Oo3q5WEF6OThw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B2F636951A; Mon, 19 Jan 2026 14:49:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:27 -0700 Message-ID: <20260119214846.3087611-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TVIZJUJVURGMYQVM6YHZRYY3QJPZN4KT X-Message-ID-Hash: TVIZJUJVURGMYQVM6YHZRYY3QJPZN4KT 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/16] ext4l: Add linux/fs/super_types.h for struct super_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 Create include/linux/fs/super_types.h with the struct super_block definition and sb_rdonly() helper, matching the Linux kernel location. This allows other headers like linux/fs.h to access the full struct definition rather than just a forward declaration. Remove the duplicate definitions from ext4_uboot.h. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 41 ++------------------ include/linux/fs.h | 2 +- include/linux/fs/super_types.h | 68 ++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 39 deletions(-) create mode 100644 include/linux/fs/super_types.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 8daf01779c5..d6b7acc66b3 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -194,8 +194,7 @@ extern struct user_namespace init_user_ns; /* might_sleep - stub */ #define might_sleep() do { } while (0) -/* sb_rdonly - check if filesystem is mounted read-only */ -#define sb_rdonly(sb) ((sb)->s_flags & SB_RDONLY) +/* sb_rdonly is in linux/super.h */ /* Trace stubs are now in ext4_trace.h */ @@ -328,10 +327,7 @@ void iput(struct inode *inode); /* SB_FREEZE_* constants are in linux/fs.h */ -/* sb_writers stub */ -struct sb_writers { - int frozen; -}; +/* sb_writers is in linux/super.h */ /* mapping_large_folio_support is in linux/pagemap.h */ @@ -424,38 +420,7 @@ struct fstrim_range { /* uuid_t is now in linux/uuid.h */ -/* Forward declarations for super_block */ -struct super_operations; -struct export_operations; -struct xattr_handler; - -/* super_block - minimal stub */ -struct super_block { - void *s_fs_info; - unsigned long s_blocksize; - unsigned char s_blocksize_bits; - unsigned long s_magic; - loff_t s_maxbytes; - unsigned long s_flags; - unsigned long s_iflags; /* Internal flags */ - struct rw_semaphore s_umount; - struct sb_writers s_writers; - struct block_device *s_bdev; - char s_id[32]; - struct dentry *s_root; - uuid_t s_uuid; - struct file_system_type *s_type; - s32 s_time_gran; /* Time granularity (ns) */ - time64_t s_time_min; /* Min supported time */ - time64_t s_time_max; /* Max supported time */ - const struct super_operations *s_op; - const struct export_operations *s_export_op; - const struct xattr_handler * const *s_xattr; - struct dentry *d_sb; /* Parent dentry - stub */ - - /* U-Boot: list of all inodes, for freeing on unmount */ - struct list_head s_inodes; -}; +/* super_block is now in linux/super.h */ /* Block device read-only check */ static inline int bdev_read_only(struct block_device *bdev) diff --git a/include/linux/fs.h b/include/linux/fs.h index 6d8b9b5c79b..f295086523a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -10,10 +10,10 @@ #include #include #include +#include /* Forward declarations */ struct inode; -struct super_block; struct buffer_head; struct file; struct folio; diff --git a/include/linux/fs/super_types.h b/include/linux/fs/super_types.h new file mode 100644 index 00000000000..f3ed772ef40 --- /dev/null +++ b/include/linux/fs/super_types.h @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Superblock definitions + * + * Minimal version for U-Boot - based on Linux + */ +#ifndef _LINUX_FS_SUPER_TYPES_H +#define _LINUX_FS_SUPER_TYPES_H + +#include +#include +#include +#include +#include + +/* Forward declarations */ +struct block_device; +struct dentry; +struct file_system_type; +struct super_operations; +struct export_operations; +struct xattr_handler; + +/* sb_writers stub */ +struct sb_writers { + int frozen; +}; + +/* super_block - filesystem superblock */ +struct super_block { + void *s_fs_info; + unsigned long s_blocksize; + unsigned char s_blocksize_bits; + unsigned long s_magic; + loff_t s_maxbytes; + unsigned long s_flags; + unsigned long s_iflags; /* Internal flags */ + struct rw_semaphore s_umount; + struct sb_writers s_writers; + struct block_device *s_bdev; + char s_id[32]; + struct dentry *s_root; + uuid_t s_uuid; + struct file_system_type *s_type; + s32 s_time_gran; /* Time granularity (ns) */ + time64_t s_time_min; /* Min supported time */ + time64_t s_time_max; /* Max supported time */ + const struct super_operations *s_op; + const struct export_operations *s_export_op; + const struct xattr_handler * const *s_xattr; + struct dentry *d_sb; /* Parent dentry - stub */ + + /* U-Boot: list of all inodes, for freeing on unmount */ + struct list_head s_inodes; +}; + +/* Superblock flags - also defined in linux/fs.h */ +#ifndef SB_RDONLY +#define SB_RDONLY (1 << 0) /* Read-only mount */ +#endif + +/* sb_rdonly - check if filesystem is mounted read-only */ +static inline bool sb_rdonly(const struct super_block *sb) +{ + return sb->s_flags & SB_RDONLY; +} + +#endif /* _LINUX_FS_SUPER_TYPES_H */ From patchwork Mon Jan 19 21:48: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: 1660 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=1768859355; bh=e/fAszVGC/x9NZFHT+E96bD0MZdBLdaOJkEL3WLP48k=; 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=eHz+5JpFoGSfOlOUeZrsG9YrGTcpr+xneZl5Fu/80vyMTnut5112aGLaOJamle6De yKfBmoGuhXbtMLAseIWItOcC6E1YBtxN5YG7G+pgirXalnnuWn8a4GJQ8EH/of2g3u g8JEvBN3S+LDqZ4Q/YiwBNpgp7YWGqC05MqlJvH9nb5+/ubgYWOxbh/8fvKJXPUutF 6V39EkScRCQI0QpxKQZP5BDVeTmrnad/ZW7obuELGeKwrQEBKuy6V3nQWHmd7RF/XQ wUmW3r5pw0MThCnXP7CnpGJH2QwdK4XDj/KFQipJ3MIrpK5CA/RYl7cAf/CEgimQXf ylLQ5yztK55Bw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BB8FA69536 for ; Mon, 19 Jan 2026 14:49: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 xzHDBnlQtuBs for ; Mon, 19 Jan 2026 14:49:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859355; bh=e/fAszVGC/x9NZFHT+E96bD0MZdBLdaOJkEL3WLP48k=; 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=eHz+5JpFoGSfOlOUeZrsG9YrGTcpr+xneZl5Fu/80vyMTnut5112aGLaOJamle6De yKfBmoGuhXbtMLAseIWItOcC6E1YBtxN5YG7G+pgirXalnnuWn8a4GJQ8EH/of2g3u g8JEvBN3S+LDqZ4Q/YiwBNpgp7YWGqC05MqlJvH9nb5+/ubgYWOxbh/8fvKJXPUutF 6V39EkScRCQI0QpxKQZP5BDVeTmrnad/ZW7obuELGeKwrQEBKuy6V3nQWHmd7RF/XQ wUmW3r5pw0MThCnXP7CnpGJH2QwdK4XDj/KFQipJ3MIrpK5CA/RYl7cAf/CEgimQXf ylLQ5yztK55Bw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A8E7E69533 for ; Mon, 19 Jan 2026 14:49:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859353; bh=lNqNLmgJCCgwmMpdVQfFZYIphsELcm0l67Gvf0mPtA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eLHdxH274YUT0lle2C5Rig1TmOdtdGYoWiBgB5r1juiVcqdISdHImNX+ZHJowal6p 1pb6nfPWV6WqRD9Xo2DNvUbq+FQIPWiW/FfocV7s7lu/z1NfHIm1SI0QQ9t0OS1CoU PTIxmYwio/5iuYsuMKNFZVwq+0s3d/eCVIDcGp4wnsAEgs4UJzXzRqeWaBK6CP4rTm 7HAedN4cQEFlCTyMEaJ6FQ2bpIGy7G3cDcWQMuMHpf0Gdo/yn3unt8QlsI9cRKr56J sIhrHEyQlz0u/GEsiDHZL/v5XVPXdZAfiSjDxFTTSUXBtIAxkc8WQvns6PhUUqKRM6 SGES7aEeRqi3A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A3DDF69525; Mon, 19 Jan 2026 14:49: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 10026) with ESMTP id So8kizmoZa43; Mon, 19 Jan 2026 14:49:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859349; bh=drVJBPGE0J7aLE/4ioholKrojCz9xT08Luk0aQGwy+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RKNX9ENwhkccTdyGmRsfIPOBhpbCIKTEXmUUSddQun1IrmD/kEhDPlF77UQQxCJnm iV9f20U9I5+qaw8A943uXJXPhoUO8K5m/Cjq5b9nNXUvoAhwB++y6wDm3iZnpcWbCG mcX3zMOnzImAy/Xef8CNMsb9+Q21PC1blkzlmfVQlo1ImHLRII2ejZZI/47ErUvU+L KKqjJEzCxQ55G18QvXjQexVXbpw0DbV/tX78xkgcX+o1WgvLwtbQYecvBLppEk4WBh ON4LUdlaSOeTP3yLFG2mauvTulP+Sj/IIl57Gi16Ux2S4+deFti0ioy2nbUMTuRq+8 KV0br6UQBHzmg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 571176951A; Mon, 19 Jan 2026 14:49:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:28 -0700 Message-ID: <20260119214846.3087611-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AW262SEIH7EAQCFGHH3NOWVUNUA4FSVY X-Message-ID-Hash: AW262SEIH7EAQCFGHH3NOWVUNUA4FSVY 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 03/16] ext4l: Move inode and superblock 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 sb_rdonly(), inode_is_locked(), i_size_write(), i_size_read(), i_blocksize(), inode_newsize_ok(), IS_SYNC(), IS_APPEND(), and IS_IMMUTABLE() macros to include/linux/fs.h where they belong. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 16 +++------------- include/linux/fs.h | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index d6b7acc66b3..0b3b2d6f2e5 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -284,10 +284,7 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, #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 locking - stubs */ -#define inode_is_locked(i) (1) -#define i_size_write(i, s) do { (i)->i_size = (s); } while (0) -#define i_size_read(i) ((i)->i_size) +/* inode_is_locked, i_size_write, i_size_read are in linux/fs.h */ /* spin_trylock is defined in linux/spinlock.h */ @@ -707,14 +704,9 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) /* 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 */ -#define inode_newsize_ok(i, s) ({ (void)(i); (void)(s); 0; }) +/* Inode time/size operations - inode_newsize_ok, i_blocksize, IS_SYNC are in linux/fs.h */ #define inode_set_ctime_current(i) ({ (void)(i); (struct timespec64){}; }) #define inode_set_mtime_to_ts(i, ts) ({ (void)(i); (ts); }) -#define i_blocksize(i) (1U << (i)->i_blkbits) - -/* IS_SYNC macro */ -#define IS_SYNC(inode) (0) /* Case-folding stubs - not supported in U-Boot */ #define sb_no_casefold_compat_fallback(sb) ({ (void)(sb); 1; }) @@ -925,9 +917,7 @@ 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) -/* Inode flag macros */ -#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) -#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) +/* IS_APPEND, IS_IMMUTABLE are in linux/fs.h */ /* File operations */ #define file_update_time(f) do { } while (0) diff --git a/include/linux/fs.h b/include/linux/fs.h index f295086523a..75e4bd3e951 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -283,4 +283,26 @@ enum { #define inode_lock_nested(inode, subclass) \ do { (void)(inode); (void)(subclass); } while (0) +/* + * Inode helper functions + */ + +/* inode_is_locked - check if inode lock is held (always true in U-Boot) */ +#define inode_is_locked(i) (1) + +/* i_size accessors */ +#define i_size_write(i, s) do { (i)->i_size = (s); } while (0) +#define i_size_read(i) ((i)->i_size) + +/* i_blocksize - get block size from inode */ +#define i_blocksize(i) (1U << (i)->i_blkbits) + +/* inode_newsize_ok - check if new size is valid (always ok in U-Boot) */ +#define inode_newsize_ok(i, s) ({ (void)(i); (void)(s); 0; }) + +/* IS_SYNC, IS_APPEND, IS_IMMUTABLE - inode flag checks */ +#define IS_SYNC(inode) (0) +#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) +#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) + #endif /* _LINUX_FS_H */ From patchwork Mon Jan 19 21:48: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: 1661 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=1768859360; bh=dUykpEd0XLlQIvO83NPnWsJcCHic1fjRV/L0oxi/CDI=; 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=JqXZvafbAJ1us+Lk96ZWO161F2LJsiMrU26n/nfbB4v/R2zNK5X/SxIOwaAcokjh1 tPxTsBWl83vSEXW3cBS2YOQolqgH4btnVP+xgaYWF+0N09Lo8809Mds93GMjcixX1R /A+dDyPB+5b3PEapQ1i1011Q1xCVxEZkBIIbn129OYVobv/R/8PTZWIBv/XFGYUkDf 70dP/aWf1TTGE/rK54b0NXwhZIrFwsNhvXeAMnAQFJJY89oeZGM2Aho2QIGEvvUACC QBSlrgLqapWR9KhbhwkZm4LmdRdGGW9hVZgOruLWrqEyCW6D74FwXc7Rs9DCCtIcIT dBaqCWe14cZvw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 41E2E69536 for ; Mon, 19 Jan 2026 14:49: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 l6qLIz09b-po for ; Mon, 19 Jan 2026 14:49:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859360; bh=dUykpEd0XLlQIvO83NPnWsJcCHic1fjRV/L0oxi/CDI=; 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=JqXZvafbAJ1us+Lk96ZWO161F2LJsiMrU26n/nfbB4v/R2zNK5X/SxIOwaAcokjh1 tPxTsBWl83vSEXW3cBS2YOQolqgH4btnVP+xgaYWF+0N09Lo8809Mds93GMjcixX1R /A+dDyPB+5b3PEapQ1i1011Q1xCVxEZkBIIbn129OYVobv/R/8PTZWIBv/XFGYUkDf 70dP/aWf1TTGE/rK54b0NXwhZIrFwsNhvXeAMnAQFJJY89oeZGM2Aho2QIGEvvUACC QBSlrgLqapWR9KhbhwkZm4LmdRdGGW9hVZgOruLWrqEyCW6D74FwXc7Rs9DCCtIcIT dBaqCWe14cZvw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 30D6169533 for ; Mon, 19 Jan 2026 14:49:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859358; bh=ucR3QNo1vw4Hai4uKDslkhB2uoCPD14fPYFhT1FwAIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B1X8fZ6UdDEBMuJYoRTSWmtOk4/9YsPVxVKiBYhnFbpUtG/2qnNRHOZLLtjBG6M1z PB4az9BvPMhi1HE7dGItiiCm+1l2t5cH13xsaVhavIke/UFfo6JKw5YobFStOUeGsf O8GieNBq70MGDlCk34/UXG7C0xOQtWMroz6Yw+dE1CAQaRYYQE8pwC2Kxak7MQhZLs VK/8yOhNev9TxLk6sk9BUZSm3mQbqJbLWxd0Oz8uwJQT5qPkCtFCnwH9B+ZREJkwv4 5m6aBiPhXUawD/RUlPUdzWQDjx9KXyhx+6P7xkAMzx8oP5RQt/1vDGLl6qvmbVQAII Qdy9Yjn6Z3fhA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E5B469525; Mon, 19 Jan 2026 14:49: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 pJbUv2R4UpQ7; Mon, 19 Jan 2026 14:49:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859354; bh=qV75VYdtmUfRhM6fKpZyK48oQ8XVZxFdhojWiGWCGVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iz1JLa8UICJfzro8vhtXhzzK6KTpZLqR7y496cuIQwZjRJjAAOWs82oq/s7meY23Z mhZxrnExBhW+DNDtURCaBj+7tmfiBVGtkOdPJ/4izm7HbkjY9dqoxwkBDCgZMuqTmW GyehdlHr/M5EHiKI4vWF9jegCOS2C2aKzBbD44S4Pbv5RmJaEDsUgu51XnAGGYU8qa 1/+8+I61uDIoIWmJ2pYcu3X0si8+MJn8264rQPGrVe9+iu4H7GyJmJAO2bSCfZYTZ5 CbKyAkUBS9Kdr2o74McRWWKQ6yr8/U2V2xdV4+Mp5yOiKfFeAgs/UOQptJU7vix4g8 KnvAILqoVXIMg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E55066951A; Mon, 19 Jan 2026 14:49:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:29 -0700 Message-ID: <20260119214846.3087611-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NEPN3HUMHBLP4EX7IJTKYV6MDAOKWGXN X-Message-ID-Hash: NEPN3HUMHBLP4EX7IJTKYV6MDAOKWGXN 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 04/16] ext4l: Move data_race, might_sleep, fallthrough to standard 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 data_race() to linux/compiler.h and might_sleep() to linux/kernel.h where they belong. The fallthrough attribute is already provided by linux/compiler_attributes.h, so just remove the duplicate definition. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 10 +++------- include/linux/compiler.h | 8 ++++++++ include/linux/kernel.h | 8 ++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 0b3b2d6f2e5..564e63d6882 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -123,7 +123,7 @@ /* Pointer check macros */ #define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= PAGE_SIZE) -#define data_race(expr) (expr) +/* 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 */ @@ -191,8 +191,7 @@ extern struct user_namespace init_user_ns; #define BUG_ON(cond) do { (void)(cond); } while (0) #define BUG() do { } while (0) -/* might_sleep - stub */ -#define might_sleep() do { } while (0) +/* might_sleep is in linux/kernel.h */ /* sb_rdonly is in linux/super.h */ @@ -642,10 +641,7 @@ struct dx_hash_info { do { } while (0) #endif -/* fallthrough annotation */ -#ifndef fallthrough -#define fallthrough __attribute__((__fallthrough__)) -#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 */ diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 09cea0e95e2..c1131fe886b 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -352,4 +352,12 @@ static inline void *offset_to_ptr(const int *off) /* &a[0] degrades to a pointer: a different type from an array */ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) +/* + * data_race - mark data race intentional + * + * In U-Boot (single-threaded), no actual data races are possible, + * so just evaluate the expression. + */ +#define data_race(expr) (expr) + #endif /* __LINUX_COMPILER_H */ diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d6cd54f20b9..0da0d4915ec 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -313,4 +313,12 @@ enum system_states { #define system_state SYSTEM_RUNNING +/* + * might_sleep - indicate that a function may sleep + * + * U-Boot is single-threaded and doesn't have a scheduler, so this is a no-op. + */ +#define might_sleep() do { } while (0) +#define might_sleep_if(cond) do { } while (0) + #endif From patchwork Mon Jan 19 21:48: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: 1662 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=1768859364; bh=xOg/SZqP28kenMuxUTlbtpJ1HjgIyh9Czuc6MiJJqHc=; 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=HgiC0qQRcVR61zqhb6tm6UEtT1qFP8AuLnjQ8Ew/A2eGtzQqulUMkNnI+Y4/GoeMx FGTJtCmkXOSW426dpZcrtexoC9ukRM+u1TL4u3tbED5WhB19GxDirDN2gDlicMXLe0 qs3g/tBpy1kDfRT0DzfycfTfHjKPwOr7vJsO++txxXtI7NLm6CpVhGqVYBIyQ8lq5A 1NP2wN30cVCfbp49XmRQkbcGB1toSzRkhCCdlJqgNvNWEIXJh+jd/BpDppve+prb3H M6n1+G7DUcAk3+vbXqhXICj2fL82TrTv5CAf4/D081kT+ZkebmdHgh39CXz4LMfT4s wL/PYPwRY4IzA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9FF2B69536 for ; Mon, 19 Jan 2026 14:49: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 10024) with ESMTP id ZSi1mUsKJkH6 for ; Mon, 19 Jan 2026 14:49:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859364; bh=xOg/SZqP28kenMuxUTlbtpJ1HjgIyh9Czuc6MiJJqHc=; 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=HgiC0qQRcVR61zqhb6tm6UEtT1qFP8AuLnjQ8Ew/A2eGtzQqulUMkNnI+Y4/GoeMx FGTJtCmkXOSW426dpZcrtexoC9ukRM+u1TL4u3tbED5WhB19GxDirDN2gDlicMXLe0 qs3g/tBpy1kDfRT0DzfycfTfHjKPwOr7vJsO++txxXtI7NLm6CpVhGqVYBIyQ8lq5A 1NP2wN30cVCfbp49XmRQkbcGB1toSzRkhCCdlJqgNvNWEIXJh+jd/BpDppve+prb3H M6n1+G7DUcAk3+vbXqhXICj2fL82TrTv5CAf4/D081kT+ZkebmdHgh39CXz4LMfT4s wL/PYPwRY4IzA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8EFD169533 for ; Mon, 19 Jan 2026 14:49:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859362; bh=7z9+hMiUlDzwwGHWeiX0tlGACSLtZzRo11/2ce2+0LQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAUxWm1TCXsQoG0UlhuTdZ+xs5E3YevbLailOVHxeBbl7a6wyFxytKdPEgW2t3G33 Tr72Ezar+z8IuX7oobiMlWzyFWTPhzK1VM7I5Jo3kf+w7EpIGlfzEKT5servqju06A 0GDsJNlP9kYyE1+WsngAgIBh9EGgZgB69L0+290kmQ9Xd7rsohmQRnEEeDm5cCCGwj CsbTry9fNrZQHjWMlDp8ucDm5gpcstk3Xa6DHe9xvLxq1YADhRs/1PCnFsf/AjPgWG +WQJanO0y1fOGRSG1+Uix8XJ8lvzgunLTeMspkvDq6+U4iEFLCs508Hu1B/Q1p/gX3 h2w19Nx8nqEIw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D143F69525; Mon, 19 Jan 2026 14:49: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 3ToQzFy6ARgE; Mon, 19 Jan 2026 14:49:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859358; bh=yzx3B7aIUgbhKB5b8L3t2uCmgsI8/EFWtK4f9t2vB3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cN+POzi5sOPEXHaxHNSaXKDOuCnpkk5vkZiw4S7TtjtCyYP8LwjLMC2mc445egx/f zhWP7kILJISoMCJDOR2QxHwQadbNYNvYPCWNZ3OkCu5mcr4LD6i5hxXumngt0covHP HRJzT5BU0wZ5VHObOHBSEUmWAEpwp/+AiQz3bbPeQkRvfQ2ViJi6h2CYBuXf1bSIMo yhFjbnZV8t/tThyCGyyIx3dDanAvobJr+x9EXgBvQKnpUQrChK1tjLC0/Frqe2DVp6 DnNyLGQM7AR1Ovjpg7eZKfHUZk0zwcra6S6eMhKw9cxXE/KIusUllxU/y7BAtMPvGF xBW+5GEc9wrcg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 83F846951A; Mon, 19 Jan 2026 14:49:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:30 -0700 Message-ID: <20260119214846.3087611-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TGWHLLF2FDVWSPL7TNJTV673XTBUXO4H X-Message-ID-Hash: TGWHLLF2FDVWSPL7TNJTV673XTBUXO4H 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/16] ext4l: Move _RET_IP_, _THIS_IP_, BITS_PER_BYTE to standard 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 _RET_IP_ and _THIS_IP_ instruction pointer macros to linux/kernel.h where they belong. Remove the redundant BITS_PER_BYTE definition since it is already provided by linux/bitops.h. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 10 +++------- include/linux/kernel.h | 9 +++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 564e63d6882..4931bd25cea 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -113,7 +113,7 @@ /* lockdep stubs - needed before jbd2.h is included */ #include -#define _THIS_IP_ ((unsigned long)0) +/* _THIS_IP_ is in linux/kernel.h */ /* completion - use Linux header */ #include @@ -318,8 +318,7 @@ void iput(struct inode *inode); /* current task - from linux/sched.h */ #include -/* _RET_IP_ - return instruction pointer */ -#define _RET_IP_ ((unsigned long)__builtin_return_address(0)) +/* _RET_IP_ is in linux/kernel.h */ /* SB_FREEZE_* constants are in linux/fs.h */ @@ -663,10 +662,7 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) return ret; } -/* BITS_PER_BYTE */ -#ifndef BITS_PER_BYTE -#define BITS_PER_BYTE 8 -#endif +/* BITS_PER_BYTE is in linux/bitops.h */ /* extents.c stubs */ diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0da0d4915ec..1442d620e9e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -321,4 +321,13 @@ enum system_states { #define might_sleep() do { } while (0) #define might_sleep_if(cond) do { } while (0) +/* + * _RET_IP_ and _THIS_IP_ - instruction pointer macros + * + * _RET_IP_: return address of current function + * _THIS_IP_: current instruction pointer (stub - lockdep not used in U-Boot) + */ +#define _RET_IP_ ((unsigned long)__builtin_return_address(0)) +#define _THIS_IP_ ((unsigned long)0) + #endif From patchwork Mon Jan 19 21:48: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: 1663 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=1768859370; bh=F9K58MuRYJ5LjSORQ8AJmojODmLbrbg15jo/GtY1s88=; 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=qAJn3toFXJ7HH5QQROkNH+i/gSnPytJkS7NGXhIVJaAATzWgex9EYiVuyD/f56yyS NdbPCUVnEFy8y21HsgLZ7/ITFnOQQLu/i8oqouSCxafI+YCLYWcz50F9AqsJaece5e 6sd3TflvryM0xSbAYlmunhGSZo5s9hLtUEypoW7IOh1AY5w86nQ2k6tON0OesdfMty KsLAt+ADOsVbIKFFp9DdIn01B+dNQ009B6IOfsDuSvVh7oziTceiCMax4VRN/wvZXJ RORaPlASTWEWvLrtxxxD7f8T1xFmXEq7aegxXSA+hbRRz+71xnpUGxTDktlkmI+FwN 59paSId+8pKrg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 165F869535 for ; Mon, 19 Jan 2026 14:49: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 10024) with ESMTP id yjxZQtjNVVi7 for ; Mon, 19 Jan 2026 14:49:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859370; bh=F9K58MuRYJ5LjSORQ8AJmojODmLbrbg15jo/GtY1s88=; 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=qAJn3toFXJ7HH5QQROkNH+i/gSnPytJkS7NGXhIVJaAATzWgex9EYiVuyD/f56yyS NdbPCUVnEFy8y21HsgLZ7/ITFnOQQLu/i8oqouSCxafI+YCLYWcz50F9AqsJaece5e 6sd3TflvryM0xSbAYlmunhGSZo5s9hLtUEypoW7IOh1AY5w86nQ2k6tON0OesdfMty KsLAt+ADOsVbIKFFp9DdIn01B+dNQ009B6IOfsDuSvVh7oziTceiCMax4VRN/wvZXJ RORaPlASTWEWvLrtxxxD7f8T1xFmXEq7aegxXSA+hbRRz+71xnpUGxTDktlkmI+FwN 59paSId+8pKrg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 03AD369525 for ; Mon, 19 Jan 2026 14:49:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859367; bh=D9tqHdCTc61zeUYJOPbpnEP7zDhIFY1lChv27riGbqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rZop2oGXQk4Xq052koUPBJUpaarMfm4Em8fdjRfI3vyzbIQt9XSWE/zokVNmx9g98 udJs51st+35A8x+0qg0l8b0gbotufV1BzaJR7CVinBKCt09+VjrZknFxa1DCb09HRi jmpUHoW+ietd4LxzH2RAtQtR7OCe5ZELQbG7QDB3K20MTJdvPFL3Bb/3kA+IhPnMFX 5WNINkKMDQa6/8uttWfVRPrT/IqYxiVS9eRTXUgB/Bbge8xlU0PAVq5OfqIj/AJS1Q o6xRS0kzGK3f6z8Gb/HksT5fPm+A96RAscZba0mH3rCK7eRw65yyk+2iGSpYqAcvFt L0JXtyJkJAMgg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6C2BD69520; Mon, 19 Jan 2026 14:49: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 10026) with ESMTP id E_6DdTvFKl89; Mon, 19 Jan 2026 14:49:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859363; bh=8i6oX2dZH10IxC1+5EGaes29O8XJy0ODg2tOxSxnfU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o3Fxk3Mhm2x37bI34CSPYwaAw9W6eC51iZuEeH5cUZcGpjqu8c9F5JYnFUukQeA0s eCVn2u4yt2wbc2gPlLBfQOC2f/9N30f/+cSh6g5falSEXlHb+e+l7ud+y5Q6onsQLG fdmm5sXLr7Bvolm95fbVZD6sWEcQUoeGm6kTyY21tb5omz5qTlJQq5ovRTwlpsoNBI 5wl4xWe5t+EXG7YSs5IgVktawt3lpH9yAZgg1+Tj9wZpd7pwK0IbiZeJOKM+VIR834 sW1kJg7mtgOP6DYBIbsU4/xBd4Y+pZ/mImOc5+A92yf2/pqcbDuoN8a0pw1atKyqMg 8SJzLQR32b0tg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 235C96951A; Mon, 19 Jan 2026 14:49:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:31 -0700 Message-ID: <20260119214846.3087611-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AQ52J6SJJX2HYCZV5XEEQMYQ6YC3OZR2 X-Message-ID-Hash: AQ52J6SJJX2HYCZV5XEEQMYQ6YC3OZR2 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/16] ext4l: Move user_namespace to linux/cred.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 struct user_namespace stub and init_user_ns extern declaration to include/linux/cred.h where they belong with other credential-related definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 +----- include/linux/cred.h | 9 +++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4931bd25cea..55a06d01996 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -174,11 +174,7 @@ static inline void memalloc_nofs_restore(unsigned int flags) { } /* IS_ENCRYPTED and FSCRYPT_SET_CONTEXT_MAX_SIZE are in ext4_fscrypt.h */ #define S_NOQUOTA 0 -/* User namespace - stub */ -struct user_namespace { - int dummy; -}; -extern struct user_namespace init_user_ns; +/* user_namespace and init_user_ns are in linux/cred.h */ /* * BUG_ON / BUG - stubs (not using linux/bug.h which panics) diff --git a/include/linux/cred.h b/include/linux/cred.h index a5afc267ba0..a3a972a5a73 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h @@ -50,4 +50,13 @@ struct cred { #define INVALID_UID ((kuid_t){-1}) #define INVALID_GID ((kgid_t){-1}) +/* + * User namespace stub - U-Boot doesn't have namespaces. + */ +struct user_namespace { + int dummy; +}; + +extern struct user_namespace init_user_ns; + #endif /* _LINUX_CRED_H */ From patchwork Mon Jan 19 21:48: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: 1664 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=1768859374; bh=FgfDxMYhf6TZQiF2RyVEerJWc8bAyS9Y3OncwHeCAvY=; 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=m66x+u18k/PZKUSA9i2X2/A3esJJ69tOyqJLslAjzPLXs+Ik7MyrUjn3jVTz5TcA2 onWL9XtIlofHSKIeEdv45OUXbCAzSl8gMxTmFx6B/imt1JwRxj7Yxf0QTG9dvg8OIT ajY/YFZIPEIAZy+WhfKTV0QKiKU5/PdBCzk9ERJtFKupQwAgebXAar8nGhNRTnXuXL sghcqqg0yQG2i/E9cE7dLYzY4U19RXAAzaNLBuHZ335a0vbupcLDJcZdDQdxGHD25i Op+iNCrAIzvjGXTDXBTX98CIo6LgiqCRnq2kNv2sbGYBWIn9FhpSHw53d6E1IiOCGc e9IsVJisQvCAw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D8BFE69536 for ; Mon, 19 Jan 2026 14:49: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 10024) with ESMTP id yxKF0Zg0mVlu for ; Mon, 19 Jan 2026 14:49:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859374; bh=FgfDxMYhf6TZQiF2RyVEerJWc8bAyS9Y3OncwHeCAvY=; 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=m66x+u18k/PZKUSA9i2X2/A3esJJ69tOyqJLslAjzPLXs+Ik7MyrUjn3jVTz5TcA2 onWL9XtIlofHSKIeEdv45OUXbCAzSl8gMxTmFx6B/imt1JwRxj7Yxf0QTG9dvg8OIT ajY/YFZIPEIAZy+WhfKTV0QKiKU5/PdBCzk9ERJtFKupQwAgebXAar8nGhNRTnXuXL sghcqqg0yQG2i/E9cE7dLYzY4U19RXAAzaNLBuHZ335a0vbupcLDJcZdDQdxGHD25i Op+iNCrAIzvjGXTDXBTX98CIo6LgiqCRnq2kNv2sbGYBWIn9FhpSHw53d6E1IiOCGc e9IsVJisQvCAw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C6C6769533 for ; Mon, 19 Jan 2026 14:49:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859372; bh=JIeVnddmUabzpxmxWc9Ygci7fCJLanzDAew9A1gP5BQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NIErijttDk+BzqLTGfFURu6zEAL/op2JCbL2RosnMVltK3WDRHpATcLKqo2BvEwRM vYmyt1Gn1OPEw8SWm8M2Yl53ZIvTcoUiZsh+6ka1wMoovzLHSilHPTsFAEyO9OQwYi e5aW8wSb7eeOrPzQBTCJZjK0cSdnbcz1u5dPZBMwlLVtJLqD6He1yK4M3KMk8ZD0Qc f+9vny/wAgkRHRbp8k9TkBA+S6f7axMkfSo0byRaYHV87RY96V6H/+H+Th/KbDMGAz VQLZR5PXxFzqGC6Z5VHqSQZAPvjMvsXKaDZcOJs5VPcE2jn4mM+jyNOoNZpqLfk2ux TYY53eeauG9Zg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BBA4369533; Mon, 19 Jan 2026 14:49: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 10026) with ESMTP id 7447d8ElCTXj; Mon, 19 Jan 2026 14:49:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859367; bh=0uAocTSn5U5YbcKYemNLf9NLMAXbzosz6J999bVnDgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NdjIXb6Y0sGY3Yjg3MNTMSg3a9AgHhhFsjevXKLxSjPMsvbnkjJPqHI5P+sQD04xQ b9wd534bhfQvsqbZQMcsldB4WHkBeoXMJ0DGGsavXiSxLToVZ6kLzGb0tHO5nP8RA1 IBkzEuvmCXyVnMj2kT+PcDTP2fUag5bgwqYYKxNEZw0ll3cYvmp7KZOI0S6lc/oONd NbzW1o3gnSEufrNhCCmXlPvjmgFj6gGyNWzym3+sCJLjEHJOFupgfa+YvVZVcON2CA 0hG1qoAr7z7FhbYr0AeeZfeiTK5JchLh1QHczd7khjaF9dcKqV3jAu45H+PHoMxKnz vWcXzFFhrW5Ew== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AD7D26951A; Mon, 19 Jan 2026 14:49:27 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:32 -0700 Message-ID: <20260119214846.3087611-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KXIMSVJ2O6Y75HTRRGVJGPU654WQZPXJ X-Message-ID-Hash: KXIMSVJ2O6Y75HTRRGVJGPU654WQZPXJ 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 07/16] ext4l: Move fstrim_range 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 struct fstrim_range to include/linux/fs.h where it belongs in the Linux kernel header hierarchy. This structure is used for FITRIM ioctl. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 +------ include/linux/fs.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 55a06d01996..91d432d391d 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -395,12 +395,7 @@ typedef long long qsize_t; /* mnt_idmap - use linux/mnt_idmapping.h */ #include -/* fstrim_range - stub */ -struct fstrim_range { - u64 start; - u64 len; - u64 minlen; -}; +/* fstrim_range is in linux/fs.h */ /* rw_semaphore - defined in linux/rwsem.h, include it */ #include diff --git a/include/linux/fs.h b/include/linux/fs.h index 75e4bd3e951..1b0059ca1a7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -305,4 +305,18 @@ enum { #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) +/** + * struct fstrim_range - fstrim ioctl argument + * @start: first byte to trim + * @len: number of bytes to trim + * @minlen: minimum extent length + * + * Used for FITRIM ioctl to trim unused blocks. + */ +struct fstrim_range { + u64 start; + u64 len; + u64 minlen; +}; + #endif /* _LINUX_FS_H */ From patchwork Mon Jan 19 21:48: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: 1665 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=1768859379; bh=73LpDN364AFBpM0HNt0nzu4hCxfK8CjHSaD9aVLBk/0=; 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=Z5c8Hz+vfQODfpKt5YKouHvmiZbpPMjZWNdH0Ad2Tdkq89Wsb2YXSvL57+L60Ej6L 2giPAFjHKIOHN25r4w+QPljC4bw+gjDRlTka61tE8DxrmNPQT/FjuVZb0FNLXYpcRb EMiH4UNpfdiFOQuoDgwHR18v0Bg8xGEL4m7lHWT+8X52AXHzMHpS68rGK3EnepC4sK Fe55lHbOzn7TRpaCAk2VXnDxrKA3dC0eH8IzBuSBJV7jrSzIk1Cx+QLkBHJdMEIBTP +bFfC6jH+yC5qsd2KqPCZwLafAyyD7igne4azrTUYIq8F1gr+FegW4sulEhG5Xwa5G tEF9q67V4mSSg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5C0AC69536 for ; Mon, 19 Jan 2026 14:49: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 10024) with ESMTP id PGlaY1zasG60 for ; Mon, 19 Jan 2026 14:49:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859379; bh=73LpDN364AFBpM0HNt0nzu4hCxfK8CjHSaD9aVLBk/0=; 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=Z5c8Hz+vfQODfpKt5YKouHvmiZbpPMjZWNdH0Ad2Tdkq89Wsb2YXSvL57+L60Ej6L 2giPAFjHKIOHN25r4w+QPljC4bw+gjDRlTka61tE8DxrmNPQT/FjuVZb0FNLXYpcRb EMiH4UNpfdiFOQuoDgwHR18v0Bg8xGEL4m7lHWT+8X52AXHzMHpS68rGK3EnepC4sK Fe55lHbOzn7TRpaCAk2VXnDxrKA3dC0eH8IzBuSBJV7jrSzIk1Cx+QLkBHJdMEIBTP +bFfC6jH+yC5qsd2KqPCZwLafAyyD7igne4azrTUYIq8F1gr+FegW4sulEhG5Xwa5G tEF9q67V4mSSg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4A60269520 for ; Mon, 19 Jan 2026 14:49:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859377; bh=U29ZNJH2DK4J/SKLbBTBGdNIt1fmUNriGqpd4eKgIZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ib4jeZ/SbhkeDb2UL3tmGRobKa2wIax6OjvuMRtQP2YHyjk5CiGgvaTfDIVPhFc8Q PvqbxkzjRUl+zc2hz2trxw4ao7/BE+gPrk/Z7Nr9HWeu66k20stAgKVOIQjBUdj/AJ 0oxw3OsonIYzAJ1uFeCRP/Qylmf+2McipZdcbxAfMftT+99Q/XP4+3NBl1I8GSze7K z4Xc/blpqTs58h5BCKh6B/bCvcAGoNfMRgxqeP9M/+uS9GkuCOeC3hjGAd1lENnpSv ySca7+C2gqZ4/RPyW8ljSfrLEWNqQ9dfoeMd8ADXUMW7oIoeNef49qesUXTZ0iftGw 25oCQnIfOxzlw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5168D6951A; Mon, 19 Jan 2026 14:49:37 -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 O0pvBRWY1oNV; Mon, 19 Jan 2026 14:49:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859372; bh=vS881n+Qijc76guYGHq9B6I5tqUERJYyXNzRq+Ftzx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jHRgouoO+FzVVzP2pshTaaHerCHSVrtz6MQHYocv1xO+xwte7BKKa8lkCzDQ6JHsy pMfo252PKAIVGSi2LNdjZGhZmZpBo/7Fcazwkores9ZyfxBR9oiVaN7IY8RYhXxt+7 Xw4ogaaXf9tqJ4DwGt5OCLvxgCHJ9Y2ottLKKLMFFNo+rZn/cOFVHpz5okxxpAbYBO 93lkHOrrj48G9x3cvXyRLqg12ZRHsjV/B+QBUindoab/kExXJQ3WzuCrwt4RMrdLcF fOa42FXdR9Nt80lysPguBUDAlgekvPSktJqtNhf28gJ1n8sGx6p1M/qpHs+cIIuGcQ No2c6w3P+deQQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4705A69520; Mon, 19 Jan 2026 14:49:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:33 -0700 Message-ID: <20260119214846.3087611-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SL5Z6CF3YOCGVZ4KSM5YQPBZJFGW3D7Y X-Message-ID-Hash: SL5Z6CF3YOCGVZ4KSM5YQPBZJFGW3D7Y 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 08/16] ext4l: Move qsize_t to linux/quotaops.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 qsize_t typedef to include/linux/quotaops.h where it belongs with other quota-related definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 +-- include/linux/quotaops.h | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 91d432d391d..79d70d78bfd 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -383,8 +383,7 @@ struct readahead_control; struct fiemap_extent_info; struct folio; -/* qsize_t - quota size type */ -typedef long long qsize_t; +/* qsize_t is in linux/quotaops.h */ /* blk_opf_t is in linux/blk_types.h */ diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index b96e33887b8..ff455f4da7b 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -13,6 +13,9 @@ #include +/* qsize_t - quota size type for tracking disk space usage */ +typedef long long qsize_t; + struct inode; struct dentry; struct kqid; From patchwork Mon Jan 19 21:48: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: 1666 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=1768859383; bh=uD22uAQz206AzJ0M0Ao4ZejKdqg+QzkaNxGYVUNFH/Q=; 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=cqrYeIBtex1uW3QMEfCWefWiCylNpfbs0JqVTpIqa67dv+FGcNxNWCxp0bOT5ifxN pJtfZxZ7lJk8X8QOamj2DqW5otYQH/8G0Owzz9QftyVUifkHPf4SdWupWMfYkg5zIX 7/Z445BDdIMM/R1dJVudXoB4FEK4p0pFpk6D8kWx6iPCFlxRv91kVW60pf+9iGK5RC LKeiwY4BumAdMA/8lyJyo4SNJFYiC5wJ7rUy5dvwaT/KZLyq0sbP89ghPCAdx+C3c4 TrD4qNHYl63o4Pb9ApFShmRxzIQGZ2anLSpU+AzCDRcKwlcm3QZRE27BpGvUT1kNVs 2S/Xe5FFdV8kA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CC3EC69520 for ; Mon, 19 Jan 2026 14:49: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 5v52qdKZ-L9C for ; Mon, 19 Jan 2026 14:49:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859383; bh=uD22uAQz206AzJ0M0Ao4ZejKdqg+QzkaNxGYVUNFH/Q=; 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=cqrYeIBtex1uW3QMEfCWefWiCylNpfbs0JqVTpIqa67dv+FGcNxNWCxp0bOT5ifxN pJtfZxZ7lJk8X8QOamj2DqW5otYQH/8G0Owzz9QftyVUifkHPf4SdWupWMfYkg5zIX 7/Z445BDdIMM/R1dJVudXoB4FEK4p0pFpk6D8kWx6iPCFlxRv91kVW60pf+9iGK5RC LKeiwY4BumAdMA/8lyJyo4SNJFYiC5wJ7rUy5dvwaT/KZLyq0sbP89ghPCAdx+C3c4 TrD4qNHYl63o4Pb9ApFShmRxzIQGZ2anLSpU+AzCDRcKwlcm3QZRE27BpGvUT1kNVs 2S/Xe5FFdV8kA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BB23869525 for ; Mon, 19 Jan 2026 14:49:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859381; bh=A5FO+nV5cRdr2P+7Ai0YU5IZPepIrxKtJA5q0CpgjZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLI4iJc9c6xyb9gYjrppsDeNpdF4GtV16MA9/L0RyLfL8AKRZqIM2TREWYGNf5Z/w qUx6l4lzK1nUmzpoWB3m0McTWF+5+HK7Mm5HtCs3qHIsqnvAza75IaZThC4kwl5PAt EzH0HWltznJRwp0DX9vbG0hZvESgfCF6r5hGbATLKYVfNy7LZp72k/qrQATFbftpe9 ZHiO1udiyqsSNGDPBEt5kEJQEUj0jBRCspsuoLNOSuz+paN3bTjm6Dujf7F7g3hEO5 COfKAQUVWDZqiMWZdjzVVsMHZKXIw04rZwiVs8I+4+yp/P0AVFhAExsCfca+bPXuLq xbsz7WPPjs6Bg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B76B569520; Mon, 19 Jan 2026 14:49: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 bQgtvvmKk5mU; Mon, 19 Jan 2026 14:49:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859377; bh=zUcdg0GAaOGOZCEPf4/aef+w3mtH8GArL3aj0KdxZko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZzx0hRiqwMCKQKRpDxiWIFgh0ztLFE/uE1Sc80KYL9kpgp3NhRqd30k29//nMy5B sF7Y45Hh1DsytbbzRxTsVaYWbVzysVROh5Yujfsu2rR7+GAzrU4KxXb+olQ6pl5oLf VUwXAjxuqeleXBGu9HOq5L3ImnpcjBVvla+5tsBDlU1MSr9NbQMi2u7qiJHJ/H/YIr DxBhlrNl19UF+1PQeyty7CET2lTDFDc2xNhEujoDgM4QY7mF2X8DFTRoWW4E4LQTZq l2NnMgyt1h4eL2eKpRWawzLSSHOyEHTzMgda+daZ3bMNQ6vhubK5CooxedZnRU5/hi +bsbMW1UjukXA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CDE0E69533; Mon, 19 Jan 2026 14:49:36 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:34 -0700 Message-ID: <20260119214846.3087611-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MEBK7J4EBQHKSYOZETJ7VDL4SWREXZBK X-Message-ID-Hash: MEBK7J4EBQHKSYOZETJ7VDL4SWREXZBK 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 09/16] ext4l: Move memweight to linux/string.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 memweight() function to include/linux/string.h where it belongs in the Linux kernel header hierarchy. Use an inline popcount algorithm to avoid header include dependencies. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 12 +----------- include/linux/string.h | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 79d70d78bfd..6772fd8328f 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -640,17 +640,7 @@ struct dx_hash_info { /* strtomem_pad is in linux/string.h */ /* strscpy_pad is in linux/string.h */ -/* Memory weight - count set bits */ -static inline unsigned long memweight(const void *ptr, size_t bytes) -{ - unsigned long ret = 0; - const unsigned char *p = ptr; - size_t i; - - for (i = 0; i < bytes; i++) - ret += hweight8(p[i]); - return ret; -} +/* memweight is in linux/string.h */ /* BITS_PER_BYTE is in linux/bitops.h */ diff --git a/include/linux/string.h b/include/linux/string.h index 591d99c46a1..8dff476c60d 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -188,6 +188,30 @@ char *strreplace(char *str, char old, char new); */ #define strscpy_pad(dest, src) strncpy(dest, src, sizeof(dest)) +/** + * memweight - Count total number of bits set in a memory region + * @ptr: Pointer to memory region + * @bytes: Number of bytes to examine + * + * Return: Number of set bits in the memory region + */ +static inline unsigned long memweight(const void *ptr, size_t bytes) +{ + unsigned long ret = 0; + const unsigned char *p = ptr; + size_t i; + + for (i = 0; i < bytes; i++) { + /* Inline popcount for byte */ + unsigned char v = p[i]; + + v = v - ((v >> 1) & 0x55); + v = (v & 0x33) + ((v >> 2) & 0x33); + ret += (v + (v >> 4)) & 0x0f; + } + return ret; +} + #ifdef __cplusplus } #endif From patchwork Mon Jan 19 21:48: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: 1667 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=1768859388; bh=5rsVYaRMNQdCujKTuOgLIVAaLX+xaeAlZ9HJdqQ9MC4=; 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=r2cR9zf0w87acSL+4ZrFo8zvlQm8pApobESbh31mgu9xozUMhX6hT/BBAx6E6ZMys VEPu7nPTyRY84/FGp5ab+v8tNkq2zURS4iexA2uUFMhlJwHIMWTzR0EOrTMjQaB2qq dyJjhKWWqNp/6CR++DWQeHfXAt4CwK2RfA8gTiTuLOX75BVE+wQcVxRJFosl44Km9m jvkq3P1tNgJL9ovRv4Xa6Cwf4ynU1R4dXtNbgfUvFqPOp0Wyxj6kGT+LMW6iF6GYAf wKCnrpaGVGcO+RFfX4RbKkgrR07SvuevKNOEDM1zAUh11aCC8Okh7q1MHPgr3wh8j7 +6ubrrfbk1rRg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A430769535 for ; Mon, 19 Jan 2026 14:49: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 10024) with ESMTP id QubNjojC1kYR for ; Mon, 19 Jan 2026 14:49:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859388; bh=5rsVYaRMNQdCujKTuOgLIVAaLX+xaeAlZ9HJdqQ9MC4=; 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=r2cR9zf0w87acSL+4ZrFo8zvlQm8pApobESbh31mgu9xozUMhX6hT/BBAx6E6ZMys VEPu7nPTyRY84/FGp5ab+v8tNkq2zURS4iexA2uUFMhlJwHIMWTzR0EOrTMjQaB2qq dyJjhKWWqNp/6CR++DWQeHfXAt4CwK2RfA8gTiTuLOX75BVE+wQcVxRJFosl44Km9m jvkq3P1tNgJL9ovRv4Xa6Cwf4ynU1R4dXtNbgfUvFqPOp0Wyxj6kGT+LMW6iF6GYAf wKCnrpaGVGcO+RFfX4RbKkgrR07SvuevKNOEDM1zAUh11aCC8Okh7q1MHPgr3wh8j7 +6ubrrfbk1rRg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8F52A69525 for ; Mon, 19 Jan 2026 14:49:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859385; bh=HfYCcc0/z824C4h2MbcWelx/uGR8KKh7kFLV6+TAmIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tIP6Tbvih45l8SvEF+SbmfKjD8+KX3nVpvFUFqSeNcQfTLESJMwB7IQfsz1+GXEpl Jn9AJKbgCcCPI/7/MwE1T27zauBnOJnsA0rCZACc4VVPYruno4IGlgdlPvGgLzYCey DNQ4MlTlWGeVZKq7ebMlOUMbZ15ccVbeC526aR2FN+QfN3qwhrHKrzdSpu4eypISWK 8EkCKSX3QMM5Kf2Ylx8QaVNUu+j33n2KD4T9WHwozrCa5tYVjAzunbfyLGCdTTvA95 ZOAs2fzwRgAPOXi+9sf/e4r2e+PGqjHCE5NeaXH+v6nhD24Ko4/IJdoaY7iYTTLL/Q gO4iDRP0TUqJA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AFD9E69520; Mon, 19 Jan 2026 14:49:45 -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 AqjTMEFbAc0a; Mon, 19 Jan 2026 14:49:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859381; bh=DaLJRYYOT3f54R4+sqypDAT2/ln288V+0p7J2A2rarA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AdMnMMloEyOXCFZYKyk1eLTR5okkQukfv3oLktQPy41Qmgd+hMTOZAWY74+ayFNvk j+K8F4kHew8ySTSapKqvwQX3wXAbDHErScYm02x7f0n9qfY9Z2IxZglEEZ8FAGss1e Yj2dlPm4nQhouTu9Q/E/gpFE//vLonHIJvoPKye3CN1001QK1aTTPU9hPwCfNpHNZW hNJPmUG+1OPmzFj7YGCmJfex3EpZb4efHY5j6U595kkjUG+q8u2wYDSLX+/W6NHNr+ xLfZbE9IfY+f1XpSzs6NHje8V19/Z2MU1e0ndSfESafvrYRd/HUBs4fjU/UG7eEz+a 0hkD0Wgz0ipQQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 686896951A; Mon, 19 Jan 2026 14:49:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:35 -0700 Message-ID: <20260119214846.3087611-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UA4EWFX7L7PKUC7TVRVOGOMUB4MIG27W X-Message-ID-Hash: UA4EWFX7L7PKUC7TVRVOGOMUB4MIG27W 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 10/16] ext4l: Add linux/highuid.h and move UID/GID helpers 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 include/linux/highuid.h with the low_16_bits(), high_16_bits(), fs_high2lowuid(), and fs_high2lowgid() macros. These helpers are used for 16/32-bit UID/GID conversion in filesystem code. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 ++----- include/linux/highuid.h | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 include/linux/highuid.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 6772fd8328f..69c50d406f7 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -864,11 +864,8 @@ static inline unsigned int i_gid_read(const struct inode *inode) /* Device encoding helpers are now in linux/kdev_t.h */ #include -/* UID/GID bit helpers */ -#define low_16_bits(x) ((x) & 0xFFFF) -#define high_16_bits(x) (((x) >> 16) & 0xFFFF) -#define fs_high2lowuid(uid) ((uid) & 0xFFFF) -#define fs_high2lowgid(gid) ((gid) & 0xFFFF) +/* 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); diff --git a/include/linux/highuid.h b/include/linux/highuid.h new file mode 100644 index 00000000000..9bffa16b0aa --- /dev/null +++ b/include/linux/highuid.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * High UID/GID to low UID/GID conversion helpers + * + * Based on Linux highuid.h + */ +#ifndef _LINUX_HIGHUID_H +#define _LINUX_HIGHUID_H + +/* + * U-Boot doesn't support 16-bit UIDs/GIDs overflow handling, + * so these are simplified versions. + */ +#define low_16_bits(x) ((x) & 0xFFFF) +#define high_16_bits(x) (((x) >> 16) & 0xFFFF) +#define fs_high2lowuid(uid) ((uid) & 0xFFFF) +#define fs_high2lowgid(gid) ((gid) & 0xFFFF) + +#endif /* _LINUX_HIGHUID_H */ From patchwork Mon Jan 19 21:48: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: 1668 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=1768859392; bh=REtq13a6qC7QE+stgZudgupr8m494YXYOVSr2sNEu04=; 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=nD0ayLPNmbqisdArQpINY95K/yPqPvQ45AP9DGukgAQ50K0LMrQwul/+KeTvg65MW MAMZRFd/WMfaOf3YYR1UsumrFcjpFDV1IW1PrxmnBEwctVmfJvb4FPDhlOyFv59lVl y/igXaMrLrajQzRyJozBntl+OzK8RJGP5QW0AecxzW4FIQIewKPvdAinWw8RPrVGpy JGqPQhZR9vIWaaUZ05BxY2FpGAZo2XoO/dg1AfWodziAHV50XkgxyY6oBryQcLyRhK Uw8LDkPLORcm4zsi0a7yJEdXv+d4Ga8RTrgm541zMjy8x8rLSFrIzQQsGFlQeTjJDf rTnwsYR65LLhQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2EA3469520 for ; Mon, 19 Jan 2026 14:49:52 -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 HJ_h25z-E609 for ; Mon, 19 Jan 2026 14:49:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859392; bh=REtq13a6qC7QE+stgZudgupr8m494YXYOVSr2sNEu04=; 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=nD0ayLPNmbqisdArQpINY95K/yPqPvQ45AP9DGukgAQ50K0LMrQwul/+KeTvg65MW MAMZRFd/WMfaOf3YYR1UsumrFcjpFDV1IW1PrxmnBEwctVmfJvb4FPDhlOyFv59lVl y/igXaMrLrajQzRyJozBntl+OzK8RJGP5QW0AecxzW4FIQIewKPvdAinWw8RPrVGpy JGqPQhZR9vIWaaUZ05BxY2FpGAZo2XoO/dg1AfWodziAHV50XkgxyY6oBryQcLyRhK Uw8LDkPLORcm4zsi0a7yJEdXv+d4Ga8RTrgm541zMjy8x8rLSFrIzQQsGFlQeTjJDf rTnwsYR65LLhQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1C57869525 for ; Mon, 19 Jan 2026 14:49:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859390; bh=SmMDTRCv+4Uin1kF3go+xXdUadGb0RNQBMT2R/f+Xyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MmEgt1/MBFXUDL/+nU0Aq47z7KVUreAvWckOELhk3Zc4Cq9N28z6NM35RROm/WRc9 J4u/8Drpprq/lOSv4Ut002/VMbE13KRSgun4mVtXvL8fdMUAYPwwwvNZ8cBBLDxOV/ ju72VKcJFe4UZQkuFSIJ7GjRkYln8kuUYIRkaOaWACOVeunhoY1Tzhz2+okL7naqHh ogXXr4Q+10JIW+f2ANCLYr8g7Z6RAUwzqN0XKY604zJ6N1HIeeiaAmpKnGwwnJsOyj 27pZoCq6oh4y5bwkMBWh/cdcAmX91PgeNcsDHdaAXu549cAn4kpG8vnyn461++JYJO l+cNUlXUwmKmg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 43E1469520; Mon, 19 Jan 2026 14:49:50 -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 mvpJ2vMrtF6u; Mon, 19 Jan 2026 14:49:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859386; bh=PJn3hJoKbR2PL9u6UalxuNpHITHx6+UoSZW5aOrexJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OtyoEDMbUp+AEXS+r+GyRU9e84y1/OWf0SKjtkWrnCN+0xH7Q3fpJ1j2lqSNovZx3 0ciykYnm2kN7XSZExsvX0BC7/WpTF1Sz0YdXxDKO8qISgUdMKmzzqZ5oX62TBH5zV9 D73lQ9EYO/8rqbHWIowlgpYesocPnf3e6ECWZ56MBFZN1zcDzP0etjA0xR4S9A4YK0 TGNAijHAerxR/R0cK8uCyZSXyf05tHpxD3slAkbu6oAZs3EiGa11BxhNY6mLtl1kov 1cZTUqMzZCPy24S0EUbQAXjvcDMwVWOndUcPpmNsiNs2NCZVtKuQckh4qI39j5Cuvs SOuYS7OyTyXmw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F1C416951A; Mon, 19 Jan 2026 14:49:45 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:36 -0700 Message-ID: <20260119214846.3087611-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 45GHAYIVN56CRJBNW7D6EG56EK4BOSDU X-Message-ID-Hash: 45GHAYIVN56CRJBNW7D6EG56EK4BOSDU 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/16] ext4l: Add linux/overflow.h and move struct_size 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 include/linux/overflow.h with the struct_size() macro that calculates the size of a structure with a trailing flexible array member. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ++-- include/linux/overflow.h | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 include/linux/overflow.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 69c50d406f7..310d79227b7 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -923,8 +923,8 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); ssize_t generic_read_dir(struct file *f, char __user *buf, size_t count, loff_t *ppos); -/* struct_size helper */ -#define struct_size(p, member, count) (sizeof(*(p)) + sizeof((p)->member[0]) * (count)) +/* struct_size - use linux/overflow.h */ +#include /* file_operations - extended for dir.c */ struct file_operations { diff --git a/include/linux/overflow.h b/include/linux/overflow.h new file mode 100644 index 00000000000..672377ede42 --- /dev/null +++ b/include/linux/overflow.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Overflow checking utilities + * + * Based on Linux overflow.h + */ +#ifndef _LINUX_OVERFLOW_H +#define _LINUX_OVERFLOW_H + +#include + +/** + * struct_size() - Calculate size of structure with trailing array member + * @p: Pointer to the structure + * @member: Name of the array member + * @count: Number of elements in the array + * + * Return: Total size of the structure including @count array elements + */ +#define struct_size(p, member, count) \ + (sizeof(*(p)) + sizeof((p)->member[0]) * (count)) + +#endif /* _LINUX_OVERFLOW_H */ From patchwork Mon Jan 19 21:48: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: 1669 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=1768859397; bh=Ofp/1dD4BEWsYjKzZIWrFq11B+4Nc9UxL5a9+XZsJx4=; 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=SB26Z6c6gP75cObQyaVCcU3SBl64QreLfbqr8QPpIUI6Qyd1vVARuM2iqcU2C9JM4 fjGiEFWbORgMOuMiQnuj4oLQSC+Rj9gT1aoLkHz+VUz/qNe8CWFLbxmS3jnKbKkVv8 nReO5hFWx6VoX0T+01eIiT1a9xzOFULqdjJiK6uYl3lFYMi3sePnbM6DiafSw/Yrpi bIpKGM4r/VpR+iwxXWf/4dI8fc9OBw9rehvEXEzcstfNeCEhByrtuEfI4HHZznTxqc kVOkkHkLgEqb0NUeUAauaLkz3BHZeGs+yBwe5oJXSEuH1NyUzLr8vOntAnaWHcKIJB 9+oURoG8BcevQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B1ADA69535 for ; Mon, 19 Jan 2026 14:49:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GXvJvb1kJ9wS for ; Mon, 19 Jan 2026 14:49:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859397; bh=Ofp/1dD4BEWsYjKzZIWrFq11B+4Nc9UxL5a9+XZsJx4=; 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=SB26Z6c6gP75cObQyaVCcU3SBl64QreLfbqr8QPpIUI6Qyd1vVARuM2iqcU2C9JM4 fjGiEFWbORgMOuMiQnuj4oLQSC+Rj9gT1aoLkHz+VUz/qNe8CWFLbxmS3jnKbKkVv8 nReO5hFWx6VoX0T+01eIiT1a9xzOFULqdjJiK6uYl3lFYMi3sePnbM6DiafSw/Yrpi bIpKGM4r/VpR+iwxXWf/4dI8fc9OBw9rehvEXEzcstfNeCEhByrtuEfI4HHZznTxqc kVOkkHkLgEqb0NUeUAauaLkz3BHZeGs+yBwe5oJXSEuH1NyUzLr8vOntAnaWHcKIJB 9+oURoG8BcevQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9FEBF69525 for ; Mon, 19 Jan 2026 14:49:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859394; bh=LtXgh8qBBrEK05migKKQeb4uZL4FN+alIEj2gwZTN8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aECORFQgy0qP/r9AhmJu8xoHrrgnPdu0a8LCGuHoLZojhFpiJ1tRf93FmHEEyELim KiPaq1JZPx3wHv0Vvh8gg5UG1AAY5P4qnShCq74nZGAtQe4aimHkrGAthvo5VOpKQy WQatrFzWAVeOXOHPjslGwfRqzqRGwdHRsKVgG5pqqSR/s1nWzIq5iqxrtjRVmwvnjA k7dmhmiFwc6WPLiuUof1GpTJ/7JUtxSdTY60NAlP3yO7B5MUoPS94u1JbogH5Mncp1 U/CD2T+o/dPANiFMFSHtUISV2SrqdStRo6GqdChIek7f5MSURaYPjPBAcvYE4MZ75e L4vqY6cQ5i/BQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DCD0669520; Mon, 19 Jan 2026 14:49: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 10026) with ESMTP id Uc31sJJd38t8; Mon, 19 Jan 2026 14:49:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859390; bh=H+c5TDP+Srd+TPSEk7F3uPasblsWGSWdbkIdjT0iECk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sBwoJ7H1lYoOJAznTVRL3P7e+/tsEGM99dkhi0INL4p0UoKtXy69hEeXLsvIopgkH MtOMSrguMx3MQOMchcqWRPDgdFle390XoYvAqdF2N5tXnaZ9RvsfHev6ZW8thEqr02 5JoMXZdlFMsl3FYOEkL5/dYD3U3AVEXiMEEFxxAFa3puEbjLKtbSz4HF2GqFUC3V40 h15owmzgMoopbmR4izPRDvQoUUghKNHOxBhqTway0pZuoAus9eDGTxgRreZ1dJn7jb RP2jVMBNoe6eYrMYmbbJ49IghFC2TAILNUQTZuo+JGy9nCBWt8q0QqFgeOZIphIXyo wB9B8VLwCUfcQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8AC1C6951A; Mon, 19 Jan 2026 14:49:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:37 -0700 Message-ID: <20260119214846.3087611-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3NK3Y5E5TBIWRAHY3K42PXO54QTIP7JM X-Message-ID-Hash: 3NK3Y5E5TBIWRAHY3K42PXO54QTIP7JM 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/16] ext4l: Move umin to linux/minmax.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 umin() macro to include/linux/minmax.h and add the matching umax() macro. These return the minimum/maximum of two unsigned values. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 +-- include/linux/minmax.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 310d79227b7..b50004bca55 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -699,8 +699,7 @@ struct dx_hash_info { /* indirect.c stubs */ -/* umin - unsigned min (Linux 6.x) */ -#define umin(x, y) ((x) < (y) ? (x) : (y)) +/* umin is in linux/minmax.h */ /* truncate_inode_pages is in linux/pagemap.h */ diff --git a/include/linux/minmax.h b/include/linux/minmax.h index 52ce477459d..38b27c0232f 100644 --- a/include/linux/minmax.h +++ b/include/linux/minmax.h @@ -49,4 +49,22 @@ static inline bool in_range32(u32 val, u32 start, u32 len) return (val - start) < len; } +/** + * umin - Return the minimum of two unsigned values + * @x: First value + * @y: Second value + * + * Return: The smaller of @x and @y + */ +#define umin(x, y) ((x) < (y) ? (x) : (y)) + +/** + * umax - Return the maximum of two unsigned values + * @x: First value + * @y: Second value + * + * Return: The larger of @x and @y + */ +#define umax(x, y) ((x) > (y) ? (x) : (y)) + #endif /* _LINUX_MINMAX_H */ From patchwork Mon Jan 19 21:48: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: 1670 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=1768859402; bh=/jFSrLNMti+wH0yMiPOwpRb9Boo35q7QnuVOOzLkpZA=; 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=MMBleu+vVA21DT5TWU1HLOnJ3fxZybA4AgmmXccsvvaWJRwL3nnjjp+BaVOdEdAVA ELvwWWIQUk3O2ezPf0UyfXIA5uO54bQ/VR7cc864csvjsc8vCPFXcTWBeb2e54NUXZ pv+fk6WQlL/RQae2WczvfrTc0mOuzgGoPK+vGyb/rb9TQ3PtSzzEQdgAfM/gt3KQsA op9xJSdKfpVbPTXmM6nfI4bsp13I9wgrwhDCm9IXug3cjGJHlVMoOIYpsm67Qj/9k5 11mRH8X2T42JWTjDwRqLz2hcrVQpA+Ot5DVPgaegcLfiwaECiseXxSJ0w1W52pgYDK 3AQ6TMdEXjE8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3286E6951A for ; Mon, 19 Jan 2026 14:50: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 6gCkoi3uIeJB for ; Mon, 19 Jan 2026 14:50:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859402; bh=/jFSrLNMti+wH0yMiPOwpRb9Boo35q7QnuVOOzLkpZA=; 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=MMBleu+vVA21DT5TWU1HLOnJ3fxZybA4AgmmXccsvvaWJRwL3nnjjp+BaVOdEdAVA ELvwWWIQUk3O2ezPf0UyfXIA5uO54bQ/VR7cc864csvjsc8vCPFXcTWBeb2e54NUXZ pv+fk6WQlL/RQae2WczvfrTc0mOuzgGoPK+vGyb/rb9TQ3PtSzzEQdgAfM/gt3KQsA op9xJSdKfpVbPTXmM6nfI4bsp13I9wgrwhDCm9IXug3cjGJHlVMoOIYpsm67Qj/9k5 11mRH8X2T42JWTjDwRqLz2hcrVQpA+Ot5DVPgaegcLfiwaECiseXxSJ0w1W52pgYDK 3AQ6TMdEXjE8w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1DCE169520 for ; Mon, 19 Jan 2026 14:50:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859400; bh=nzGVI+zkgQB1Pq06/VpjHN+xtRIq92KuJa0JbER2R+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aMwjLaO9EAQBJRdY63xdtjCfbMtGRGTpHhU015ondVLhC6OBF9nzeGCuHi7wxeP8D ue3bTLBEf1IkGPNicMSnRz7f68kI42N0OsoGUfea7YcND2UtoWxYiWRHWJDqvQ34DV iW51Lvd1NRHJUdhlnuleuHrv11g7wqloAOQhVaoHQlyoHa0d7lFJeagdP6GI9hz2VF FVoI4ia9DMFug8H1YWLZzgbus7xyOk/f3LbpKxC6vZKP16oI5lDjRnc5ypmOPWyguF VZVUskX3GfWhc1bYiuuJcv4MQred2aynFAanOkPiuvKJknlQOaR6JnK5Tyrlro0v1O j7gSd/At+VRQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1F15669520; Mon, 19 Jan 2026 14:50:00 -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 Eznc3nyQH4-x; Mon, 19 Jan 2026 14:50:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859395; bh=HSyMtaxT3IuwUcJTvIiwViMGJ+VjlrhB0A5p6NmTXOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A6oDCnY12wSlfFs0+LPB/qTNeydWPUBdCHFFGZf2oeBxYQvXILfb6busRQ6J6rcD3 CmEL9b0bkl+rQYDsttmZQ6ojmxBSjWegUlTM65Fqlk9YU4WTpjdd18+QjNyW169o1k qZxkgClsk89vk4W5Om1WaWNwuxJO1NwmrrWh7bjNMbvLWajM88zixKud0eCbIMT3Ea NWKTJ31tV8m+ndaqkw98fUHuVAdhs7sCxZWJ4FXpFa0ntAVnzHXStaaVblFz3csmY2 7yC2DfCH9X9JBt1HKqOl8nSG4PYTErALRk5dZ9zukTOu0evtP9FG7SxmPhn+ce8ElZ aM11Oo6OTYU1Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2DDDE6951A; Mon, 19 Jan 2026 14:49:55 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:38 -0700 Message-ID: <20260119214846.3087611-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BLE645ISXGTYOLMEDWRAOEIE3EGR6HFJ X-Message-ID-Hash: BLE645ISXGTYOLMEDWRAOEIE3EGR6HFJ 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/16] ext4l: Move KMEM_CACHE macro to linux/slab.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 KMEM_CACHE() convenience macro to include/linux/slab.h where it belongs with other kmem_cache functions. This macro creates a named cache for a specific structure type. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 +-- include/linux/slab.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index b50004bca55..484bd70222f 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -297,8 +297,7 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, /* Memory allocation - use linux/slab.h which is already available */ #include -/* KMEM_CACHE macro - use kmem_cache_create */ -#define KMEM_CACHE(s, flags) kmem_cache_create(#s, sizeof(struct s), 0, flags, NULL) +/* KMEM_CACHE macro is in linux/slab.h */ /* * RB tree operations - use real rbtree implementation from lib/rbtree.c diff --git a/include/linux/slab.h b/include/linux/slab.h index fb809063593..15d561f0527 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -117,6 +117,16 @@ 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); }) + +/** + * KMEM_CACHE - shorthand for creating a named kmem_cache + * @s: struct type name + * @flags: cache creation flags + * + * Creates a cache for objects of type struct @s with the specified flags. + */ +#define KMEM_CACHE(s, flags) kmem_cache_create(#s, sizeof(struct s), 0, flags, NULL) + void *kmem_cache_alloc(struct kmem_cache *obj, gfp_t flag); static inline void *kmem_cache_zalloc(struct kmem_cache *obj, gfp_t flags) From patchwork Mon Jan 19 21:48: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: 1671 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=1768859408; bh=71ZVKpHzBtO5U+M7L1tXXf3vaZIuCJkrTEMikGYYvkg=; 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=MFrbrtYfdbA2b9veEZ1nfde+2OoSIADKsrtOlGAhxz8w7jXgTMyIIbfr0zTgyYbWP RMHovC0cwqNyICFGt0KHlfju53r0rYm/BhzgZQ8PoY1R0awlzYZXg7ZsRH2bquDw5C jaRsmHGFMMBmqyp9ZCtR9Bx7Gry8QQgX+HSThFS37lT+60iSDtmmcj/YkTVuL3kn7A 9xImFAzoHkA+H/ZTPSVAuI5yzywDrZc0T+GJiIDBo4dKlaPFR9E1df0uh42oHQ4QoT nLOoNmNw2HHZUqq8QDeBcdo4MwgjlWTXMbLDLGh49ylMB8waU7MBg8HcusaBGrw5/B eXcnX4wWv/Pzg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4E81D6913F for ; Mon, 19 Jan 2026 14:50: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 10024) with ESMTP id fhiQmxIlC-3B for ; Mon, 19 Jan 2026 14:50:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859408; bh=71ZVKpHzBtO5U+M7L1tXXf3vaZIuCJkrTEMikGYYvkg=; 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=MFrbrtYfdbA2b9veEZ1nfde+2OoSIADKsrtOlGAhxz8w7jXgTMyIIbfr0zTgyYbWP RMHovC0cwqNyICFGt0KHlfju53r0rYm/BhzgZQ8PoY1R0awlzYZXg7ZsRH2bquDw5C jaRsmHGFMMBmqyp9ZCtR9Bx7Gry8QQgX+HSThFS37lT+60iSDtmmcj/YkTVuL3kn7A 9xImFAzoHkA+H/ZTPSVAuI5yzywDrZc0T+GJiIDBo4dKlaPFR9E1df0uh42oHQ4QoT nLOoNmNw2HHZUqq8QDeBcdo4MwgjlWTXMbLDLGh49ylMB8waU7MBg8HcusaBGrw5/B eXcnX4wWv/Pzg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1BCF669520 for ; Mon, 19 Jan 2026 14:50:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859404; bh=RqKm/7OMNWiLyMu+4/fFSHSe9aM1v3C2EbDEseY6lXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eb/6BhJSJjyARmGiSMj29MLpergYNUrTKQPl2dASH9Nq3IJyXlj+vvHamHVK4fsBL nszlxTA2N0qjA9Hsq+d8jGhDhoIVLwMWXvgIR60HL3AhrioqGJTbHkLUvWiEdYP3vH 4fvPSR07nVcLO0oXIuPQp4TegzdjTkliA2Qbv72RvjszHfZL4sbXOLkCIG4jaNnUJM hmMZCv/7vu3ESy6c67V3E48tGmOzoHtrL6/6wDSPBKwxq/2dIvatIL0P2wVToNSoPe PQIFP81fkyRwak6IeVHw4GZ40/dPAdNXOpp41c4Utv8p74qIYvpF2ixWhrl+i4ydd8 ip736lwHjbQ8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB65F69520; Mon, 19 Jan 2026 14:50:04 -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 zaVO_bcqxVaC; Mon, 19 Jan 2026 14:50:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859400; bh=NWyz4dZQ0gENk8IeymMHGG8yxSaJ9p9p/eLg//wxJKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DlXPaMRKoUHuz5Msi/SDIvVDNZPTwYqproIUB6u73V/abKtfgcFVqotdhOv5EIpvV MxH25ZXd1UKXgAtX7Sj1Q8GAqiurWAAQiNyU4Q31GodAlgoNAHy408wQNOjYf38+mb ny5gOW9/yUz4JKt/hk+WNbMob5vtfThP8x7oE7hUDmUUzAVJC67gFpr8MDmbMhsu6D lx+Sq29NLOWo8mMwSKCAg3yizPvxaDkU4VgqbiyGnI29ixjd2MEkdlrg3spYVDa8gZ aPtdNhDkWdeuemzFGGgoHJExhVR4v/1peHgDGD+PCbPaiMMoDBomxhDGL/M0nhey6X 3Vmh+ePiRIl4Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C8E426913F; Mon, 19 Jan 2026 14:49:59 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:39 -0700 Message-ID: <20260119214846.3087611-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AB2LLYVKNAEX545KQRNPRCB6AVXVB4PD X-Message-ID-Hash: AB2LLYVKNAEX545KQRNPRCB6AVXVB4PD 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/16] ext4l: Use existing linux/nospec.h for array_index_nospec 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 the duplicate array_index_nospec definition and include the existing linux/nospec.h header instead. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 484bd70222f..e617fc41e30 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1334,8 +1334,8 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, /* folio_get - now implemented in support.c */ -/* array_index_nospec - bounds checking without speculation (no-op in U-Boot) */ -#define array_index_nospec(index, size) (index) +/* array_index_nospec is in linux/nospec.h */ +#include /* atomic_inc_return and atomic_add_return are now in asm-generic/atomic.h */ From patchwork Mon Jan 19 21:48: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: 1672 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=1768859410; bh=RDa27nAta5yXy3sxbG6+NVnMRhiQrzsuXXCWzjdHHso=; 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=lpuoKjrk7EutAk5L3lH87jL9ilm1ey6rmL4wHDtYn6MdhPZSpNVGXVsQRQ/GvaZHH AiS1zG75q9K3/iSfWbqmIhIzDiwMbisEEagN2bvMmP9MNCvEIE9+MnMJNbBFoMeSgn Gp7c1Me9nW/g7CrBjUNEgSlxBNlbiQEOkWs2fpKrGmOYBx66Ciplgfc1wYH+0pCxDe T6xZY71siX2NsBTKiksUxQE75ij0jHQ9gq8JPCHy8mzHL5z3kiT3lGqcafBYy/3lOU w4oifZfeyO4pzHJh+tW5XB6iNd4cfsMqdKC/hdRjcuI//+pDf6gKEnn5+EN8r4ujd1 IH1rSSC6OJlpA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 50AFD69533 for ; Mon, 19 Jan 2026 14:50: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 bIe5CRfXBvxt for ; Mon, 19 Jan 2026 14:50:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859410; bh=RDa27nAta5yXy3sxbG6+NVnMRhiQrzsuXXCWzjdHHso=; 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=lpuoKjrk7EutAk5L3lH87jL9ilm1ey6rmL4wHDtYn6MdhPZSpNVGXVsQRQ/GvaZHH AiS1zG75q9K3/iSfWbqmIhIzDiwMbisEEagN2bvMmP9MNCvEIE9+MnMJNbBFoMeSgn Gp7c1Me9nW/g7CrBjUNEgSlxBNlbiQEOkWs2fpKrGmOYBx66Ciplgfc1wYH+0pCxDe T6xZY71siX2NsBTKiksUxQE75ij0jHQ9gq8JPCHy8mzHL5z3kiT3lGqcafBYy/3lOU w4oifZfeyO4pzHJh+tW5XB6iNd4cfsMqdKC/hdRjcuI//+pDf6gKEnn5+EN8r4ujd1 IH1rSSC6OJlpA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E83569535 for ; Mon, 19 Jan 2026 14:50:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859408; bh=kJfiABufFX41enStcnu80toTEmf3H8qlX5ULMG81jY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fuXYvNalIF069nOlhZbyc9qDbk1mbDUfmWPCiDLyC/uvixaXl+C+mC+GO6CuNUUSb UhPNlvYYmPKU6LAtVqGxmnORDh0A9aV+WEcuzS/MF34Ikbox4zEfMzHGsjjIi0myse zIAkC6v7rxZLJEjtR1PC6EM7jJhb5/picUB94ZN4NClsahqgWWzqauMLfuXjoR0p7N kwURP38eouku76yeIQVBcC7jYR+ae9WuHoDnPl7/yGT0SQ/6azG+NauIJvqLuc01uV Vc38CFn3Pcf7i71O5yal2Zylp3+nxxj8bg2bsBiG4aOpzMGJbuljcidw6DxXKhLo3p 7YzQ29liNUvtg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B9AD669539; Mon, 19 Jan 2026 14:50: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 4lpJBO2_x7Bs; Mon, 19 Jan 2026 14:50:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859404; bh=VVvtzFbsxJ0euUjYf87eQv+isadu0pa+oCQ9Ut3ka9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZzYchWiBbNySsMvKYE/8hCLF2DqabvbseJYINRUv2BiP3mxGabNABrT/Wyhxt0xzv n19WUMkAV9etHJ+eOepI/u8tUgMs/NVCoqMJsskq0OdI4yPY51HqWcPurxuWORjQ/n EYNAPI2EUvnJD/VuBNNVSHy7LbvRIgWLaL6v+YfkS5KKqQKj7/HyjZzR1bOJdth0PE nhsbRpzNeTjS2klyUrgII4jowCW/LP5hYTZ3tc0FCx6omYgcNASG0zzMfierZ9kVMt ytg/H+IngaCltk62UkRzRfYgNmf8mkWEKudKMA8vDtTU5ZhbC0z2/4jJXwxQY2Z0QC 0j+fwZoauDK8g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6023D6951A; Mon, 19 Jan 2026 14:50:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:40 -0700 Message-ID: <20260119214846.3087611-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TN23ACONRU2MKONADK7HLBJKACFCULYP X-Message-ID-Hash: TN23ACONRU2MKONADK7HLBJKACFCULYP 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/16] ext4l: Move WARN_RATELIMIT to linux/ratelimit.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 WARN_RATELIMIT macro to include/linux/ratelimit.h where it belongs with other rate-limiting definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 +-- include/linux/ratelimit.h | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index e617fc41e30..49405877133 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1329,8 +1329,7 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, /* sb_end_intwrite defined earlier */ -/* WARN_RATELIMIT - just evaluate condition, no warning in U-Boot */ -#define WARN_RATELIMIT(condition, ...) (condition) +/* WARN_RATELIMIT is in linux/ratelimit.h */ /* folio_get - now implemented in support.c */ diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 319f794f059..ca42c21406a 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h @@ -32,4 +32,13 @@ struct ratelimit_state { int ___ratelimit(struct ratelimit_state *rs, const char *func); void ratelimit_state_init(void *rs, int interval, int burst); +/** + * WARN_RATELIMIT - conditionally emit warning with rate limiting + * @condition: condition to check + * @...: printf-style format and arguments + * + * In U-Boot (no rate limiting), just evaluates the condition. + */ +#define WARN_RATELIMIT(condition, ...) (condition) + #endif /* _LINUX_RATELIMIT_H */ From patchwork Mon Jan 19 21:48: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: 1673 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=1768859415; bh=A/n7ptz9id4oox9xFixP7Sb6wq3DEdSrXHrTOcZ+OrE=; 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=PA81fymaVgOhwX+Es+84CrOuYNAHA8tZwAcWucMV4UfBaC98v4MORlePpfoSrxThn UIKY5SdYqw9xDJgw+fCYpn2zxamJ+XV0a96mb0Bc7p7voNtJdgTxvCVhQwBK6JlXBP YXH6vmiWynzTeOPM5jXSOK7KupcPbnQ0X/+f50zCrwb6RlBxjsSXTWniACAk6Eewh9 L9Qc92s2cyxv6nsuKs/ID+6URUTQiRzTUkdmcg5kmKnz7+oOUOPETIfSXIG6AUXEwK j9lTJvOyDOcMcBButtMgGEc9bYjRUGv1565APIQ2fbF14eDGdfN77DT4PvNIlyA7BC 2bBCfFgjsz5GA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B5F7369533 for ; Mon, 19 Jan 2026 14:50: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 gSGXav9KdkbT for ; Mon, 19 Jan 2026 14:50:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859415; bh=A/n7ptz9id4oox9xFixP7Sb6wq3DEdSrXHrTOcZ+OrE=; 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=PA81fymaVgOhwX+Es+84CrOuYNAHA8tZwAcWucMV4UfBaC98v4MORlePpfoSrxThn UIKY5SdYqw9xDJgw+fCYpn2zxamJ+XV0a96mb0Bc7p7voNtJdgTxvCVhQwBK6JlXBP YXH6vmiWynzTeOPM5jXSOK7KupcPbnQ0X/+f50zCrwb6RlBxjsSXTWniACAk6Eewh9 L9Qc92s2cyxv6nsuKs/ID+6URUTQiRzTUkdmcg5kmKnz7+oOUOPETIfSXIG6AUXEwK j9lTJvOyDOcMcBButtMgGEc9bYjRUGv1565APIQ2fbF14eDGdfN77DT4PvNIlyA7BC 2bBCfFgjsz5GA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A50356951A for ; Mon, 19 Jan 2026 14:50:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859413; bh=AuK8FRn/w/9IatKK0Pcf6PHd03vR/YHqD4QUVSaOfsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SRV9Ew9Q13v+tzYuDjXQXqi07+rRuwTvuaEOE1Ph1ZMFnAXWDzxm04i5MdNoS/eLy MepOhYUr/8fyzvrydF6lb9lj/4I8fjSqsG8kvLu+oZgzRgFXA/Dxr5MEqA/CdcRsJ6 o3J/eHFnQ2hoKSBONdrtZ8yqPRT2K5NpfwQigpWqVMnuhdO86Z1fQxnxHfd0HfVu51 2Ow3GcPxQXVS6iYU7rrSoqpPGJtESCL5q7AT6g41UrZlMV88f1GJuQ6vSC7ZtGRhN3 jIPcwZ/2nlI3VmC0rqyP4xg9bEMjDWMa5xRrf04+WjNGRvCeYI4XMJ7FWURKRYRZNL yNB6uGP1wWQAA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D36B6913F; Mon, 19 Jan 2026 14:50: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 10026) with ESMTP id h23SpXNM5knr; Mon, 19 Jan 2026 14:50:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859409; bh=Dr99DA4Q5G09dRWYwgjzsYWXk4E0+ojUHv0IB/NIel0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BEyQTwnoAAslCpTeADyF8rCj7b/MRwX3YnjaQlc/tEN/M/JhC7MbvYwGUncVxHOEw nwkEWFlGdfweUo3pU5PlMr+ixLZOYLerQ5YsKTHFhijFUCc8vckdwUuqCqk6+obVWX Ar5aW1ylget13fS75PWIHD1r8WrCDHWsflXuS3bLv6mycPsXKttR9NqJnqFuOOm5pa axb6b3iFB5jFqmlQwQh2eoSMDvC8SIW98jG1phmzYSFU3QL3UXpAuEvLV/IlqOIJ40 NfVwXVoOzv0/OveLdJNFdnMiydxgkb2yDdmx/lncD6mXM95gZY3+ajCpuErceTQ0la UE3znDmx1GDwQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 01E346951A; Mon, 19 Jan 2026 14:50:08 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:41 -0700 Message-ID: <20260119214846.3087611-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: V2SDW6OMWQXB6RI5BW7WXYHBCJJWURFP X-Message-ID-Hash: V2SDW6OMWQXB6RI5BW7WXYHBCJJWURFP 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/16] ext4l: Add asm-generic/timex.h and move get_cycles 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 include/asm-generic/timex.h with the get_cycles() macro that returns 0 (U-Boot doesn't have a cycle counter). Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ++-- include/asm-generic/timex.h | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 include/asm-generic/timex.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 49405877133..eadff92aecb 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1322,8 +1322,8 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, /* atomic64 operations are now in asm-generic/atomic.h */ -/* CPU cycle counter stub */ -#define get_cycles() (0ULL) +/* get_cycles is in asm-generic/timex.h */ +#include /* folio_address is in linux/pagemap.h */ diff --git a/include/asm-generic/timex.h b/include/asm-generic/timex.h new file mode 100644 index 00000000000..005befd6b6d --- /dev/null +++ b/include/asm-generic/timex.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Generic timex definitions for U-Boot + * + * Based on Linux asm-generic/timex.h + */ +#ifndef _ASM_GENERIC_TIMEX_H +#define _ASM_GENERIC_TIMEX_H + +typedef unsigned long long cycles_t; + +/** + * get_cycles() - Get CPU cycle counter + * + * U-Boot doesn't have a cycle counter, so return 0. + * + * Return: 0 (stub) + */ +#define get_cycles() (0ULL) + +#endif /* _ASM_GENERIC_TIMEX_H */