From patchwork Wed Jan 14 22:55:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1495 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=1768431418; bh=fmB8DZWwml1/8HKWW8AChc7mQOLe54+Ify63DBn4MBA=; 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=mJJGC/0cea9cEO7bMHavYEw1bE24o2mDmrUgY1Ltg2qBcAOabnIiBbguEH0MPaSxC qANGg3ZM+922qNEjz5WcYEglkjEdTTZskwVn+2VdbWA7MT8GZn5Jx0/qWMmgjuTI0h 0dY+BUDMAUdazDY5orZVqe50l0wH3HrLYndHrzLJPEdiyKHC42daIF7xU8uwsp/p64 gKRGJmRx0sOI/EzluPMGG9A1C2I6WljAjc2WSfRPObXv7jfPxjgEAJ2aYIU7cI6J4K Zba2r97TrEtwgm1RQHuj1GEGU0N5Cyjkpk6N9ku0GVbzytjdV1g5lwPJ4L2vxqF0TN z93XEMAT3p2Iw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 20114692F1 for ; Wed, 14 Jan 2026 15:56:58 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Zln4Uis7LCWB for ; Wed, 14 Jan 2026 15:56:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431418; bh=fmB8DZWwml1/8HKWW8AChc7mQOLe54+Ify63DBn4MBA=; 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=mJJGC/0cea9cEO7bMHavYEw1bE24o2mDmrUgY1Ltg2qBcAOabnIiBbguEH0MPaSxC qANGg3ZM+922qNEjz5WcYEglkjEdTTZskwVn+2VdbWA7MT8GZn5Jx0/qWMmgjuTI0h 0dY+BUDMAUdazDY5orZVqe50l0wH3HrLYndHrzLJPEdiyKHC42daIF7xU8uwsp/p64 gKRGJmRx0sOI/EzluPMGG9A1C2I6WljAjc2WSfRPObXv7jfPxjgEAJ2aYIU7cI6J4K Zba2r97TrEtwgm1RQHuj1GEGU0N5Cyjkpk6N9ku0GVbzytjdV1g5lwPJ4L2vxqF0TN z93XEMAT3p2Iw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 08E3E6933D for ; Wed, 14 Jan 2026 15:56:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431416; bh=nVBeaqCVLRIPb0lLn+D0yyeeFTUOyA6LA2w02P5Ocrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uxGXj0CkrDCkLoXW3ZP3K1NhlFFwZviUjeSpQUn7DWjVbfApKFJ/cFCRRX80bk/fv fTLkkyiWNUsEbsa3fk1LGzfkY8k0ZbRzkSKSh38ZhgaFtOl6Qx2tgVjnSEbw0AVk8n GM/LwStEVgSwny+rhebna7Sh58NzvS0awKAsQofHT8Wz03d7gqTJa1YHG+eKWZRHBL 5XjLmnXWhUdLkslBRJrXl8CUjEESk6RS1/D1h0q2Q1LeyTBldBz+02MuivE04tJsvL 9XbqgRkB85E10PaPKHVTnMyBjDkpCsTM/lzzWrSu/7n8rpoXbFzoJbFPIoMggeCEQD vHhgQfKiq1fAA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0FAEB692F1; Wed, 14 Jan 2026 15:56:56 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id NipI5mIIfNkL; Wed, 14 Jan 2026 15:56:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431412; bh=OnAEWJFW+CH3fH7DAiHvV/A85BtcmYrzeMZKWeMukr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EzaM9rkiLhaxsWFxxTsjf1RxJIBGl2pENR2ox2bzrL0Vi/W5csH4kaumy2GS0Vev9 9uIrO/t7nMFHhfS7NMsVREqwdu1ItrXp7/0qvTB5H5QVZk+KZN+ZZjbLf2lMmMVCpz fqpOL4Jtk3pPPKR9JN11cC1ZmZrpdaPpBP/6rNvV7v7EhpthIL6/9OpPP4zyiA9lIY vqhBeWY6EH0y90a0lAKqtiWae+0TCuM3mhZ8ipbggieNFD4khEO3ysz45KjdFJqppR /rrSNbHVP/GsjYzGgo4xd5v3bw227APJ4AefDWy+913uFxkgVq+p3sysRxewaXMDV7 XF/yE7K/L0Uug== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B2A18692EF; Wed, 14 Jan 2026 15:56:51 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:51 -0700 Message-ID: <20260114225635.3407989-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VHZHHHDFY5YVJ334YTEZAG4GR4YKIDTM X-Message-ID-Hash: VHZHHHDFY5YVJ334YTEZAG4GR4YKIDTM 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/34] ext4l: Move timespec64 and time64_t to linux/time.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 timespec64 structure and time64_t typedef from ext4_uboot.h to include/linux/time.h where they logically belong. This reduces duplication and aligns with Linux kernel header organisation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 11 +++-------- include/linux/time.h | 8 ++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4a7e41a75a1..b2a33a17198 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -38,6 +38,7 @@ #include #include #include /* Real rbtree implementation */ +#include /* For timespec64, time64_t */ #include /* For crc32() used by crc32_be */ /* @@ -70,11 +71,7 @@ static inline u32 rol32(u32 word, unsigned int shift) return (word << (shift & 31)) | (word >> ((-shift) & 31)); } -/* Time types */ -struct timespec64 { - time_t tv_sec; - long tv_nsec; -}; +/* Time types - timespec64 and time64_t are now in linux/time.h */ /* * ktime_t, sector_t are now in linux/types.h @@ -544,9 +541,7 @@ struct fscrypt_dummy_policy { }; /* errseq_t is defined in linux/fs.h */ - -/* time64_t */ -typedef s64 time64_t; +/* time64_t is now in linux/time.h */ /* IS_NOQUOTA - stub */ #define IS_NOQUOTA(inode) (0) diff --git a/include/linux/time.h b/include/linux/time.h index 0de44cff8d7..b23598295c2 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -166,4 +166,12 @@ time64_t mktime64(const unsigned int year, const unsigned int mon, const unsigned int min, const unsigned int sec); #endif +/* 64-bit time representation with nanoseconds */ +typedef s64 time64_t; + +struct timespec64 { + time_t tv_sec; + long tv_nsec; +}; + #endif From patchwork Wed Jan 14 22:55:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1496 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=1768431423; bh=MHLw5YoXQ0QwfqKQZ+mXasr+iUEly/GMXYu7PHkH/+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=VKSPIYQnyvE7N1kZq7gI8vPG/B/gd7xamlBzA6JuSUEbEPpMj+OHPahsMS42JDvAp iDSwh/+KxprZ33JsPBZWEMaLkV1q0RIcSD+bJJfL3TxjtEorf6CKy2LZ/zRGShUwgn zhTeLybEx7SDZdbPJzEAk5OJh5uJDsAdISZ++glUQrQzRLsObO8kGF7KfCKE21t93S uKICtxSuymrr8H5+XO/9LPbmY6IvP7H0S6JLWQ+i2THIlTUNXI9zNh8K/2Ehc/7Drh n0ls0j00aIUhap1TbyV5LQwyH0HjchQkpjrjsykaGNaCLbrWjU/YfXBWs43MDNs6hU L07owZAHvYEXQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2320C6933C for ; Wed, 14 Jan 2026 15:57:03 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id r261bDqI1QrE for ; Wed, 14 Jan 2026 15:57:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431423; bh=MHLw5YoXQ0QwfqKQZ+mXasr+iUEly/GMXYu7PHkH/+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=VKSPIYQnyvE7N1kZq7gI8vPG/B/gd7xamlBzA6JuSUEbEPpMj+OHPahsMS42JDvAp iDSwh/+KxprZ33JsPBZWEMaLkV1q0RIcSD+bJJfL3TxjtEorf6CKy2LZ/zRGShUwgn zhTeLybEx7SDZdbPJzEAk5OJh5uJDsAdISZ++glUQrQzRLsObO8kGF7KfCKE21t93S uKICtxSuymrr8H5+XO/9LPbmY6IvP7H0S6JLWQ+i2THIlTUNXI9zNh8K/2Ehc/7Drh n0ls0j00aIUhap1TbyV5LQwyH0HjchQkpjrjsykaGNaCLbrWjU/YfXBWs43MDNs6hU L07owZAHvYEXQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0821369345 for ; Wed, 14 Jan 2026 15:57:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431420; bh=/AxHE6QJUbwgUFDyU9LCrpNy5k+pPmwfLyoKQErqJDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UviWBQ1DTMyPEvrQrsaqNN9v4BotxTiuuJIIvI8QBylvmKyIHPTQ7MG98epylJC9/ 6sn1Ttpfvy3opt4Q6y6kvBqAcFEeJRAbfQJ6ymGZhKxXT3jxBOIFXSeEGT3luaEV3+ I8xcqSXB04wrGX1mC4iNH28ceq2c31UZ07y2cGs0DzfDqX1i0DwBYGS2K0OlKx67oE sSWc8akccQvzNQNdvDrsBOdTNYxIuWrSMTPwMLyJTuXwcJEpxTyEjnSmzX/V34qco/ Ac0tuQgylD3ZM600cD2xTz/pHScMIXjOT6FtzWO9t/mA+eLgcCmvIYb7BuBUU1MK8/ gRwcqBORI23mA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A53D66933C; Wed, 14 Jan 2026 15:57: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 qUMgs_0jRSw1; Wed, 14 Jan 2026 15:57:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431416; bh=nnQuHGTkgFH3TW0MCCtA1y3CQQr4xwSExiVYxWlUU7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cGGsF/bYZXcdap569s7z2K+LgQz2yfzl+s0+ShaHthItI2pdHmA8HTzb0Ghcer9v2 UgZ3rsOK1fjklXrF0+jSFSW9uK///jfMly7rzBYqLlMPt14ijhAPlzLsf0Au8BjEbR c61aXl5TnHm7e15/jQbSKkar6+X7y9tUz5vPF161l5vxSIYFQXJeW/S1WLz3f1EgqG ZH9AAV2gLH9133e6JEPGtWlwMuESvphaUxdKw3PwAMH2fzr/8N0AhX55Jce1o6fIRj Y0OUtsRYJ65moceZKTeUAYbIPtMr2KcOLyHIdJnDDrFdVeJ0/ie3N5jyy8CkuSZcpk lBB4lp8UjsQBA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 587C9692EF; Wed, 14 Jan 2026 15:56:56 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:52 -0700 Message-ID: <20260114225635.3407989-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3NPBQHR55AMZBBKQZ6JGKVY6EXZ5Q6SF X-Message-ID-Hash: 3NPBQHR55AMZBBKQZ6JGKVY6EXZ5Q6SF 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/34] ext4l: Move rol32 to linux/bitops.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 rol32() rotate-left function from ext4_uboot.h to include/linux/bitops.h where it logically belongs alongside other bit manipulation functions. Also add ror32() for completeness. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 +------ include/linux/bitops.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index b2a33a17198..68dca2f8d4e 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -65,12 +65,7 @@ #undef no_printk #define no_printk(fmt, ...) ({ 0; }) -/* Rotate left - not available in U-Boot */ -static inline u32 rol32(u32 word, unsigned int shift) -{ - return (word << (shift & 31)) | (word >> ((-shift) & 31)); -} - +/* rol32 and ror32 are now in linux/bitops.h */ /* Time types - timespec64 and time64_t are now in linux/time.h */ /* diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 86f7ee492b4..a3cfbbd5250 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -148,6 +148,26 @@ static inline unsigned long hweight_long(unsigned long w) return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w); } +/** + * rol32 - rotate a 32-bit value left + * @word: value to rotate + * @shift: bits to roll + */ +static inline u32 rol32(u32 word, unsigned int shift) +{ + return (word << (shift & 31)) | (word >> ((-shift) & 31)); +} + +/** + * ror32 - rotate a 32-bit value right + * @word: value to rotate + * @shift: bits to roll + */ +static inline u32 ror32(u32 word, unsigned int shift) +{ + return (word >> (shift & 31)) | (word << ((-shift) & 31)); +} + #include /* linux/include/asm-generic/bitops/non-atomic.h */ From patchwork Wed Jan 14 22:55:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1497 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=1768431427; bh=1nQrLHCWLEpkl+WACuROEC8/ssEny65izan6gNkURWI=; 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=Yv0ciR5KjdgugHqh1J/aN1LUBpch3xYoHZSkZNHbQQ2hjIrWg/538bKBVz5iiDaXd 73Nv4dRxCSGMy1mq/qYtoFQ5+UP3Wjr1oHMiliNKVK2QCYfAVFmm6lmgUPaGUvVjaZ OlgubnE+N+YsjdzSu+7ITx0CMuQpb7FJhkuKH+0/xH/NJFygyuPvZsOruvqQv8PrUy C2tWNxzZLw6nRS8uuDbyK+sVfUJmBVa+Ptl4ByuWfv9genAlVhbuiC51otbaT4PDex z7yeRYYNK6Y37LyIMkO0Bm4Av7qLxgo4n5YqzuFJYFqvxD9ZwoNdz4fZ371dNXuDIe BK7uHIlN1ca2g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 54600692F1 for ; Wed, 14 Jan 2026 15:57:07 -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 chhz0dEDglbE for ; Wed, 14 Jan 2026 15:57:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431427; bh=1nQrLHCWLEpkl+WACuROEC8/ssEny65izan6gNkURWI=; 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=Yv0ciR5KjdgugHqh1J/aN1LUBpch3xYoHZSkZNHbQQ2hjIrWg/538bKBVz5iiDaXd 73Nv4dRxCSGMy1mq/qYtoFQ5+UP3Wjr1oHMiliNKVK2QCYfAVFmm6lmgUPaGUvVjaZ OlgubnE+N+YsjdzSu+7ITx0CMuQpb7FJhkuKH+0/xH/NJFygyuPvZsOruvqQv8PrUy C2tWNxzZLw6nRS8uuDbyK+sVfUJmBVa+Ptl4ByuWfv9genAlVhbuiC51otbaT4PDex z7yeRYYNK6Y37LyIMkO0Bm4Av7qLxgo4n5YqzuFJYFqvxD9ZwoNdz4fZ371dNXuDIe BK7uHIlN1ca2g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3CB1F6933C for ; Wed, 14 Jan 2026 15:57:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431425; bh=YN74WQEhC2U5574+cufX89ZCa4d5vzTb+nYIVy6i9Hw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MohOUwAE2+deJakb2oxgwulnh63v6lmyL7BhYtEk+qTxcEVL9DVxdvaUHYVbV8v+O Ur/q1OPDh9srOqJRqgrCxsSRvy5+oDC4Eai4/jrULYLhPhCGqXar782lvDXlm/fjT7 PGWJy9+7yfNiUB9s7D3YGiFtFT8syJDACTOlj+R7gr/IzhGXfKEf+rD8E57J146wx5 HTZDGn9JbjEr2Ut8CG374UclM4jEVUmEiQo9RCuxd1bMZaGfFEjXr0WW2VY2349Wo/ CBBqEXAym5Q+R716g+Uh+xIzSwYDyZyj2JUMDHG9xKPHMCsgowLpGTpTO/woeYgKeU bO7Ot09TVxbow== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4E873692F1; Wed, 14 Jan 2026 15:57:05 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id So5hH0lHml0r; Wed, 14 Jan 2026 15:57:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431421; bh=ABL3oYtzAp3PjN2bcxpqPt5iF+n3JPL73MihKxgtJew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ub/jAdwS4nGrAX0dNGG0Oc7vvXAn8fpLUltslnfPbb98EKSpWKdNn7DaAd+xmB9xq Pe0ya7nsL6vHsY3nSDGtaglrrvZX7imed8NWMlj/NDKAv/aNfgv9B8oeiHzUuY2+aH jCrnXUKzKsoxu60HuxrNPl42C1rORseZW0rdfw29M6qCsa0k+EP/QiOs3w6Gel53bl tv69v9JigfY12LoBNhtVFlW7GsfXKH+0GK7qhwnnwTm4BjZDtZLi5YQHjOe7q6iohe rQJIcm6E6dhOAAQPq8ZN8ToBwHr4Uc2hifoprT5xUWxKbBHYH1tEmppxEUP7Zc1uaA yVb3J4l/lykYw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E9704692EF; Wed, 14 Jan 2026 15:57:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:53 -0700 Message-ID: <20260114225635.3407989-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GI25SFKKAOYBOHALHKJOF76V72LTK43F X-Message-ID-Hash: GI25SFKKAOYBOHALHKJOF76V72LTK43F 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/34] ext4l: Move atomic operations to asm-generic/atomic.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 atomic operations from ext4_uboot.h to asm-generic/atomic.h where they logically belong. This includes: - atomic_inc_return() - atomic_add_return() - atomic_dec_if_positive() - atomic_add_unless() Remove duplicate definitions from ext4_uboot.h that are now provided by asm-generic/atomic.h. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 30 ++++---------------- include/asm-generic/atomic.h | 53 ++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 68dca2f8d4e..f208889cbac 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -78,8 +78,7 @@ #include #include -/* Extra atomic operation not in asm-generic/atomic.h */ -#define atomic_dec_if_positive(v) (--(v)->counter) +/* atomic_dec_if_positive, atomic_add_unless, etc. are now in asm-generic/atomic.h */ /* SMP stubs - U-Boot is single-threaded */ #define raw_smp_processor_id() 0 @@ -433,8 +432,7 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, /* spin_trylock is defined in linux/spinlock.h */ -/* Atomic extras */ -#define atomic_add_unless(v, a, u) ({ (void)(v); (void)(a); (void)(u); 1; }) +/* atomic_add_unless is now in asm-generic/atomic.h */ /* Block group lock - stub */ #define bgl_lock_ptr(lock, group) NULL @@ -2548,9 +2546,7 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, return size; } -/* Atomic64 operations */ -#define atomic64_inc(v) do { (void)(v); } while (0) -#define atomic64_add(i, v) do { (void)(i); (void)(v); } while (0) +/* atomic64 operations are now in asm-generic/atomic.h */ /* CPU cycle counter stub */ #define get_cycles() (0ULL) @@ -2592,17 +2588,7 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, /* array_index_nospec - bounds checking without speculation (no-op in U-Boot) */ #define array_index_nospec(index, size) (index) -/* atomic_inc_return - increment and return new value */ -static inline int atomic_inc_return(atomic_t *v) -{ - return ++(v->counter); -} - -/* atomic_add_return - add and return new value */ -static inline int atomic_add_return(int i, atomic_t *v) -{ - return (v->counter += i); -} +/* atomic_inc_return and atomic_add_return are now in asm-generic/atomic.h */ /* pde_data - proc dir entry data (not supported in U-Boot) */ #define pde_data(inode) ((void *)NULL) @@ -2640,10 +2626,7 @@ struct seq_operations { #define sb_issue_discard(sb, sector, nr_sects, gfp, flags) \ ({ (void)(sb); (void)(sector); (void)(nr_sects); (void)(gfp); (void)(flags); 0; }) -/* Atomic operations */ -#define atomic_sub(i, v) ((v)->counter -= (i)) -#define atomic64_sub(i, v) ((v)->counter -= (i)) -#define atomic_dec_and_test(v) (--((v)->counter) == 0) +/* atomic_sub, atomic64_sub, atomic_dec_and_test are in asm-generic/atomic.h */ /* RCU list operations - use regular list operations in U-Boot */ #define list_for_each_entry_rcu(pos, head, member, ...) \ @@ -2755,8 +2738,7 @@ struct folio_iter { /* blk_status_to_errno - convert block status to errno */ #define blk_status_to_errno(status) (-(status)) -/* atomic_inc - increment atomic */ -#define atomic_inc(v) ((v)->counter++) +/* atomic_inc is in asm-generic/atomic.h */ /* GFP_NOIO - allocation without I/O */ #define GFP_NOIO 0 diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 94d0747194a..7825258922a 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h @@ -79,6 +79,59 @@ static inline int atomic_add_negative(int i, volatile atomic_t *v) return val < 0; } +static inline int atomic_inc_return(atomic_t *v) +{ + unsigned long flags = 0; + int val; + + local_irq_save(flags); + val = ++v->counter; + local_irq_restore(flags); + + return val; +} + +static inline int atomic_add_return(int i, atomic_t *v) +{ + unsigned long flags = 0; + int val; + + local_irq_save(flags); + val = (v->counter += i); + local_irq_restore(flags); + + return val; +} + +static inline int atomic_dec_if_positive(atomic_t *v) +{ + unsigned long flags = 0; + int val; + + local_irq_save(flags); + val = v->counter - 1; + if (val >= 0) + v->counter = val; + local_irq_restore(flags); + + return val; +} + +static inline int atomic_add_unless(atomic_t *v, int a, int u) +{ + unsigned long flags = 0; + int ret = 1; + + local_irq_save(flags); + if (v->counter != u) + v->counter += a; + else + ret = 0; + local_irq_restore(flags); + + return ret; +} + static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) { unsigned long flags = 0; From patchwork Wed Jan 14 22:55:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1498 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=1768431432; bh=rcnDYrX8pSzFQJ4+h0FgxEJHIFdg2JfyKlmUsMO6f0s=; 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=E18fThK/ElTgRWEY+iQLbWVw7fu05WO7yA7/J+smcZ6f1dJuCEvcRRZM/v6cFL13a b8+wHuOUqr+Df47uxBa+m+W7/qI1dN26JgPP2iraj0G71MynTC9D7lbTg8pwBQDnF/ Xz3n57NhiNqzeAKmwy488ckihwzL4rciU99uCiLNzD8CoWUQhsfSp3zoHz5xCw0raW TLpshDYwDMnGvd8H3dTzaY4RCI55sCQTZb2nxMptBmR65JTiKmUZQon3NaJVSXsD8G XCwQpfNEg2z/uUF9h4yQu5xuU+g0bKmhnnYam/2MyoJQGXepcJQAGgw+Hgtm8tKbh7 F9EoDC3RN7MaQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7F31F6934D for ; Wed, 14 Jan 2026 15:57:12 -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 4yjuq7eWiUTG for ; Wed, 14 Jan 2026 15:57:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431432; bh=rcnDYrX8pSzFQJ4+h0FgxEJHIFdg2JfyKlmUsMO6f0s=; 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=E18fThK/ElTgRWEY+iQLbWVw7fu05WO7yA7/J+smcZ6f1dJuCEvcRRZM/v6cFL13a b8+wHuOUqr+Df47uxBa+m+W7/qI1dN26JgPP2iraj0G71MynTC9D7lbTg8pwBQDnF/ Xz3n57NhiNqzeAKmwy488ckihwzL4rciU99uCiLNzD8CoWUQhsfSp3zoHz5xCw0raW TLpshDYwDMnGvd8H3dTzaY4RCI55sCQTZb2nxMptBmR65JTiKmUZQon3NaJVSXsD8G XCwQpfNEg2z/uUF9h4yQu5xuU+g0bKmhnnYam/2MyoJQGXepcJQAGgw+Hgtm8tKbh7 F9EoDC3RN7MaQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6BAC1692F1 for ; Wed, 14 Jan 2026 15:57:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431430; bh=EWzCqsOVENIu76SW2eYtc4k0SbVFXfw4MSpdlrA+7FQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hd1/yrhYqFpJgEq4ahKK8F/CGAs+pi0lzpHtVLCMcbG9ZtHKPREdVm6lEa9Ob33uL sXpXDwvjIizgLMPOWr9RnzQDZRRn1o3QRvpiw2597CB2qsZ4eUI9IUlOAohTwsnHwu oDxRr0m+MFEpx/S6+LS5WU/TuHJdC+jIQ8kt7UmJVEyOYuP6zGN/R1yw5f9Z10rZwk I78yIBbgLwGID2Hm1KECVSRy9fCa5xyAz2zYeDbyRzBkE1X3huIjCrEXPeOBVwciGv 1tPJa9DB6+RJurmdtiy+sHTEQWy4dndAFOnhFmQbtoYyIpUFvFKwAEK166csfG3kSo IMnJ48LN1WcYQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4B0D1692F1; Wed, 14 Jan 2026 15:57: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 10026) with ESMTP id j10bc-jQHj7M; Wed, 14 Jan 2026 15:57:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431426; bh=lFdEBUaMvl8v6rICWv8wGIoNDhuP+LdnLrRhk1ZThTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GyXesx0nkP/WhTf4fBYRtMkJZU37omWTJAPu2VA1E/38KLIv5a+15xQyPuFiC8tz8 ZL9cIPq0ct5VK/nMIcpD7UFxCWl4N/mYVaIVndplvX7Rf8q8DmZSRvNDSiM2mrerKJ OM1KKMHmOmhcbLjLE96RTjm+83IeKp+0MTgAX0M8NvZvTHqXwKgWo+TWpUhswN6j2e 4FYfTX+ixSX2JgkIgDAlTtAJbTFYlB8pc3G/WfpPni2bGjL8+ESwYgU+Y5ShBWXzke IuPnYqZ9nicb1HMFnrCUWkQHCdu/imZiPGUWN4dgQXHoA1O0F0oH2a/tyYJsT1+wzh fbUFmN57qBwNQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AC11A692EF; Wed, 14 Jan 2026 15:57:05 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:54 -0700 Message-ID: <20260114225635.3407989-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7C4H7XLO2EYMVHH47ZOGROUCNHLWSMXQ X-Message-ID-Hash: 7C4H7XLO2EYMVHH47ZOGROUCNHLWSMXQ 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/34] ext4l: Consolidate trace stubs into ext4_trace.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 In Linux, trace events are defined in include/trace/events/ext4.h and include/trace/events/jbd2.h. In U-Boot, all these trace points need to be stubbed out since tracing is not supported. Move all trace-stub definitions from ext4_uboot.h into a new dedicated header ext4_trace.h This consolidates ~100 scattered trace stub macros into one organised location, grouped by category (journal, bitmap, inode, extent, writeback, etc.). Note that trace_ext4_error() is a function implemented in stub.c, not a trace stub, so it remains as a function declaration in ext4_uboot.h This reduces ext4_uboot.h by ~190 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_trace.h | 172 +++++++++++++++++++++++++++++++++++++ fs/ext4l/ext4_uboot.h | 191 +----------------------------------------- 2 files changed, 174 insertions(+), 189 deletions(-) create mode 100644 fs/ext4l/ext4_trace.h diff --git a/fs/ext4l/ext4_trace.h b/fs/ext4l/ext4_trace.h new file mode 100644 index 00000000000..a53e1cdfd99 --- /dev/null +++ b/fs/ext4l/ext4_trace.h @@ -0,0 +1,172 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * ext4 and jbd2 trace stubs for U-Boot + * + * In Linux, these are defined as trace events via include/trace/events/ext4.h + * and include/trace/events/jbd2.h. In U-Boot, we stub them out completely. + */ + +#ifndef _EXT4_TRACE_H +#define _EXT4_TRACE_H + +/* ext4 journal traces */ +#define trace_ext4_journal_start_inode(...) do { } while (0) +#define trace_ext4_journal_start_sb(...) do { } while (0) +#define trace_ext4_journal_start_reserved(...) do { } while (0) +#define trace_ext4_forget(...) do { } while (0) + +/* ext4 bitmap traces */ +#define trace_ext4_read_block_bitmap_load(...) do { } while (0) +#define trace_ext4_load_inode_bitmap(...) do { } while (0) + +/* ext4 inode allocation traces */ +#define trace_ext4_free_inode(...) do { } while (0) +#define trace_ext4_allocate_inode(...) do { } while (0) +#define trace_ext4_request_inode(...) do { } while (0) + +/* ext4 extent traces */ +#define trace_ext4_ext_load_extent(...) do { } while (0) +#define trace_ext4_ext_rm_idx(...) do { } while (0) +#define trace_ext4_remove_blocks(...) do { } while (0) +#define trace_ext4_ext_rm_leaf(...) do { } while (0) +#define trace_ext4_ext_remove_space(...) do { } while (0) +#define trace_ext4_ext_remove_space_done(...) do { } while (0) +#define trace_ext4_ext_convert_to_initialized_enter(...) do { } while (0) +#define trace_ext4_ext_convert_to_initialized_fastpath(...) do { } while (0) +#define trace_ext4_ext_handle_unwritten_extents(...) do { } while (0) +#define trace_ext4_get_implied_cluster_alloc_exit(...) do { } while (0) +#define trace_ext4_ext_map_blocks_enter(...) do { } while (0) +#define trace_ext4_ext_map_blocks_exit(...) do { } while (0) +#define trace_ext4_ext_show_extent(...) do { } while (0) + +/* ext4 fallocate traces */ +#define trace_ext4_collapse_range(...) do { } while (0) +#define trace_ext4_insert_range(...) do { } while (0) +#define trace_ext4_zero_range(...) do { } while (0) +#define trace_ext4_fallocate_enter(...) do { } while (0) +#define trace_ext4_fallocate_exit(...) do { } while (0) + +/* ext4 indirect block traces */ +#define trace_ext4_ind_map_blocks_enter(...) do { } while (0) +#define trace_ext4_ind_map_blocks_exit(...) do { } while (0) + +/* ext4 inode traces */ +#define trace_ext4_begin_ordered_truncate(...) do { } while (0) +#define trace_ext4_evict_inode(...) do { } while (0) +#define trace_ext4_load_inode(...) do { } while (0) +#define trace_ext4_other_inode_update_time(...) do { } while (0) +#define trace_ext4_mark_inode_dirty(...) do { } while (0) +#define trace_ext4_drop_inode(...) do { } while (0) +#define trace_ext4_nfs_commit_metadata(...) do { } while (0) + +/* ext4 delayed allocation traces */ +#define trace_ext4_da_update_reserve_space(...) do { } while (0) +#define trace_ext4_da_reserve_space(...) do { } while (0) +#define trace_ext4_da_release_space(...) do { } while (0) +#define trace_ext4_da_write_pages_extent(...) do { } while (0) +#define trace_ext4_alloc_da_blocks(...) do { } while (0) + +/* ext4 writeback traces */ +#define trace_ext4_writepages(...) do { } while (0) +#define trace_ext4_da_write_folios_start(...) do { } while (0) +#define trace_ext4_da_write_folios_end(...) do { } while (0) +#define trace_ext4_writepages_result(...) do { } while (0) +#define trace_ext4_da_write_begin(...) do { } while (0) +#define trace_ext4_da_write_end(...) do { } while (0) +#define trace_ext4_write_begin(...) do { } while (0) +#define trace_ext4_write_end(...) do { } while (0) +#define trace_ext4_journalled_write_end(...) do { } while (0) + +/* ext4 folio traces */ +#define trace_ext4_read_folio(...) do { } while (0) +#define trace_ext4_invalidate_folio(...) do { } while (0) +#define trace_ext4_journalled_invalidate_folio(...) do { } while (0) +#define trace_ext4_release_folio(...) do { } while (0) + +/* ext4 truncate traces */ +#define trace_ext4_punch_hole(...) do { } while (0) +#define trace_ext4_truncate_enter(...) do { } while (0) +#define trace_ext4_truncate_exit(...) do { } while (0) + +/* ext4 sync traces */ +#define trace_ext4_sync_file_enter(...) do { } while (0) +#define trace_ext4_sync_file_exit(...) do { } while (0) +#define trace_ext4_sync_fs(...) do { } while (0) + +/* ext4 unlink traces */ +#define trace_ext4_unlink_enter(...) do { } while (0) +#define trace_ext4_unlink_exit(...) do { } while (0) + +/* ext4 super traces */ +#define trace_ext4_prefetch_bitmaps(...) do { } while (0) +#define trace_ext4_lazy_itable_init(...) do { } while (0) +/* trace_ext4_error is a function implemented in stub.c, not a trace stub */ + +/* ext4 mballoc traces */ +#define trace_ext4_mb_bitmap_load(...) do { } while (0) +#define trace_ext4_mb_buddy_bitmap_load(...) do { } while (0) +#define trace_ext4_mballoc_alloc(...) do { } while (0) +#define trace_ext4_mballoc_prealloc(...) do { } while (0) +#define trace_ext4_mballoc_discard(...) do { } while (0) +#define trace_ext4_mballoc_free(...) do { } while (0) +#define trace_ext4_mb_release_inode_pa(...) do { } while (0) +#define trace_ext4_mb_release_group_pa(...) do { } while (0) +#define trace_ext4_mb_new_inode_pa(...) do { } while (0) +#define trace_ext4_mb_new_group_pa(...) do { } while (0) +#define trace_ext4_discard_blocks(...) do { } while (0) +#define trace_ext4_discard_preallocations(...) do { } while (0) +#define trace_ext4_mb_discard_preallocations(...) do { } while (0) +#define trace_ext4_request_blocks(...) do { } while (0) +#define trace_ext4_allocate_blocks(...) do { } while (0) +#define trace_ext4_free_blocks(...) do { } while (0) +#define trace_ext4_trim_extent(...) do { } while (0) +#define trace_ext4_trim_all_free(...) do { } while (0) + +/* ext4 fast commit traces */ +#define trace_ext4_fc_track_unlink(...) do { } while (0) +#define trace_ext4_fc_track_link(...) do { } while (0) +#define trace_ext4_fc_track_create(...) do { } while (0) +#define trace_ext4_fc_track_inode(...) do { } while (0) +#define trace_ext4_fc_track_range(...) do { } while (0) +#define trace_ext4_fc_cleanup(...) do { } while (0) +#define trace_ext4_fc_stats(...) do { } while (0) +#define trace_ext4_fc_commit_start(...) do { } while (0) +#define trace_ext4_fc_commit_stop(...) do { } while (0) +#define trace_ext4_fc_replay_scan(...) do { } while (0) +#define trace_ext4_fc_replay(...) do { } while (0) + +/* ext4 fsmap traces */ +#define trace_ext4_fsmap_mapping(...) do { } while (0) +#define trace_ext4_fsmap_low_key(...) do { } while (0) +#define trace_ext4_fsmap_high_key(...) do { } while (0) + +/* jbd2 checkpoint traces */ +#define trace_jbd2_checkpoint(...) do { } while (0) +#define trace_jbd2_shrink_checkpoint_list(...) do { } while (0) +#define trace_jbd2_checkpoint_stats(...) do { } while (0) +#define trace_jbd2_drop_transaction(...) do { } while (0) + +/* jbd2 commit traces */ +#define trace_jbd2_submit_inode_data(...) do { } while (0) +#define trace_jbd2_start_commit(...) do { } while (0) +#define trace_jbd2_commit_locking(...) do { } while (0) +#define trace_jbd2_commit_flushing(...) do { } while (0) +#define trace_jbd2_commit_logging(...) do { } while (0) +#define trace_jbd2_run_stats(...) do { } while (0) +#define trace_jbd2_end_commit(...) do { } while (0) + +/* jbd2 handle traces */ +#define trace_jbd2_handle_start(...) do { } while (0) +#define trace_jbd2_handle_extend(...) do { } while (0) +#define trace_jbd2_handle_restart(...) do { } while (0) +#define trace_jbd2_handle_stats(...) do { } while (0) +#define trace_jbd2_lock_buffer_stall(...) do { } while (0) + +/* jbd2 journal traces */ +#define trace_jbd2_update_log_tail(...) do { } while (0) +#define trace_jbd2_shrink_scan_enter(...) do { } while (0) +#define trace_jbd2_shrink_scan_exit(...) do { } while (0) +#define trace_jbd2_shrink_count(...) do { } while (0) +#define trace_jbd2_write_superblock(...) do { } while (0) + +#endif /* _EXT4_TRACE_H */ diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index f208889cbac..5a55984ec75 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -40,6 +40,7 @@ #include /* Real rbtree implementation */ #include /* For timespec64, time64_t */ #include /* For crc32() used by crc32_be */ +#include "ext4_trace.h" /* Trace event stubs */ /* * __CHAR_UNSIGNED__ - directory hash algorithm selection @@ -302,12 +303,7 @@ extern struct user_namespace init_user_ns; /* sb_rdonly - check if filesystem is mounted read-only */ #define sb_rdonly(sb) ((sb)->s_flags & SB_RDONLY) -/* Trace stubs */ -#define trace_ext4_journal_start_inode(...) do { } while (0) -#define trace_ext4_journal_start_sb(...) do { } while (0) -#define trace_ext4_journal_start_reserved(...) do { } while (0) -#define trace_ext4_forget(...) do { } while (0) -#define trace_ext4_read_block_bitmap_load(...) do { } while (0) +/* Trace stubs are now in ext4_trace.h */ /* Buffer operations - stubs */ #define wait_on_buffer(bh) do { } while (0) @@ -367,12 +363,6 @@ struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); #define dquot_drop(inode) do { (void)(inode); } while (0) #endif /* _LINUX_QUOTAOPS_H */ -/* Trace stubs for ialloc.c */ -#define trace_ext4_load_inode_bitmap(...) do { } while (0) -#define trace_ext4_free_inode(...) do { } while (0) -#define trace_ext4_allocate_inode(...) do { } while (0) -#define trace_ext4_request_inode(...) do { } while (0) - /* icount - inode reference count */ #define icount_read(inode) (1) @@ -1059,26 +1049,6 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) /* extents.c stubs */ -/* Trace functions for extents.c */ -#define trace_ext4_ext_load_extent(...) do { } while (0) -#define trace_ext4_ext_rm_idx(...) do { } while (0) -#define trace_ext4_remove_blocks(...) do { } while (0) -#define trace_ext4_ext_rm_leaf(...) do { } while (0) -#define trace_ext4_ext_remove_space(...) do { } while (0) -#define trace_ext4_ext_remove_space_done(...) do { } while (0) -#define trace_ext4_ext_convert_to_initialized_enter(...) do { } while (0) -#define trace_ext4_ext_convert_to_initialized_fastpath(...) do { } while (0) -#define trace_ext4_ext_handle_unwritten_extents(...) do { } while (0) -#define trace_ext4_get_implied_cluster_alloc_exit(...) do { } while (0) -#define trace_ext4_ext_map_blocks_enter(...) do { } while (0) -#define trace_ext4_ext_map_blocks_exit(...) do { } while (0) -#define trace_ext4_ext_show_extent(...) do { } while (0) -#define trace_ext4_collapse_range(...) do { } while (0) -#define trace_ext4_insert_range(...) do { } while (0) -#define trace_ext4_zero_range(...) do { } while (0) -#define trace_ext4_fallocate_enter(...) do { } while (0) -#define trace_ext4_fallocate_exit(...) do { } while (0) - /* rwsem is_locked stub */ #define rwsem_is_locked(sem) (1) @@ -1177,10 +1147,6 @@ static inline int in_range(unsigned long val, unsigned long start, /* indirect.c stubs */ -/* Trace functions for indirect.c */ -#define trace_ext4_ind_map_blocks_enter(...) do { } while (0) -#define trace_ext4_ind_map_blocks_exit(...) do { } while (0) - /* umin - unsigned min (Linux 6.x) */ #define umin(x, y) ((x) < (y) ? (x) : (y)) @@ -1443,38 +1409,6 @@ typedef unsigned int projid_t; /* hash_64 - simple 64-bit hash */ #define hash_64(val, bits) ((unsigned long)((val) >> (64 - (bits)))) -/* Trace stubs for inode.c */ -#define trace_ext4_begin_ordered_truncate(...) do { } while (0) -#define trace_ext4_evict_inode(...) do { } while (0) -#define trace_ext4_da_update_reserve_space(...) do { } while (0) -#define trace_ext4_da_reserve_space(...) do { } while (0) -#define trace_ext4_da_release_space(...) do { } while (0) -#define trace_ext4_da_write_pages_extent(...) do { } while (0) -#define trace_ext4_writepages(...) do { } while (0) -#define trace_ext4_da_write_folios_start(...) do { } while (0) -#define trace_ext4_da_write_folios_end(...) do { } while (0) -#define trace_ext4_writepages_result(...) do { } while (0) -#define trace_ext4_da_write_begin(...) do { } while (0) -#define trace_ext4_da_write_end(...) do { } while (0) -#define trace_ext4_alloc_da_blocks(...) do { } while (0) -#define trace_ext4_read_folio(...) do { } while (0) -#define trace_ext4_invalidate_folio(...) do { } while (0) -#define trace_ext4_journalled_invalidate_folio(...) do { } while (0) -#define trace_ext4_release_folio(...) do { } while (0) -#define trace_ext4_punch_hole(...) do { } while (0) -#define trace_ext4_truncate_enter(...) do { } while (0) -#define trace_ext4_truncate_exit(...) do { } while (0) -#define trace_ext4_load_inode(...) do { } while (0) -#define trace_ext4_other_inode_update_time(...) do { } while (0) -#define trace_ext4_mark_inode_dirty(...) do { } while (0) -#define trace_ext4_write_begin(...) do { } while (0) -#define trace_ext4_write_end(...) do { } while (0) -#define trace_ext4_journalled_write_end(...) do { } while (0) -#define trace_ext4_sync_file_enter(...) do { } while (0) -#define trace_ext4_sync_file_exit(...) do { } while (0) -#define trace_ext4_unlink_enter(...) do { } while (0) -#define trace_ext4_unlink_exit(...) do { } while (0) - /* Dentry operations - stubs */ #define d_find_any_alias(i) ({ (void)(i); (struct dentry *)NULL; }) #define dget_parent(d) ({ (void)(d); (struct dentry *)NULL; }) @@ -2296,12 +2230,6 @@ int inode_generic_drop(struct inode *inode); /* rwlock_init is a macro in linux/spinlock.h */ -/* Trace stubs */ -#define trace_ext4_drop_inode(i, d) do { } while (0) -#define trace_ext4_nfs_commit_metadata(i) do { } while (0) -#define trace_ext4_prefetch_bitmaps(...) do { } while (0) -#define trace_ext4_lazy_itable_init(...) do { } while (0) - /* slab usercopy - use regular kmem_cache_create */ #define kmem_cache_create_usercopy(n, sz, al, fl, uo, us, c) \ kmem_cache_create(n, sz, al, fl, c) @@ -2475,9 +2403,6 @@ void dquot_free_block(struct inode *inode, loff_t nr); #define set_blocksize(f, size) ({ (void)(f); (void)(size); 0; }) struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned size); -/* Trace stubs for super.c */ -#define trace_ext4_sync_fs(sb, wait) do { (void)(sb); (void)(wait); } while (0) - /* Workqueue operations - stubs */ #define flush_workqueue(wq) do { (void)(wq); } while (0) @@ -2555,28 +2480,6 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, #undef folio_address #define folio_address(folio) ((folio)->data) -/* Trace stubs for mballoc.c */ -#define trace_ext4_mb_bitmap_load(sb, group) \ - do { (void)(sb); (void)(group); } while (0) -#define trace_ext4_mb_buddy_bitmap_load(sb, group) \ - do { (void)(sb); (void)(group); } while (0) -#define trace_ext4_mballoc_alloc(ac) \ - do { (void)(ac); } while (0) -#define trace_ext4_mballoc_prealloc(ac) \ - do { (void)(ac); } while (0) -#define trace_ext4_mballoc_discard(sb, inode, group, start, len) \ - do { (void)(sb); (void)(inode); (void)(group); (void)(start); (void)(len); } while (0) -#define trace_ext4_mballoc_free(sb, inode, group, start, len) \ - do { (void)(sb); (void)(inode); (void)(group); (void)(start); (void)(len); } while (0) -#define trace_ext4_mb_release_inode_pa(pa, block, count) \ - do { (void)(pa); (void)(block); (void)(count); } while (0) -#define trace_ext4_mb_release_group_pa(sb, pa) \ - do { (void)(sb); (void)(pa); } while (0) -#define trace_ext4_mb_new_inode_pa(ac, pa) \ - do { (void)(ac); (void)(pa); } while (0) -#define trace_ext4_mb_new_group_pa(ac, pa) \ - do { (void)(ac); (void)(pa); } while (0) - /* sb_end_intwrite stub */ #define sb_end_intwrite(sb) do { (void)(sb); } while (0) @@ -2618,10 +2521,6 @@ struct seq_operations { /* Block device properties */ #define bdev_nonrot(bdev) ({ (void)(bdev); 0; }) -/* Trace stub for discard */ -#define trace_ext4_discard_blocks(sb, blk, count) \ - do { (void)(sb); (void)(blk); (void)(count); } while (0) - /* sb_issue_discard - issue discard request (no-op in U-Boot) */ #define sb_issue_discard(sb, sector, nr_sects, gfp, flags) \ ({ (void)(sb); (void)(sector); (void)(nr_sects); (void)(gfp); (void)(flags); 0; }) @@ -2647,22 +2546,6 @@ struct seq_operations { #define schedule_timeout_uninterruptible(t) do { } while (0) #define need_resched() (0) -/* Trace stubs for mballoc.c */ -#define trace_ext4_discard_preallocations(inode, cnt) \ - do { (void)(inode); (void)(cnt); } while (0) -#define trace_ext4_mb_discard_preallocations(sb, needed) \ - do { (void)(sb); (void)(needed); } while (0) -#define trace_ext4_request_blocks(ar) \ - do { (void)(ar); } while (0) -#define trace_ext4_allocate_blocks(ar, block) \ - do { (void)(ar); (void)(block); } while (0) -#define trace_ext4_free_blocks(inode, block, count, flags) \ - do { (void)(inode); (void)(block); (void)(count); (void)(flags); } while (0) -#define trace_ext4_trim_extent(sb, group, start, count) \ - do { (void)(sb); (void)(group); (void)(start); (void)(count); } while (0) -#define trace_ext4_trim_all_free(sb, group, start, max) \ - do { (void)(sb); (void)(group); (void)(start); (void)(max); } while (0) - /* Block device operations */ #define sb_find_get_block_nonatomic(sb, block) \ ({ (void)(sb); (void)(block); (struct buffer_head *)NULL; }) @@ -2832,18 +2715,6 @@ struct wait_bit_entry { #define release_dentry_name_snapshot(snap) \ do { (void)(snap); } while (0) -/* Fast commit trace stubs */ -#define trace_ext4_fc_track_unlink(handle, inode, dentry, ret) \ - do { (void)(handle); (void)(inode); (void)(dentry); (void)(ret); } while (0) -#define trace_ext4_fc_track_link(handle, inode, dentry, ret) \ - do { (void)(handle); (void)(inode); (void)(dentry); (void)(ret); } while (0) -#define trace_ext4_fc_track_create(handle, inode, dentry, ret) \ - do { (void)(handle); (void)(inode); (void)(dentry); (void)(ret); } while (0) -#define trace_ext4_fc_track_inode(handle, inode, ret) \ - do { (void)(handle); (void)(inode); (void)(ret); } while (0) -#define trace_ext4_fc_track_range(handle, inode, start, end, ret) \ - do { (void)(handle); (void)(inode); (void)(start); (void)(end); (void)(ret); } while (0) - /* lockdep stubs */ #define lockdep_assert_not_held(lock) do { (void)(lock); } while (0) @@ -2851,16 +2722,6 @@ struct wait_bit_entry { #define REQ_IDLE 0 #define REQ_PREFLUSH 0 -/* Fast commit trace stubs */ -#define trace_ext4_fc_cleanup(sb, full, reason) \ - do { (void)(sb); (void)(full); (void)(reason); } while (0) -#define trace_ext4_fc_stats(sb) \ - do { (void)(sb); } while (0) -#define trace_ext4_fc_commit_start(sb, tid) \ - do { (void)(sb); (void)(tid); } while (0) -#define trace_ext4_fc_commit_stop(sb, nblks, status, tid) \ - do { (void)(sb); (void)(nblks); (void)(status); (void)(tid); } while (0) - /* wake_up_bit - wake up threads waiting on a bit */ #define wake_up_bit(word, bit) do { (void)(word); (void)(bit); } while (0) @@ -2868,12 +2729,6 @@ struct wait_bit_entry { #define d_alloc(parent, name) ({ (void)(parent); (void)(name); (struct dentry *)NULL; }) #define d_drop(dentry) do { (void)(dentry); } while (0) -/* More fast commit trace stubs */ -#define trace_ext4_fc_replay_scan(sb, err, off) \ - do { (void)(sb); (void)(err); (void)(off); } while (0) -#define trace_ext4_fc_replay(sb, tag, ino, priv1, priv2) \ - do { (void)(sb); (void)(tag); (void)(ino); (void)(priv1); (void)(priv2); } while (0) - /* get_current_ioprio - I/O priority (not used in U-Boot) */ #define get_current_ioprio() (0) @@ -2882,15 +2737,6 @@ struct wait_bit_entry { #define write_dirty_buffer(bh, flags) sync_dirty_buffer(bh) #define spin_needbreak(l) ({ (void)(l); 0; }) -/* JBD2 trace stubs */ -#define trace_jbd2_checkpoint(j, r) do { (void)(j); (void)(r); } while (0) -#define trace_jbd2_shrink_checkpoint_list(j, f, t, l, n, d) \ - do { (void)(j); (void)(f); (void)(t); (void)(l); (void)(n); (void)(d); } while (0) -#define trace_jbd2_checkpoint_stats(d, tid, stats) \ - do { (void)(d); (void)(tid); (void)(stats); } while (0) -#define trace_jbd2_drop_transaction(j, t) \ - do { (void)(j); (void)(t); } while (0) - /* JBD2 commit.c stubs */ #define clear_bit_unlock(nr, addr) clear_bit(nr, addr) #define smp_mb__after_atomic() do { } while (0) @@ -2925,30 +2771,11 @@ struct disk_partition *ext4l_get_partition(void); /* cond_resched_lock - conditionally reschedule while holding a lock */ #define cond_resched_lock(lock) do { (void)(lock); } while (0) -/* More JBD2 trace stubs for commit.c */ -#define trace_jbd2_submit_inode_data(i) do { (void)(i); } while (0) -#define trace_jbd2_start_commit(j, t) do { (void)(j); (void)(t); } while (0) -#define trace_jbd2_commit_locking(j, t) do { (void)(j); (void)(t); } while (0) -#define trace_jbd2_commit_flushing(j, t) do { (void)(j); (void)(t); } while (0) -#define trace_jbd2_commit_logging(j, t) do { (void)(j); (void)(t); } while (0) -#define trace_jbd2_run_stats(d, tid, stats) \ - do { (void)(d); (void)(tid); (void)(stats); } while (0) -#define trace_jbd2_end_commit(j, t) do { (void)(j); (void)(t); } while (0) - -/* JBD2 transaction.c trace stubs */ -#define trace_jbd2_handle_start(...) do { } while (0) -#define trace_jbd2_handle_extend(...) do { } while (0) -#define trace_jbd2_handle_restart(...) do { } while (0) -#define trace_jbd2_handle_stats(...) do { } while (0) -#define trace_jbd2_lock_buffer_stall(...) do { } while (0) - /* JBD2 journal.c stubs */ struct buffer_head *alloc_buffer_head(gfp_t gfp_mask); struct buffer_head *__getblk(struct block_device *bdev, sector_t block, unsigned int size); int bmap(struct inode *inode, sector_t *block); -#define trace_jbd2_update_log_tail(j, t, b, f) \ - do { (void)(j); (void)(t); (void)(b); (void)(f); } while (0) /* seq_file operations for /proc - stubs */ #define seq_open(f, ops) ({ (void)(f); (void)(ops); 0; }) @@ -2980,16 +2807,6 @@ loff_t seq_lseek(struct file *f, loff_t o, int w); /* lockdep stubs (struct lock_class_key defined earlier) */ #define lockdep_init_map(...) do { } while (0) -/* More JBD2 trace stubs for journal.c */ -#define trace_jbd2_shrink_scan_enter(j, n, c) \ - do { (void)(j); (void)(n); (void)(c); } while (0) -#define trace_jbd2_shrink_scan_exit(j, n, s, c) \ - do { (void)(j); (void)(n); (void)(s); (void)(c); } while (0) -#define trace_jbd2_shrink_count(j, n, c) \ - do { (void)(j); (void)(n); (void)(c); } while (0) -#define trace_jbd2_write_superblock(j, f) \ - do { (void)(j); (void)(f); } while (0) - /* Block device operations for journal.c */ int bh_read(struct buffer_head *bh, int flags); #define bh_read_nowait(bh, flags) bh_read(bh, flags) @@ -3088,10 +2905,6 @@ struct fsmap { #define FMH_IF_VALID 0 #define FMH_OF_DEV_T (1 << 0) -#define trace_ext4_fsmap_mapping(sb, d, a, p, l, o) do { } while (0) -#define trace_ext4_fsmap_low_key(sb, d, a, p, l, o) do { } while (0) -#define trace_ext4_fsmap_high_key(sb, d, a, p, l, o) do { } while (0) - /* list_sort and sort stubs for fsmap.c */ #define list_sort(priv, head, cmp) \ do { (void)(priv); (void)(head); (void)(cmp); } while (0) From patchwork Wed Jan 14 22:55:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1499 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=1768431437; bh=/GJzMwUbRxsvPWjExNCbN/DHWZpuQUZNyMAPtWVdR4k=; 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=czlVI+U4WIGI2gxBO38jr1mtqs3glvbPTfzr0CGcjQzIMfhKJ55gVgp6LSoi+Z1FO l8sebWSCNi/hjciBC+I5L0P2qzv/2f/neub8nElnib/e+/R+5EtCVzfjCSkBCXUnwy eoIhOPAkhaJSdUtOWb5qdpcAixQImQ88A3FHWcRAmSuIPCfqZGf5pMh2sP0VZkkH8t 4a5dKpa9HnZbFYQ89flExc9XIFyygqMmH1PqinOmpIZc7trz4MxJmkvZNtZ0oztmZX WnT/ZyH6T0LBV/m0W3dyvKivVECKffDX+4tNvKIPCrxhHKpXzaJa1irqM9UOkaTMlf e6Rl3jnCK9MaA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 188B46934D for ; Wed, 14 Jan 2026 15:57:17 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id BX0UFBdkBC_q for ; Wed, 14 Jan 2026 15:57:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431437; bh=/GJzMwUbRxsvPWjExNCbN/DHWZpuQUZNyMAPtWVdR4k=; 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=czlVI+U4WIGI2gxBO38jr1mtqs3glvbPTfzr0CGcjQzIMfhKJ55gVgp6LSoi+Z1FO l8sebWSCNi/hjciBC+I5L0P2qzv/2f/neub8nElnib/e+/R+5EtCVzfjCSkBCXUnwy eoIhOPAkhaJSdUtOWb5qdpcAixQImQ88A3FHWcRAmSuIPCfqZGf5pMh2sP0VZkkH8t 4a5dKpa9HnZbFYQ89flExc9XIFyygqMmH1PqinOmpIZc7trz4MxJmkvZNtZ0oztmZX WnT/ZyH6T0LBV/m0W3dyvKivVECKffDX+4tNvKIPCrxhHKpXzaJa1irqM9UOkaTMlf e6Rl3jnCK9MaA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0808D69342 for ; Wed, 14 Jan 2026 15:57:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431435; bh=EwTg7F0B86PSFrQ1nRwx8Yoloyo5TRfNlhqj+82d/qA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UL/6jdanfUeCEv11s8VBSxYzQ1CnlSaZLJGI8aGhVUKfcxQWPSR7XB9I37KNrOCzf dKjpy5j8qYKrSY/iwM4IZA0Snh8CYzpL5Zmsyny0eMm/+Do+mFnWZaVE5HiqlAg0vX uQatKsAoIekY1oATK1qnnmxwYicPToAofCIpMdBsQVyaMqNjQ1sjOrtrPs6RapLemb PhnQ2OmxOKGw9E/x2ELXNPd6cZGuqlve5kvbZB1thbH7jV7ZHjRxzBZ2J1Xv/KcSZ/ 42LgqKgeNI3xxrT7qUksVdZiyba20pdO87UfXlrdUekC3OEwtEKlpM5dcW9APJuaLV so6tGsLfGEuhg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0E322692F1; Wed, 14 Jan 2026 15:57: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 10026) with ESMTP id 6Pg5uUTHqaur; Wed, 14 Jan 2026 15:57:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431431; bh=lGfoRWR6bfVjWbDS02qHpFnU1kJ87xsfaEnBQj99A2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eLk+f8Z1bBXTte/V266c/tLqnt7RYHgiKffIH8hZDS/wLXBpW4w2OEOl/36ch3V7C Ka4qjpsZ535Yf45BKUtE32yOD4HJ/MY6LUXx1QWNKqdbacPF0Lu0aO8eKKj9bxhBID IBTsv4DzRpw5ixFJ5FJ3U9aO1uybNd1K9azYebreDz/s/+rVZhM15UX7FfyYj55Z/N q8xOD35/UTQLyvXSux67oR7l4aVOSEWIlnPjbIr3+SaddCE39DOSClpVIalbjchpIC NQ5QX4OhP2mw1GruWZtPXEAKYe+TxoBkPOn751CxmOrtTGPyWowr0iigjIKmwC3bCa ISClsPOOZ/Y/g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B5CC4692EF; Wed, 14 Jan 2026 15:57:10 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:55 -0700 Message-ID: <20260114225635.3407989-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TXPQJZ5UQ5CMY2V5HXXZ74X634VZ6ODI X-Message-ID-Hash: TXPQJZ5UQ5CMY2V5HXXZ74X634VZ6ODI 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/34] ext4l: Remove duplicate macro definitions 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 several duplicate macros from ext4_uboot.h: - rcu_read_lock, rcu_read_unlock, synchronize_rcu, rcu_assign_pointer, rcu_dereference - were defined in both RCU stubs section and later in RCU list operations section - filemap_invalidate_lock_shared, filemap_invalidate_unlock_shared - sb_end_intwrite Keep the first occurrences and add comments to reference them where duplicates are removed. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 5a55984ec75..8a160a2db19 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -434,6 +434,7 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, #define rcu_dereference_protected(p, c) (p) #define rcu_assign_pointer(p, v) ((p) = (v)) #define call_rcu(head, func) do { func(head); } while (0) +#define synchronize_rcu() do { } while (0) /* RCU head for callbacks - defined in linux/compat.h as callback_head */ @@ -1519,8 +1520,7 @@ static inline char *d_path(const struct path *path, char *buf, int buflen) #define filemap_write_and_wait(m) ({ (void)(m); 0; }) #define filemap_dirty_folio(m, f) ({ (void)(m); (void)(f); false; }) #define filemap_lock_folio(m, i) ((struct folio *)NULL) -#define filemap_invalidate_lock_shared(m) do { } while (0) -#define filemap_invalidate_unlock_shared(m) do { } while (0) +/* filemap_invalidate_lock_shared defined earlier */ #define mapping_tagged(m, t) (0) #define tag_pages_for_writeback(m, s, e) do { } while (0) #define try_to_writeback_inodes_sb(sb, r) do { } while (0) @@ -2480,8 +2480,7 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, #undef folio_address #define folio_address(folio) ((folio)->data) -/* sb_end_intwrite stub */ -#define sb_end_intwrite(sb) do { (void)(sb); } while (0) +/* sb_end_intwrite defined earlier */ /* WARN_RATELIMIT - just evaluate condition, no warning in U-Boot */ #define WARN_RATELIMIT(condition, ...) (condition) @@ -2533,11 +2532,7 @@ struct seq_operations { #define list_del_rcu(entry) list_del(entry) #define list_add_rcu(new, head) list_add(new, head) #define list_add_tail_rcu(new, head) list_add_tail(new, head) -#define rcu_read_lock() do { } while (0) -#define rcu_read_unlock() do { } while (0) -#define synchronize_rcu() do { } while (0) -#define rcu_assign_pointer(p, v) ((p) = (v)) -#define rcu_dereference(p) (p) +/* Other RCU stubs are defined earlier in this file */ /* raw_cpu_ptr - get pointer to per-CPU data for current CPU */ #define raw_cpu_ptr(ptr) (ptr) From patchwork Wed Jan 14 22:55:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1500 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=1768431441; bh=uvxoPJpymzPXx8vCTAaLP9LaoNEsE7MO9Pxqt2SXspo=; 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=GpdbLQVYH6ZdsnqHTpqYFy8O29TaJ7yI7JNFUVzhAMKDggTFxKaDriLexg8aBpwAd IyipXIcywH0zpML7sZoOaHPmpEVmSXmBQugObKmIYqlGJqMcRiwhrbaddu2di6fN6T 2H8oAuTCS9ZKBj28aRp4IHMj3BPR3Rii5d5do6+H4Uo6Zq9o767+5Afl/IbKBZgAAI mQsgH0YpRMw1QvtIzMXC7b1P/UxwYPR10tP9TDEi/A2lCaW4JsfbOyZxkE4W6guUba MuQbPFklEUR9WFSXcbX/wjOwsOuU9unmQi9Yp3Wh2AL0kRUHYKO+auSmPnO3Euilag 0RbYklmdLtHVg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A16666934D for ; Wed, 14 Jan 2026 15:57:21 -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 8ZIyNXx7PR8K for ; Wed, 14 Jan 2026 15:57:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431441; bh=uvxoPJpymzPXx8vCTAaLP9LaoNEsE7MO9Pxqt2SXspo=; 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=GpdbLQVYH6ZdsnqHTpqYFy8O29TaJ7yI7JNFUVzhAMKDggTFxKaDriLexg8aBpwAd IyipXIcywH0zpML7sZoOaHPmpEVmSXmBQugObKmIYqlGJqMcRiwhrbaddu2di6fN6T 2H8oAuTCS9ZKBj28aRp4IHMj3BPR3Rii5d5do6+H4Uo6Zq9o767+5Afl/IbKBZgAAI mQsgH0YpRMw1QvtIzMXC7b1P/UxwYPR10tP9TDEi/A2lCaW4JsfbOyZxkE4W6guUba MuQbPFklEUR9WFSXcbX/wjOwsOuU9unmQi9Yp3Wh2AL0kRUHYKO+auSmPnO3Euilag 0RbYklmdLtHVg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8B97D69342 for ; Wed, 14 Jan 2026 15:57:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431439; bh=m0MXMBwnSqpo2ksywULmaO+gODUkyFwcbLA8PSq6ins=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jm8w1B8/ok78ebgOfb0neZ9PFRoZQrnR6Ltoe9pFaguhC6dlVEBZBH10UWVwSLRel a5IxTL6Db+fr2cAMblEjAfLvhUHqVYCQbxKrE6CXcFmhN2nnTjFg6W3YNHts06NjBC Pb4q+Wc3d+BzSBpiWJLQkd2280BT+CiJLQ9fyFd88zhaM+renWCSe6asLgftUALfMQ xInQQQaVEWj7qG8n9BWpRk1lV5emAAAXER0CuUiFWX4HhRZr7rL5Sel2zb7/9r8XGN gkbbDuXIRymMHSSmlsNBaHtgIZrOaE/PrBlrn5rX4E2s55lr5uGWUC1xs0npqxBwVH BwVXMc/O57EgQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ACBED692F1; Wed, 14 Jan 2026 15:57:19 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id sJCpf23kA4Vz; Wed, 14 Jan 2026 15:57:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431435; bh=bl8NL5N7TVUgENHNQQKYjLiwY1F6Bf5Js7lKf6qdaLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u2uNJMDaFZcPDopn/QWEAtJggSFmo0GyJDKpiyqzuxinRT/2FqEOMRLHMsscltSIM 2dDgYd2G5iL9GGrm3hVNDCb0GlPypUggWnBy+fBgS2uRCeJBeR8jzerKb0MNx//zxV ipzJ59nQVyHnxsu+U0UArXg8hvS4S96kctYl2ExixWXW+A5z16ATkzIZPoCD36igc5 9Lh1eCeqhs2QunoK6labGhaCRJf95Ct2j73dzrxwnJqIz3/lresXhRJvxZqUKEOO4w jf50DWNffd+tb5dVFdYbP+JYd5bNvbxstre3TWBtyN67htS96+C31F0Z/frAoGsrph Pb98MnLO5rVfA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 60CD0692EF; Wed, 14 Jan 2026 15:57:15 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:56 -0700 Message-ID: <20260114225635.3407989-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GSILMJWAVM3P4IBBFAHPZYTE5NMLCO26 X-Message-ID-Hash: GSILMJWAVM3P4IBBFAHPZYTE5NMLCO26 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/34] ext4l: Move flush_workqueue to linux/workqueue.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 flush_workqueue stub from ext4_uboot.h to the common linux/workqueue.h header where other workqueue stubs reside. Also simplify the quota stubs section by removing the unnecessary _LINUX_QUOTAOPS_H guard, since quotaops.h is not included. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 ++----- include/linux/workqueue.h | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 8a160a2db19..2ffa8ab271b 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -353,15 +353,13 @@ struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); /* Group permission - stub */ #define in_group_p(gid) (0) -/* Quota operations - stubs (only define if quotaops.h not included) */ -#ifndef _LINUX_QUOTAOPS_H +/* Quota operations - stubs */ #define dquot_alloc_block_nofail(inode, nr) \ ({ (inode)->i_blocks += (nr) << ((inode)->i_blkbits - 9); 0; }) #define dquot_initialize(inode) ({ (void)(inode); 0; }) #define dquot_free_inode(inode) do { (void)(inode); } while (0) #define dquot_alloc_inode(inode) ({ (void)(inode); 0; }) #define dquot_drop(inode) do { (void)(inode); } while (0) -#endif /* _LINUX_QUOTAOPS_H */ /* icount - inode reference count */ #define icount_read(inode) (1) @@ -2403,8 +2401,7 @@ void dquot_free_block(struct inode *inode, loff_t nr); #define set_blocksize(f, size) ({ (void)(f); (void)(size); 0; }) struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned size); -/* Workqueue operations - stubs */ -#define flush_workqueue(wq) do { (void)(wq); } while (0) +/* flush_workqueue is now in linux/workqueue.h */ /* Quota stubs for super.c */ #define dquot_writeback_dquots(sb, type) do { (void)(sb); (void)(type); } while (0) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 66f61fa6e77..2ae57341861 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -79,6 +79,10 @@ static inline void destroy_workqueue(struct workqueue_struct *wq) { } +static inline void flush_workqueue(struct workqueue_struct *wq) +{ +} + /* System workqueues - all stubs in U-Boot */ #define system_dfl_wq ((struct workqueue_struct *)1) #define system_wq ((struct workqueue_struct *)1) From patchwork Wed Jan 14 22:55:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1501 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=1768431446; bh=mS4v652BnDkneD/eWf9A71TxHDchQq2lSGgXww1IZ5g=; 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=cSBQNV6LlR0oHMGLbFIJ7pkkazkIUGruP6SLHuYuXwxmHEVGmeVglMuxmO9QH23fh niC9UnO+2wjUPNvEMirF48bB0LoImhp6BD4vYodrHe0HgII8KRLr4frs4tZ6WRWcJ8 RMu1I+iNEiA5A2zikQLWUYFaUqkN3KAiBCy+j7t2wiBbJLA3Y/JYB5s0/3S2Yy+VBC gL81enWb9xBkE0RUnSSBY5h9S3rstv3AWeZhls/J0fS/kYFFDhfbHVRnbMq/y+gZbW 5kmu1NVGcT57u4Bam6NElqnuZ4sVqlmV3J13Ok2lbYbx0mpsnQNTrrYlaPnu46vW/Y 3/+qG0OmJ7i1Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 86C796935C for ; Wed, 14 Jan 2026 15:57:26 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id PMzP6Zs3rvxJ for ; Wed, 14 Jan 2026 15:57:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431446; bh=mS4v652BnDkneD/eWf9A71TxHDchQq2lSGgXww1IZ5g=; 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=cSBQNV6LlR0oHMGLbFIJ7pkkazkIUGruP6SLHuYuXwxmHEVGmeVglMuxmO9QH23fh niC9UnO+2wjUPNvEMirF48bB0LoImhp6BD4vYodrHe0HgII8KRLr4frs4tZ6WRWcJ8 RMu1I+iNEiA5A2zikQLWUYFaUqkN3KAiBCy+j7t2wiBbJLA3Y/JYB5s0/3S2Yy+VBC gL81enWb9xBkE0RUnSSBY5h9S3rstv3AWeZhls/J0fS/kYFFDhfbHVRnbMq/y+gZbW 5kmu1NVGcT57u4Bam6NElqnuZ4sVqlmV3J13Ok2lbYbx0mpsnQNTrrYlaPnu46vW/Y 3/+qG0OmJ7i1Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6F3C469342 for ; Wed, 14 Jan 2026 15:57:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431444; bh=pjwaLrLp9qM9Fdr5OG7IakrGflJVZKRC0AZ+WgICfog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MOhrorrwXmaJb22CsqSjURObbYsvMjtKzCbCN1RUVKT+2WbVeoAltu8VCFGRNV54I GiKLTPYdl7GSjLjMmBM4A8zE+jfdpVZryVUJ1Fe55ymO5ymUHt3E8xkfK7HkUOgVWP sQU3zbb2lWyYIK1vpkc974mrEZ+hSzBuKNa8Yo/fv3xxN+vOOtEPhK3WzrIUQLYjq6 PrRHuz39qcVi0nh4vWvUQFFyqhGXMfahoCzKjGClp9PxOWdxPYcg1Bdr5AwxvgBqls a3xKWTIlmkWAOmxdcBMfyICEs1ZgCJttKE5fbPAVshVb0yDMRWLbM3Qtsks4GM8Mot 9qUcjh2SYXx/A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 61DFF692F1; Wed, 14 Jan 2026 15:57:24 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 5dXByqvARvXr; Wed, 14 Jan 2026 15:57:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431440; bh=bBmqwygWR3ikoJifpno0X6mL+sHBfNNqvUH7PFlhPn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mo74cdeV6RNpkgQC3L33o2FRyqBTQ1GD2w1tKVJMDtvchtCUFjQl0J59++ziroLXV RHPKGGEb+xQ1BJZwu37PuGRGVBGzIlj5XRsrMamb1EzfBr23xfRy6osv9h+N+W5o2y myhA1X52Szb5JCUd6e5I6zJO2Tc50BmREmhUeuNfjT4bXije39e3ESOyjupDdAL2ow 80xz2iQ/wP9bO5Gr01sXZMz/rkuqsyT7ruySVmLOKpgh4yjMxajnLCeNWvMf2JKwra 8tphwowQaWnQvScSNFcMcMaY1SHhmgSBhYBG/BfsJOCnZBuA4MEnuWA50gw27ZfFDm wnqnXg0e+smfg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F3812692EF; Wed, 14 Jan 2026 15:57:19 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:57 -0700 Message-ID: <20260114225635.3407989-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VO42GQZZUMTWMQ6HHJMF2IZ4UKKQZM5L X-Message-ID-Hash: VO42GQZZUMTWMQ6HHJMF2IZ4UKKQZM5L 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/34] ext4l: Consolidate fscrypt stubs into ext4_fscrypt.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 Create a dedicated header file for filesystem encryption (fscrypt) stubs that are scattered throughout ext4_uboot.h In Linux, fscrypt provides filesystem-level encryption, but U-Boot does not support this feature. The new ext4_fscrypt.h contains: - Structure definitions (qstr, fscrypt_str, fscrypt_dummy_policy, fscrypt_name) - Inline functions (fscrypt_has_encryption_key, fscrypt_fname_siphash, fscrypt_match_name) - Operation stubs for encryption, directory operations, symlinks - Page I/O and readpage stubs - Function declarations for stub.c implementations This reduces ext4_uboot.h by ~90 lines and makes the fscrypt interface more maintainable by keeping all encryption-related stubs in one place. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_fscrypt.h | 144 ++++++++++++++++++++++++++++++++++++++++ fs/ext4l/ext4_uboot.h | 120 +++++---------------------------- 2 files changed, 160 insertions(+), 104 deletions(-) create mode 100644 fs/ext4l/ext4_fscrypt.h diff --git a/fs/ext4l/ext4_fscrypt.h b/fs/ext4l/ext4_fscrypt.h new file mode 100644 index 00000000000..da91af74343 --- /dev/null +++ b/fs/ext4l/ext4_fscrypt.h @@ -0,0 +1,144 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * fscrypt stubs for U-Boot ext4l + * + * In Linux, fscrypt provides filesystem-level encryption. In U-Boot, + * encryption is not supported, so all fscrypt operations are stubbed out. + */ + +#ifndef _EXT4_FSCRYPT_H +#define _EXT4_FSCRYPT_H + +#include +#include +#include +#include + +/* Forward declarations */ +struct inode; +struct seq_file; +struct page; +struct folio; +struct bio; +struct buffer_head; +struct dentry; +struct super_block; + +/* qstr - quick string for filenames (needed by fscrypt_name) */ +struct qstr { + u32 hash; + u32 len; + const unsigned char *name; +}; + +/* fscrypt_str - encrypted filename string */ +struct fscrypt_str { + unsigned char *name; + u32 len; +}; + +/* fscrypt_dummy_policy - stub */ +struct fscrypt_dummy_policy { + int dummy; +}; + +/* fscrypt_name - stub structure for encrypted filenames */ +struct fscrypt_name { + const struct qstr *usr_fname; + struct fscrypt_str disk_name; + u32 hash; + u32 minor_hash; + bool is_nokey_name; +}; + +/* fscrypt context size */ +#define FSCRYPT_SET_CONTEXT_MAX_SIZE 40 + +/* IS_ENCRYPTED - always false in U-Boot */ +#define IS_ENCRYPTED(inode) (0) + +/* fscrypt inline functions */ +static inline bool fscrypt_has_encryption_key(const struct inode *inode) +{ + return false; +} + +static inline u64 fscrypt_fname_siphash(const struct inode *dir, + const struct qstr *name) +{ + return 0; +} + +static inline int fscrypt_match_name(const struct fscrypt_name *fname, + const u8 *de_name, u32 de_name_len) +{ + if (fname->usr_fname->len != de_name_len) + return 0; + + return !memcmp(fname->usr_fname->name, de_name, de_name_len); +} + +/* fscrypt operation stubs */ +#define fscrypt_prepare_new_inode(dir, i, e) ({ (void)(dir); (void)(i); (void)(e); 0; }) +#define fscrypt_set_context(inode, handle) ({ (void)(inode); (void)(handle); 0; }) +#define fscrypt_file_open(i, f) ({ (void)(i); (void)(f); 0; }) +#define fscrypt_inode_uses_fs_layer_crypto(i) (0) +#define fscrypt_decrypt_pagecache_blocks(f, l, o) ({ (void)(f); (void)(l); (void)(o); 0; }) +#define fscrypt_encrypt_pagecache_blocks(f, l, o, g) \ + ({ (void)(f); (void)(l); (void)(o); (void)(g); (struct page *)NULL; }) +#define fscrypt_zeroout_range(i, lb, pb, l) ({ (void)(i); (void)(lb); (void)(pb); (void)(l); 0; }) +#define fscrypt_limit_io_blocks(i, lb, l) (l) +#define fscrypt_prepare_setattr(d, a) ({ (void)(d); (void)(a); 0; }) +#define fscrypt_dio_supported(i) (1) +#define fscrypt_has_permitted_context(p, c) ({ (void)(p); (void)(c); 1; }) +#define fscrypt_is_nokey_name(d) ({ (void)(d); 0; }) +#define fscrypt_prepare_symlink(d, s, l, m, dl) \ + ({ (void)(d); (void)(m); (dl)->name = (unsigned char *)(s); (dl)->len = (l) + 1; 0; }) +#define fscrypt_encrypt_symlink(i, s, l, d) ({ (void)(i); (void)(s); (void)(l); (void)(d); 0; }) +#define fscrypt_prepare_link(o, d, n) ({ (void)(o); (void)(d); (void)(n); 0; }) +#define fscrypt_prepare_rename(od, ode, nd, nde, f) \ + ({ (void)(od); (void)(ode); (void)(nd); (void)(nde); (void)(f); 0; }) + +/* fscrypt directory operations */ +#define fscrypt_prepare_readdir(i) ({ (void)(i); 0; }) +#define fscrypt_fname_alloc_buffer(len, buf) ({ (void)(len); (void)(buf); 0; }) +#define fscrypt_fname_free_buffer(buf) do { (void)(buf); } while (0) +#define fscrypt_fname_disk_to_usr(i, h1, h2, d, u) \ + ({ (void)(i); (void)(h1); (void)(h2); (void)(d); (void)(u); 0; }) + +/* fscrypt symlink stubs */ +#define fscrypt_get_symlink(i, c, m, d) ({ (void)(i); (void)(c); (void)(m); (void)(d); ERR_PTR(-EOPNOTSUPP); }) +#define fscrypt_symlink_getattr(p, s) ({ (void)(p); (void)(s); 0; }) + +/* fscrypt inode operations */ +#define fscrypt_put_encryption_info(i) do { } while (0) +#define fscrypt_parse_test_dummy_encryption(p, d) ({ (void)(p); (void)(d); 0; }) + +/* fscrypt page-io stubs */ +#define fscrypt_is_bounce_folio(f) ({ (void)(f); 0; }) +#define fscrypt_pagecache_folio(f) (f) +#define fscrypt_free_bounce_page(p) do { (void)(p); } while (0) +#define fscrypt_set_bio_crypt_ctx_bh(bio, bh, gfp) \ + do { (void)(bio); (void)(bh); (void)(gfp); } while (0) +#define fscrypt_mergeable_bio_bh(bio, bh) \ + ({ (void)(bio); (void)(bh); true; }) + +/* fscrypt readpage stubs */ +#define fscrypt_decrypt_bio(bio) ({ (void)(bio); 0; }) +#define fscrypt_enqueue_decrypt_work(work) do { (void)(work); } while (0) +#define fscrypt_mergeable_bio(bio, inode, blk) \ + ({ (void)(bio); (void)(inode); (void)(blk); true; }) +#define fscrypt_set_bio_crypt_ctx(bio, inode, blk, gfp) \ + do { (void)(bio); (void)(inode); (void)(blk); (void)(gfp); } while (0) + +/* fscrypt function declarations (implemented in stub.c) */ +void fscrypt_free_dummy_policy(struct fscrypt_dummy_policy *policy); +int fscrypt_drop_inode(struct inode *inode); +void fscrypt_free_inode(struct inode *inode); +int fscrypt_is_dummy_policy_set(const struct fscrypt_dummy_policy *policy); +int fscrypt_dummy_policies_equal(const struct fscrypt_dummy_policy *p1, + const struct fscrypt_dummy_policy *p2); +void fscrypt_show_test_dummy_encryption(struct seq_file *seq, char sep, + struct super_block *sb); + +#endif /* _EXT4_FSCRYPT_H */ diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 2ffa8ab271b..c6795b35501 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -41,6 +41,7 @@ #include /* For timespec64, time64_t */ #include /* For crc32() used by crc32_be */ #include "ext4_trace.h" /* Trace event stubs */ +#include "ext4_fscrypt.h" /* fscrypt stubs */ /* * __CHAR_UNSIGNED__ - directory hash algorithm selection @@ -259,11 +260,7 @@ struct fiemap_extent_info { #define CAP_SYS_RESOURCE 0 #define capable(cap) (1) -/* fscrypt_str - stub */ -struct fscrypt_str { - unsigned char *name; - u32 len; -}; +/* fscrypt_str, qstr are now in ext4_fscrypt.h */ /* percpu rw semaphore - stubs */ struct percpu_rw_semaphore { @@ -281,12 +278,9 @@ static inline void memalloc_nofs_restore(unsigned int flags) { } /* Inode flags - stubs */ #define IS_CASEFOLDED(inode) (0) -#define IS_ENCRYPTED(inode) (0) +/* IS_ENCRYPTED and FSCRYPT_SET_CONTEXT_MAX_SIZE are in ext4_fscrypt.h */ #define S_NOQUOTA 0 -/* fscrypt context - stub */ -#define FSCRYPT_SET_CONTEXT_MAX_SIZE 40 - /* User namespace - stub */ struct user_namespace { int dummy; @@ -389,9 +383,7 @@ extern struct inode *new_inode(struct super_block *sb); #define clear_nlink(inode) do { } while (0) #define IS_DIRSYNC(inode) ({ (void)(inode); 0; }) -/* fscrypt stubs */ -#define fscrypt_prepare_new_inode(dir, i, e) ({ (void)(dir); (void)(i); (void)(e); 0; }) -#define fscrypt_set_context(inode, handle) ({ (void)(inode); (void)(handle); 0; }) +/* fscrypt_prepare_new_inode, fscrypt_set_context are in ext4_fscrypt.h */ /* ext4_init_acl is provided by acl.h */ /* xattr stubs for files that don't include xattr.h */ @@ -517,10 +509,7 @@ struct ratelimit_state { int dummy; }; -/* fscrypt_dummy_policy - stub */ -struct fscrypt_dummy_policy { - int dummy; -}; +/* fscrypt_dummy_policy and qstr are now in ext4_fscrypt.h */ /* errseq_t is defined in linux/fs.h */ /* time64_t is now in linux/time.h */ @@ -528,12 +517,6 @@ struct fscrypt_dummy_policy { /* IS_NOQUOTA - stub */ #define IS_NOQUOTA(inode) (0) -/* qstr - quick string for filenames (must be before dentry) */ -struct qstr { - const unsigned char *name; - unsigned int len; -}; - /* dentry - stub */ struct dentry { struct qstr d_name; @@ -981,17 +964,7 @@ struct dx_hash_info { /* seq_file - forward declaration */ struct seq_file; -/* fscrypt stubs - encryption not supported in U-Boot */ -static inline bool fscrypt_has_encryption_key(const struct inode *inode) -{ - return false; -} - -static inline u64 fscrypt_fname_siphash(const struct inode *dir, - const struct qstr *name) -{ - return 0; -} +/* fscrypt_has_encryption_key, fscrypt_fname_siphash are in ext4_fscrypt.h */ /* ext4 warning macros - stubs (only when ext4.h is not included) */ #ifdef EXT4_UBOOT_NO_EXT4_H @@ -1450,8 +1423,7 @@ static inline char *d_path(const struct path *path, char *buf, int buflen) return buf; } -/* fscrypt/fsverity stubs */ -#define fscrypt_file_open(i, f) ({ (void)(i); (void)(f); 0; }) +/* fscrypt_file_open is in ext4_fscrypt.h */ #define fsverity_file_open(i, f) ({ (void)(i); (void)(f); 0; }) /* Quota file open - stub */ @@ -1541,38 +1513,7 @@ static inline char *d_path(const struct path *path, char *buf, int buflen) #define map_bh(bh, sb, block) do { } while (0) #define write_begin_get_folio(iocb, m, idx, l) ({ (void)(iocb); (void)(m); (void)(idx); (void)(l); (struct folio *)NULL; }) -/* fscrypt stubs - additional */ -#define fscrypt_inode_uses_fs_layer_crypto(i) (0) -#define fscrypt_decrypt_pagecache_blocks(f, l, o) ({ (void)(f); (void)(l); (void)(o); 0; }) -#define fscrypt_encrypt_pagecache_blocks(f, l, o, g) ({ (void)(f); (void)(l); (void)(o); (void)(g); (struct page *)NULL; }) -#define fscrypt_zeroout_range(i, lb, pb, l) ({ (void)(i); (void)(lb); (void)(pb); (void)(l); 0; }) -#define fscrypt_limit_io_blocks(i, lb, l) (l) -#define fscrypt_prepare_setattr(d, a) ({ (void)(d); (void)(a); 0; }) -#define fscrypt_dio_supported(i) (1) -#define fscrypt_has_permitted_context(p, c) ({ (void)(p); (void)(c); 1; }) -#define fscrypt_is_nokey_name(d) ({ (void)(d); 0; }) -#define fscrypt_prepare_symlink(d, s, l, m, dl) ({ (void)(d); (void)(m); (dl)->name = (unsigned char *)(s); (dl)->len = (l) + 1; 0; }) -#define fscrypt_encrypt_symlink(i, s, l, d) ({ (void)(i); (void)(s); (void)(l); (void)(d); 0; }) -#define fscrypt_prepare_link(o, d, n) ({ (void)(o); (void)(d); (void)(n); 0; }) -#define fscrypt_prepare_rename(od, ode, nd, nde, f) ({ (void)(od); (void)(ode); (void)(nd); (void)(nde); (void)(f); 0; }) - -/* fscrypt_name - stub structure for encrypted filenames */ -struct fscrypt_name { - const struct qstr *usr_fname; - struct fscrypt_str disk_name; - u32 hash; - u32 minor_hash; - bool is_nokey_name; -}; - -static inline int fscrypt_match_name(const struct fscrypt_name *fname, - const u8 *de_name, u32 de_name_len) -{ - if (fname->usr_fname->len != de_name_len) - return 0; - - return !memcmp(fname->usr_fname->name, de_name, de_name_len); -} +/* fscrypt_name, fscrypt_match_name, and fscrypt stubs are in ext4_fscrypt.h */ /* fsverity stubs */ #define fsverity_prepare_setattr(d, a) ({ (void)(d); (void)(a); 0; }) @@ -1688,14 +1629,10 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); * Additional stubs for dir.c */ -/* fscrypt_str - encrypted filename string */ +/* FSTR_INIT - fscrypt_str initializer (fscrypt_str defined in ext4_fscrypt.h) */ #define FSTR_INIT(n, l) { .name = (n), .len = (l) } -/* fscrypt directory operations */ -#define fscrypt_prepare_readdir(i) ({ (void)(i); 0; }) -#define fscrypt_fname_alloc_buffer(len, buf) ({ (void)(len); (void)(buf); 0; }) -#define fscrypt_fname_free_buffer(buf) do { (void)(buf); } while (0) -#define fscrypt_fname_disk_to_usr(i, h1, h2, d, u) ({ (void)(i); (void)(h1); (void)(h2); (void)(d); (void)(u); 0; }) +/* fscrypt directory operations are in ext4_fscrypt.h */ /* Readahead operations */ #define ra_has_index(ra, idx) ({ (void)(ra); (void)(idx); 0; }) @@ -1801,9 +1738,7 @@ static inline const char *simple_get_link(struct dentry *dentry, return inode->i_link; } -/* fscrypt symlink stubs */ -#define fscrypt_get_symlink(i, c, m, d) ({ (void)(i); (void)(c); (void)(m); (void)(d); ERR_PTR(-EOPNOTSUPP); }) -#define fscrypt_symlink_getattr(p, s) ({ (void)(p); (void)(s); 0; }) +/* fscrypt symlink stubs are in ext4_fscrypt.h */ /* * Additional stubs for super.c @@ -2215,10 +2150,7 @@ void wait_for_completion(struct completion *comp); /* DAX - declaration for stub.c */ void fs_put_dax(void *dax, void *holder); -/* fscrypt - declarations for stub.c */ -void fscrypt_free_dummy_policy(struct fscrypt_dummy_policy *policy); -int fscrypt_drop_inode(struct inode *inode); -void fscrypt_free_inode(struct inode *inode); +/* fscrypt declarations are in ext4_fscrypt.h */ /* Inode allocation - declaration for stub.c */ void *alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, @@ -2236,10 +2168,8 @@ int inode_generic_drop(struct inode *inode); #define invalidate_inode_buffers(i) do { } while (0) #define clear_inode(i) do { } while (0) -/* fscrypt/fsverity additional stubs */ -#define fscrypt_put_encryption_info(i) do { } while (0) +/* fsverity stubs (fscrypt macros are in ext4_fscrypt.h) */ #define fsverity_cleanup_inode(i) do { } while (0) -#define fscrypt_parse_test_dummy_encryption(p, d) ({ (void)(p); (void)(d); 0; }) /* NFS export helpers - declarations for stub.c */ struct dentry *generic_fh_to_dentry(struct super_block *sb, struct fid *fid, @@ -2259,12 +2189,7 @@ int IOPRIO_PRIO_VALUE(int class, int data); char *kmemdup_nul(const char *s, size_t len, gfp_t gfp); #define strscpy_pad(dst, src) strncpy(dst, src, sizeof(dst)) -/* fscrypt/fsverity declarations for stub.c */ -int fscrypt_is_dummy_policy_set(const struct fscrypt_dummy_policy *policy); -int fscrypt_dummy_policies_equal(const struct fscrypt_dummy_policy *p1, - const struct fscrypt_dummy_policy *p2); -void fscrypt_show_test_dummy_encryption(struct seq_file *seq, char sep, - struct super_block *sb); +/* fscrypt declarations are in ext4_fscrypt.h */ /* Memory allocation - declarations for stub.c */ void *kvzalloc(size_t size, gfp_t flags); @@ -2618,14 +2543,7 @@ struct folio_iter { /* GFP_NOIO - allocation without I/O */ #define GFP_NOIO 0 -/* fscrypt stubs for page-io.c */ -#define fscrypt_is_bounce_folio(f) ({ (void)(f); 0; }) -#define fscrypt_pagecache_folio(f) (f) -#define fscrypt_free_bounce_page(p) do { (void)(p); } while (0) -#define fscrypt_set_bio_crypt_ctx_bh(bio, bh, gfp) \ - do { (void)(bio); (void)(bh); (void)(gfp); } while (0) -#define fscrypt_mergeable_bio_bh(bio, bh) \ - ({ (void)(bio); (void)(bh); 1; }) +/* fscrypt page-io stubs are in ext4_fscrypt.h */ /* folio writeback operations */ #define folio_end_writeback(f) do { (void)(f); } while (0) @@ -2657,13 +2575,7 @@ typedef void *mempool_t; #define folio_end_read(f, success) do { (void)(f); (void)(success); } while (0) #define folio_set_mappedtodisk(f) do { (void)(f); } while (0) -/* fscrypt stubs for readpage.c */ -#define fscrypt_decrypt_bio(bio) ({ (void)(bio); 0; }) -#define fscrypt_enqueue_decrypt_work(work) do { (void)(work); } while (0) -#define fscrypt_mergeable_bio(bio, inode, blk) \ - ({ (void)(bio); (void)(inode); (void)(blk); 1; }) -#define fscrypt_set_bio_crypt_ctx(bio, inode, blk, gfp) \ - do { (void)(bio); (void)(inode); (void)(blk); (void)(gfp); } while (0) +/* fscrypt readpage stubs are in ext4_fscrypt.h */ /* fsverity stubs */ #define fsverity_verify_bio(bio) do { (void)(bio); } while (0) From patchwork Wed Jan 14 22:55:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1502 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=1768431451; bh=TayjaULz0uxRTyXaDrD33wJ78XdJ1fP155TeEfa6OKA=; 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=oNELeC/IcKwvZkiMS8IranCmAVuUOBRUXqzxRxXEWjtiuvujBtEredn1qq9q+XkTA jgEs4qlsv5VX8hXOF/3RyxwNv5DvQvnWcJQm9MVzCFal2NTpKP0xSRb0LDwr6Fyf+9 xspjgoSJXyus+pLcZCyVBF670UiwuAvOHyfiNNyf6V51TnhS8hW2hdib4mwgHuaYB6 Uwu8Hef8gTc7MldSSM2y2FuSBoSusrt6vOVHvxGswwp7LF6h4qnvOjThunWtUyMgKF qt3xlVHOxtHk/Mz5fJ8f6evaEmmztUjfug0DJS/0A+WAgkdTDN+qBtGeiPD/0NvzV+ hG7Juk/uwQSdw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 146BF692F1 for ; Wed, 14 Jan 2026 15:57:31 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UwwylUU_e0GY for ; Wed, 14 Jan 2026 15:57:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431450; bh=TayjaULz0uxRTyXaDrD33wJ78XdJ1fP155TeEfa6OKA=; 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=TBGDbatmD+baeP1BpOP6ybINHnndDfcX2rrKNwV77lJhL+u2tElMkAyPGfDncbnH8 LRxzny+DyP4l+bTx0Y9bX4jQ5ZJw0+aMTvMjyprjpxtDHHNtw8qS9j+k3uCYGtyuvF BLeR1fPDhWupU73eZnsZvhM8AS7LB19jRsGWeMm3+L8OH7oxslyxfyOQ+CGq1ke1PH xZvU16pv7mgr/5DF20MnzmoXO11D0q/CqMTj+CHCoRuGo06Ai1N+psu4HPB2NV2Y97 1ksGodhld6V/6ZHt0E7FSVEd1pHWH9oV1ZlKNEp6BeTmMHvpsUsQfF8ZDtQmbMy9Gg TqL8THmMNkU9g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F2DF969342 for ; Wed, 14 Jan 2026 15:57:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431449; bh=/2uQEhj/B9xsBG45GwUa07pVGAHcZIDpsTFwn0LkQQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aEZ6CBirYrLNHCGAZFRaqZAWdTvsx4g/sX2aQ2Gtw7zPcr0WIBzVKvcrxhu0gbiVS rdPjDLr30tesCNCm8nCzAWd6ChyimPnheFoxwfQkFLy75YifPqXlrtgul1ViMoI7f1 7e/w09MvXJGZOSEmGo1XjawoOmtFZOmfZQF7jzVbDcGJQs2icCBWaxJN+4O1uxqywb 8A0MRI1T4IAZurdyfe4lIg5OPFXssYHyFk6lXAGVvOnipT90GtZbYOw5dwWhLpJmA1 7ApH2iscyHdTz/wk+TEMY2aYsnzD8RKDFmalIniLxCiGdXFXZHzjTxRcXw+3D2I52F jouXYuhi4ZGBQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1788F692F1; Wed, 14 Jan 2026 15:57:29 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id t_BZluI-1kri; Wed, 14 Jan 2026 15:57:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431445; bh=vVHZvdyHoM11DMYvE46aLbtI6QyJtf2yGu+HhnPdbG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vOuFplK9WLcuOLDMWNx7/DBVHv8iiEWVK9fYInP0IWIho7bmdH02eG5GgqdYkG2+L yvbm9ViqY3pfoCZUKnPon4KAc3YoC2xoItrkwQjzZCtIeXqhX/9yQdK1FWClp79HQZ Zk3JKprGrYQZJ/U31i9/BWLrA8ge2lNkn2vQESQL2+rnt3GxFwTEd+rl0rYkC02fq5 5K30niZ9ZhN7Q1teqcVxtE2cDF/Y+K7NAcKoLA0csShBrFMf1FJMphHkqQxeFaFb2Q ua2tdVGOn81DJEqf8R/W4MKOHjwmF9zpyYcVAZxEJoOWoacfsVRFTtl3/7niTkoArw 5VLObArnacnUg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BC11C692EF; Wed, 14 Jan 2026 15:57:24 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:58 -0700 Message-ID: <20260114225635.3407989-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CH2TMLFRLGHYPDNG33GD755EKGRAP76I X-Message-ID-Hash: CH2TMLFRLGHYPDNG33GD755EKGRAP76I 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/34] ext4l: Remove duplicate percpu_counter stubs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Remove percpu_counter stubs from ext4_uboot.h that are already defined as inline functions in include/linux/percpu_counter.h The header file provides proper implementations for single-threaded U-Boot operation. Removed duplicates: - percpu_counter_read_positive - percpu_counter_sum_positive - percpu_counter_add - percpu_counter_inc - percpu_counter_dec - percpu_counter_initialized - percpu_counter_init - percpu_counter_destroy - percpu_counter_sub Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index c6795b35501..aee6938977d 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -336,13 +336,7 @@ struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); /* KUNIT stub */ #define KUNIT_STATIC_STUB_REDIRECT(...) do { } while (0) -/* percpu_counter operations - stubs */ -#define percpu_counter_read_positive(fbc) ((fbc)->count) -#define percpu_counter_sum_positive(fbc) ((fbc)->count) -#define percpu_counter_add(fbc, amount) ((fbc)->count += (amount)) -#define percpu_counter_inc(fbc) ((fbc)->count++) -#define percpu_counter_dec(fbc) ((fbc)->count--) -#define percpu_counter_initialized(fbc) ((fbc)->initialized) +/* percpu_counter operations are in linux/percpu_counter.h */ /* Group permission - stub */ #define in_group_p(gid) (0) @@ -1188,10 +1182,7 @@ static inline ktime_t ktime_add_ns(ktime_t kt, s64 ns) /* write lock variants */ #define write_trylock(lock) ({ (void)(lock); 1; }) -/* percpu counter init/destroy */ -#define percpu_counter_init(fbc, val, gfp) \ - ({ (fbc)->count = (val); (fbc)->initialized = true; 0; }) -#define percpu_counter_destroy(fbc) do { } while (0) +/* percpu_counter_init/destroy are in linux/percpu_counter.h */ /* ratelimit macros */ #define DEFAULT_RATELIMIT_INTERVAL (5 * 1000) @@ -1480,8 +1471,7 @@ static inline char *d_path(const struct path *path, char *buf, int buflen) #define dquot_transfer(m, i, a) ({ (void)(m); (void)(i); (void)(a); 0; }) #define is_quota_modification(m, i, a) ({ (void)(m); (void)(i); (void)(a); 0; }) -/* Percpu counter sub */ -#define percpu_counter_sub(fbc, amount) ((fbc)->count -= (amount)) +/* percpu_counter_sub is in linux/percpu_counter.h */ /* Filemap operations - additional */ #define filemap_get_folio(m, i) ((struct folio *)NULL) From patchwork Wed Jan 14 22:55:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1503 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=1768431455; bh=je2dnkjeID6oqgTDXLPyvFDnFJXaYDXfYq1MobGOc1w=; 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=uBqG8/ABkZJ734WkH/SaCeU5fvZxjWsviY0rnx9ucKD82XRuRfnAMNeinMcBDobMJ bTclYwLXpUeTECkjbkjBqLi3o+JuXcYWBdAsqnNWFVGfExppQWivtq7LcqwvbCyQMw t7kr2d9aXQKed+883x5t3GMIRiUs2OTx2yLDecvwEN0I61UuBNDurIm/uiMvA3dFE1 llnFXqsFug5jmoTSBLvlks0CSuRLgzvsIo7FIfX2Nyhn20Jv/yQ1orVN+5zbqTQcsX Q9kYUD1klPuRR+Fa778OaI7GU9RusxvHAWAl806W483fkw+MxAGDiI/UF0Km73whhp AfWUkiwYK+opw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5EE7E69360 for ; Wed, 14 Jan 2026 15:57:35 -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 qe1dHOim1Tbe for ; Wed, 14 Jan 2026 15:57:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431455; bh=je2dnkjeID6oqgTDXLPyvFDnFJXaYDXfYq1MobGOc1w=; 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=uBqG8/ABkZJ734WkH/SaCeU5fvZxjWsviY0rnx9ucKD82XRuRfnAMNeinMcBDobMJ bTclYwLXpUeTECkjbkjBqLi3o+JuXcYWBdAsqnNWFVGfExppQWivtq7LcqwvbCyQMw t7kr2d9aXQKed+883x5t3GMIRiUs2OTx2yLDecvwEN0I61UuBNDurIm/uiMvA3dFE1 llnFXqsFug5jmoTSBLvlks0CSuRLgzvsIo7FIfX2Nyhn20Jv/yQ1orVN+5zbqTQcsX Q9kYUD1klPuRR+Fa778OaI7GU9RusxvHAWAl806W483fkw+MxAGDiI/UF0Km73whhp AfWUkiwYK+opw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4B7316934D for ; Wed, 14 Jan 2026 15:57:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431453; bh=9jCMkg7iY4ebTNAZ9/smcVp6LV1abmOOquSZ8fTBsfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wJJZe9HDQngUF63UBwrezG3o+GgPidwdqRW4KkqZLL8DoEMd/pib3hl5tdx0uplJh QRDoEYUQL16aLPRXSUAS3lsMkvGePWcUHnxyLgbOVUxLWylHDvJEgT7HYU+c+bSs9R FMLvyUIIIEESQUq1HBECln+2Vl3Mcyu8UPc1DoCFpeKzFaydv/TELQCHQcDDK/brGF D+pmFThJlylPO1P0iSBiJrimkPUKC70xTOCxWpzUPLFfkJIAf8t/m063rjG9DTV+Iy UMpv3p1LKn5VykuCgLDlNdUAXj029I3qJAlshyYcs5bPI/oi1lyk0ITk92y0PdYP+b bDOaWCAA8GPxQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AC08069342; Wed, 14 Jan 2026 15:57:33 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 9U7-mPDKU15l; Wed, 14 Jan 2026 15:57:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431449; bh=z9/YAYik58+1ppuOWOSsu7bDT4S0NBUT44EsY8xuNbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EFoEKN0hgCjTeGarla9JKKaSe6+flagwje7nOqSsJccCKCRa0fiDCKVmqmG1TK2bV vK7ROYhOXibudqADpbA8FwgVe3U9S/sSLcLCAwz3yPS/J0cpyZuZoNiPZSCA1VbSTV kqHGHQxlqSbUY2sB0yTUcp8dIZLuwdrxOHuxb3q2sUUJr6rUhR8yT8qB1Z6578wsS6 pVZCMFKOCclCOrF1a8LpDSB7ld5nrOrSd1nzuuCyTYzoV3AgVYGxrGWl91EL/bQ1N7 G4A2zv2Nq/5mAxQLdUggAUauY5LUHS/gdbeqBgP5y2YhST/M6pHTVLQJ0pCqGirq8l K2x/sd2j4WizA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 58FDF692EF; Wed, 14 Jan 2026 15:57:29 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:59 -0700 Message-ID: <20260114225635.3407989-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 36V5YCBV432TTPH5OAARD4PUPXRBAOLQ X-Message-ID-Hash: 36V5YCBV432TTPH5OAARD4PUPXRBAOLQ 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/34] ext4l: Use linux/completion.h for completion stubs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Remove the local 'struct completion' definition and the wait_for_completion() function from ext4lm using linux/completion.h instead. The header provides the same stub functionality via macros and static inline functions. Also fix linux/completion.h to use 'static inline' instead of just 'inline' for the U-Boot stub functions to prevent multiple definition errors when the header is included in multiple C files. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 8 +++----- fs/ext4l/stub.c | 5 +---- include/linux/completion.h | 24 ++++++++++++------------ 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index aee6938977d..16b0512781f 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -126,10 +126,8 @@ struct lock_class_key { int dummy; }; #define rwsem_release(l, i) do { } while (0) #define _THIS_IP_ ((unsigned long)0) -/* completion - stub */ -struct completion { - unsigned int done; -}; +/* completion - use Linux header */ +#include /* Cache alignment - stub */ #define ____cacheline_aligned_in_smp @@ -2135,7 +2133,7 @@ void invalidate_bdev(struct block_device *bdev); /* Kobject - declarations for stub.c */ void kobject_put(struct kobject *kobj); -void wait_for_completion(struct completion *comp); +/* wait_for_completion is now a macro in linux/completion.h */ /* DAX - declaration for stub.c */ void fs_put_dax(void *dax, void *holder); diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 2084faa3b50..6e16af2dc24 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -486,10 +486,7 @@ void kobject_put(struct kobject *kobj) { } -/* completion */ -void wait_for_completion(struct completion *comp) -{ -} +/* completion - now uses linux/completion.h macro */ /* DAX */ void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, diff --git a/include/linux/completion.h b/include/linux/completion.h index 9835826d285..7336421ea84 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -129,39 +129,39 @@ extern void complete_all(struct completion *); #define wait_for_completion(x) do {} while (0) #define wait_for_completion_io(x) do {} while (0) -inline int wait_for_completion_interruptible(struct completion *x) +static inline int wait_for_completion_interruptible(struct completion *x) { return 1; } -inline int wait_for_completion_killable(struct completion *x) +static inline int wait_for_completion_killable(struct completion *x) { return 1; } -inline unsigned long wait_for_completion_timeout(struct completion *x, - unsigned long timeout) +static inline unsigned long wait_for_completion_timeout(struct completion *x, + unsigned long timeout) { return 1; } -inline unsigned long wait_for_completion_io_timeout(struct completion *x, - unsigned long timeout) +static inline unsigned long wait_for_completion_io_timeout(struct completion *x, + unsigned long timeout) { return 1; } -inline long wait_for_completion_interruptible_timeout(struct completion *x, - unsigned long timeout) +static inline long wait_for_completion_interruptible_timeout(struct completion *x, + unsigned long timeout) { return 1; } -inline long wait_for_completion_killable_timeout(struct completion *x, - unsigned long timeout) +static inline long wait_for_completion_killable_timeout(struct completion *x, + unsigned long timeout) { return 1; } -inline bool try_wait_for_completion(struct completion *x) +static inline bool try_wait_for_completion(struct completion *x) { return 1; } -inline bool completion_done(struct completion *x) +static inline bool completion_done(struct completion *x) { return 1; } From patchwork Wed Jan 14 22:56:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1504 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=1768431457; bh=8DfRT+wh4nhXvEAL1mobSzR0IiAoZRyXpGkfzfgRQ+k=; 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=DK4sRJ/0ZoxQfBuQzGlxVcrIycUzNmhqrKatfD/4ncGyX3jAkVBj7b9Kym30pcNW1 WAhhp3qPWykJ5Kbohx0RQvyWTFIlj1cWdFnbGEuiIq9DAFP9DUAKELVfQ9ZReTrOZc P0MPITDAhi7jPmbSVCUlz3MUZoAXVM96mqV4Z4cbLG9dSu/nqDM3PJQxRd2y8wjruw oLSf5Ab2OB22vJUsm5xCcGA1ZsEXyztD+d2AbxgAYPFGQvuZFBZc3Pf7T6P7DdjvDt BC4asOMfcdDV909QM7eukP2iae/FSKF/9OffyPnb9akBjKt71p/O3zGEDPLnTBpZd+ n6UWHRv8q4kyQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BEF6269345 for ; Wed, 14 Jan 2026 15:57: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 10024) with ESMTP id qHApqRUEXYFe for ; Wed, 14 Jan 2026 15:57:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431456; bh=8DfRT+wh4nhXvEAL1mobSzR0IiAoZRyXpGkfzfgRQ+k=; 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=rnV9YOY9PcpQtxl3TptX8p4lTTce++QX7y2GjQOi8+t2skManFy0f+Bc5DlfvmHjI qAEcKdUy2lrm09hhnTqgQsY+gM7yPmtFMFyBOxee4SqDpu7UBM3yqjtZSkLtfriFBJ JNefO4N7y3UDDqJbVSV6sNVr55mKEacMi68Zi+8EnxZUfxFMspTtdNw9KGcKaZ66YS MRBr8qwVSUY4zQAGf5JOTmlbBUjNG7l7Dct8I3g13TSR5kV2wUM7kzntsXKelC/bfV HIy6Mb7nae4gN5YfOrgp3oaLv5pvtrLhY9QSDVlcMvqVZkmjmAMCRl798ssAFMw3yT 1eV5Fhm1zuymg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BCB566934D for ; Wed, 14 Jan 2026 15:57:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431454; bh=2++yIrpXUoVtIR/Miz77y4/KEDln11pqnnp2UvVmvtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zc2g2Czgzfx+dW8A0+Seed5dbcJbwlobcTXteq+FjWjRRDShsvnGbJrP8TOrf7BcW dvoaHC4tTlqwr4GRvigryHzcq1qR0Kxm6HrhZCA6hxCGBG6pfxGhL7vc+DkksCTIjY 5gHpj4tQf+QH8KYoPNB6QL2NdRQ8bWQZTG4iWzbJD/s8phOQ89wSKzSQCYpVhPEEX6 42bHaL13oJWQSsz1kLQ0XNU0KZaqJkO88jaY1HGOuC7OYNA1+RK5GweiyPZupj8vpn jBXZr0tEENEYHODWh622tbC69Rfgm7Dx76E5NDGwgQsyWD8ROM3nhwn7Wb/vypPuUP TXHZeya/YM+Xw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ABEBA69342; Wed, 14 Jan 2026 15:57:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id TKJwyJeouSc0; Wed, 14 Jan 2026 15:57:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431454; bh=Te62FQx1yfPJl8d3UpJZzinwF/VZwUz1glval4A8ZIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HtknHdqxysRC8hD7FvBorWj3DQQ9WguFPs+MpWQBUpn45ucTqTYeZEvNPGI64DE84 mdV43UQ7NRwHbxux0VUTWb+PNcHMbD41KiVgpDdRfgSKeA0LDtXnd/ggpvicB7cssi VfKqfIZyBRMThhyQPPF9ZT3OvWeKDxaluWU30D7cfqxVLkTH3xVpgIc3yCuhBw+X9v hufr1qRQAlEM3h1FzU3huXZ4bgPhQ3sNJuf/vM2c0nBByypU3BWduN3ERW4M+y13Tg XN19zBabUmq3DliV75U4Oq/iCt/AKjQTDtHY1GMJ3F/lBGCnWJaYJl4nKeTBpLCEzK shvABMhtmm8bA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F2BB7692EF; Wed, 14 Jan 2026 15:57:33 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:00 -0700 Message-ID: <20260114225635.3407989-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2ZJAJZ4YISJTP4DW7EMG77PBTGWRNRL6 X-Message-ID-Hash: 2ZJAJZ4YISJTP4DW7EMG77PBTGWRNRL6 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/34] ext4l: Convert dquot_suspend from function to macro 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 Replace the dquot_suspend() function in stub.c with a macro in ext4_uboot.h The function just returned 0, which is the same as what the macro does. This is consistent with the other quota stubs like dquot_resume which are already macros. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ++-- fs/ext4l/stub.c | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 16b0512781f..0edcb4533b7 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -2303,8 +2303,8 @@ void *bdev_file_open_by_dev(dev_t dev, int flags, void *holder, /* Filesystem sync - declaration for stub.c */ int sync_filesystem(void *sb); -/* Quota - declaration for stub.c */ -int dquot_suspend(void *sb, int flags); +/* Quota - declarations for stub.c */ +#define dquot_suspend(sb, type) ({ (void)(sb); (void)(type); 0; }) int dquot_alloc_space_nodirty(struct inode *inode, loff_t size); void dquot_free_space_nodirty(struct inode *inode, loff_t size); int dquot_alloc_block(struct inode *inode, loff_t nr); diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 6e16af2dc24..378ee76b8b5 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -444,11 +444,7 @@ int sync_filesystem(void *sb) return 0; } -/* Quota */ -int dquot_suspend(void *sb, int flags) -{ - return 0; -} +/* dquot_suspend is now a macro in ext4_uboot.h */ /* MMP daemon - now in mmp.c */ From patchwork Wed Jan 14 22:56:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1505 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=1768431461; bh=E/xMmDVBgc1JJFl5iAI8ag6hKSrQmtVdPCL6eC0PYtU=; 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=T3jSJ9HLOxEx2XyOMtCWlJQsqPJtYrb2dx0TPPPqEa6oWFfBmBCsWjLvD5uCPDp3j 7UdFOFkKHK7TvUMBHDsMlYRoaeY2fwsVGzABrm6eiklKXkgY9cxG3ngQsFeKaZYORv UXSYviTkg+jHfLwWwVUWAg23EOVMmAWu0BDs+XI5gMLlE0aaJp/vB2wT3KSucskAeN 1iWcbioqoxURRm1z2k4eFmuj/UuP9wIx0QLIBI6Zc/ZOzCI5jL4nvddn0oU48bh9ym 4aKQb5RJ55rsVcSVIS11Twotsf+lYs9BlAgS9IypYEGoms4tuTUCBTEbjctHS0OKyV Y4weKdV1sDmYw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3A3FB6935C for ; Wed, 14 Jan 2026 15:57: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 10024) with ESMTP id WVQz_NcJjKDQ for ; Wed, 14 Jan 2026 15:57:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431461; bh=E/xMmDVBgc1JJFl5iAI8ag6hKSrQmtVdPCL6eC0PYtU=; 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=T3jSJ9HLOxEx2XyOMtCWlJQsqPJtYrb2dx0TPPPqEa6oWFfBmBCsWjLvD5uCPDp3j 7UdFOFkKHK7TvUMBHDsMlYRoaeY2fwsVGzABrm6eiklKXkgY9cxG3ngQsFeKaZYORv UXSYviTkg+jHfLwWwVUWAg23EOVMmAWu0BDs+XI5gMLlE0aaJp/vB2wT3KSucskAeN 1iWcbioqoxURRm1z2k4eFmuj/UuP9wIx0QLIBI6Zc/ZOzCI5jL4nvddn0oU48bh9ym 4aKQb5RJ55rsVcSVIS11Twotsf+lYs9BlAgS9IypYEGoms4tuTUCBTEbjctHS0OKyV Y4weKdV1sDmYw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 29C1369345 for ; Wed, 14 Jan 2026 15:57:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431459; bh=RHjfI8+o50qvKdJ4qjaXtV61M6lVEZ1k2yeTx+bimEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qIByGZNsFHMvYzzZ3hmqpJ6rm2WfSC99zsRw24u9mRjQlDX+BBeNIT6138FdGfvWT 3SOtcMRZHVfaaeFTd+S2K11xPIZhBNwYVFp6+PQJIpSMqEDatr8SN1x9glnXJYLDqC d5NPK9sGn6r9k5PToF9Pqe74/+ntALmsoTrXjTYJ7C1pPSIZswgyDPAyterXMLlwTe nR8NGPaPcE+Mu9aABnmhoMdVGPAgTP1fQhv59Ox/TQefWH0rI2Snvwb7q/V32xAOmd PPfsuQFqq9HoHQtTsx/YjBO2gvQTN0OHqvsu3lb1VmydsqBoDMSNov+IwatbCrIrN2 LdBc3Eht80/aA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4654069342; Wed, 14 Jan 2026 15:57:39 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 94DJIIG5VYoZ; Wed, 14 Jan 2026 15:57:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431455; bh=8hynwWOy8GEFsA1/OYxJNdBbQ9tRGcGids/8y1upvdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cuAQhlweS8UT3TtFJJbRXKLz/qUbFK6BFBerDO9U/GWEAoGgS68c6xbJYe4Ymp9MF mo0elm2Kg/R2Qx1WyRWgaqxcqVf8S24pyE5uBBGpkYHxk7mGWZvlZgoJl80RwdQglL KpfYV2sFJChhxDSF2l+HQp2Q7/aRASER+GsZYkix6VpnNF4eOiKlOamE2d3aQrz/Wj J0LdRD6ihlHvxHDjmdGrgSNqZxOSJdtLn5i8IkluMzXFU/cIKTxjN8Zgp4p1qgXCVc 5lFVx2rSg6uCg7g+mhTRZT9inI/18Io+LIPkOyMVRGP9zHNG8U5lQWSTNohM+ni8C0 cIpOQoPLZbSmQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F1575692EF; Wed, 14 Jan 2026 15:57:34 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:01 -0700 Message-ID: <20260114225635.3407989-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VIWOJN6STBFVV2TQELSRLPWAX4E5HOCK X-Message-ID-Hash: VIWOJN6STBFVV2TQELSRLPWAX4E5HOCK 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/34] ext4l: Remove dead iomap definitions 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 iomap type constants and struct definitions that are wrapped in a LINUX_IOMAP_H header guard. Since linux/iomap.h is already included at the top of ext4_uboot.h, this block was dead code that could never be compiled. The definitions also had different values from linux/iomap.h (e.g. IOMAP_MAPPED was 0 vs 2), which could have caused subtle bugs if the guard was ever removed. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 0edcb4533b7..ef40658753b 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -211,35 +211,7 @@ struct dir_context { loff_t pos; }; -/* iomap types - only define if linux/iomap.h not included */ -#ifndef LINUX_IOMAP_H -#define IOMAP_MAPPED 0 -#define IOMAP_INLINE 1 -#define IOMAP_UNWRITTEN 2 -#define IOMAP_DELALLOC 3 -#define IOMAP_HOLE 4 - -struct iomap { - u64 addr; - loff_t offset; - loff_t length; - u16 type; - u16 flags; - struct block_device *bdev; - void *inline_data; -}; - -struct iomap_ops { - int (*iomap_begin)(struct inode *inode, loff_t pos, loff_t length, - unsigned flags, struct iomap *iomap, struct iomap *srcmap); - int (*iomap_end)(struct inode *inode, loff_t pos, loff_t length, - ssize_t written, unsigned flags, struct iomap *iomap); -}; - -/* iomap DIO flags */ -#define IOMAP_DIO_UNWRITTEN (1 << 0) -#define IOMAP_DIO_FORCE_WAIT (1 << 1) -#endif /* LINUX_IOMAP_H */ +/* iomap types and structs are in linux/iomap.h */ /* fiemap types */ #define FIEMAP_FLAG_SYNC 0x00000001 From patchwork Wed Jan 14 22:56:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1506 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=1768431465; bh=fc9STlbzvbhqgpGhofBy48zL7ESRd3QLWkc/MfQaUos=; 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=YB8PyOHNuSqOQuD9oEnHMWPRfV6w4Tm0uECwPbLfMVSSdFm3gH6znn7NHS+6g0PQ7 m4pSK9TyqvBMhyr7Dyl5j4iBsDBkYFs4n/eMbx5KyZJqx7YEqdoTFVzSdVWxwHm3ab hQ7sRETB6o1JzhNafeQCbmlWxu23N9KK/BIrmihVTQP3j0SUfoW09Ulh0H1+puz8NC NnjPZI+PkFtbhuILcDs2DAbDotyS8obYAnhjOOK01Sb8i1K5SfisCHv0h4iZj8VPUe tIgQfeAJgmC+POAdkQWS4EOJiWjgnYn43gme7bY5cN6Pvwn/02EiHLDxeQUiqN2t7r rvWRSRDthXgAg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AB87D69342 for ; Wed, 14 Jan 2026 15:57: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 10024) with ESMTP id iu6BQ6I5vwpv for ; Wed, 14 Jan 2026 15:57:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431465; bh=fc9STlbzvbhqgpGhofBy48zL7ESRd3QLWkc/MfQaUos=; 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=YB8PyOHNuSqOQuD9oEnHMWPRfV6w4Tm0uECwPbLfMVSSdFm3gH6znn7NHS+6g0PQ7 m4pSK9TyqvBMhyr7Dyl5j4iBsDBkYFs4n/eMbx5KyZJqx7YEqdoTFVzSdVWxwHm3ab hQ7sRETB6o1JzhNafeQCbmlWxu23N9KK/BIrmihVTQP3j0SUfoW09Ulh0H1+puz8NC NnjPZI+PkFtbhuILcDs2DAbDotyS8obYAnhjOOK01Sb8i1K5SfisCHv0h4iZj8VPUe tIgQfeAJgmC+POAdkQWS4EOJiWjgnYn43gme7bY5cN6Pvwn/02EiHLDxeQUiqN2t7r rvWRSRDthXgAg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 969BA69345 for ; Wed, 14 Jan 2026 15:57:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431463; bh=P8mq6JFtg2ffIJSNAHH/JTLCSX6tCgszNGKfQcD+dwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tV/LunJQfiYEMsz3rSQgf3Gcw1SJ56lp66XcVuN5vNHHh3OEqbOj6gsYWVl3zm9BJ wmIa/I1rG+hvsAQ5x9bVg8MbPjVEjU3WqN/d1GOvMJa1USiodcFlBg7efjDgCb60d5 ZLealyDrPiraWiPtdBAqGmEeUBrSuDglFaMSj+hilUTczEGW/d7Q/R9UCZT/3+W241 fMo/+uxXvsRh1JcWtevbBAHiCQsDdK5pyr44OTahcr+1/Vlp14icDEK0ZTBdxYhR49 RRHcNPoDdeGkfE34WKV0L2fstKLakXhG+B0Ps2CiDdf2qb3fzAprhYQlJaasXwUkch JcAd6NPZ0sc0g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E291069342; Wed, 14 Jan 2026 15:57:43 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 1BHm6TTYnPUu; Wed, 14 Jan 2026 15:57:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431459; bh=U04mlLgshgyVo+rTWZdUDho8IHazSKwXn60X1XzRgVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HFBYtNPu/okr97oYEqqcak+4vrYms8isU0ARv2jQnau+kMViPvdS9qBS4gcRhdnM2 6uKjrZC9YqXj+HLk+HZ4tVCIb7GuaJ5aFEvFpOT+CNGp/PWZlxy652Vgez+/K3OiJp WsR+Kw6608LxnjWu1xMVBv4L+tPyXqZ+8VQFF5Cdwu/JEpZEnwU+XR0e+dSTZ7A3e7 XY6yrwUs5ScaBTJmXogW351UgiuWWoFl9u3GD3vKMAbKJwiEjFOXzHYTAUb/IjkKBj r9zUE8bJ8bkFHQYnGL4O83MKfSjwcTL+3aoVYVT2Ar9b/kXk0DG/QXCz0dcUyov4EG kbDb+wjzHWmCQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8E669692EF; Wed, 14 Jan 2026 15:57:39 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:02 -0700 Message-ID: <20260114225635.3407989-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CBHFV2MWBM6TOTMMTUJ373RNREEFJGDT X-Message-ID-Hash: CBHFV2MWBM6TOTMMTUJ373RNREEFJGDT 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/34] ext4l: Create linux/percpu.h for per-CPU stubs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create a new header file for per-CPU variable and operation stubs. U-Boot is single-threaded, so per-CPU variables are just regular variables and per-CPU operations are simple direct accesses. The new header includes: - DEFINE_PER_CPU, per_cpu, per_cpu_ptr, this_cpu_inc, this_cpu_read - for_each_possible_cpu, smp_processor_id, num_possible_cpus - alloc_percpu, free_percpu - struct percpu_rw_semaphore and related operations This consolidates scattered per-CPU definitions from ext4_uboot.h and removes the function implementations from stub.c. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 33 +++++--------------------- fs/ext4l/stub.c | 11 ++------- include/linux/percpu.h | 54 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 36 deletions(-) create mode 100644 include/linux/percpu.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index ef40658753b..166768985b1 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -103,8 +103,9 @@ typedef struct { atomic_t refs; } refcount_t; /* RB tree types - from included above */ -/* percpu_counter - use Linux header */ +/* percpu - use Linux headers */ #include +#include /* Project ID type */ typedef struct { unsigned int val; } kprojid_t; @@ -232,15 +233,7 @@ struct fiemap_extent_info { /* fscrypt_str, qstr are now in ext4_fscrypt.h */ -/* percpu rw semaphore - stubs */ -struct percpu_rw_semaphore { - int dummy; -}; - -#define percpu_down_read(sem) do { } while (0) -#define percpu_up_read(sem) do { } while (0) -#define percpu_down_write(sem) do { } while (0) -#define percpu_up_write(sem) do { } while (0) +/* percpu rw semaphore is in linux/percpu.h */ /* Memory allocation context - stubs */ static inline unsigned int memalloc_nofs_save(void) { return 0; } @@ -2095,9 +2088,7 @@ void fsnotify_sb_error(struct super_block *sb, struct inode *inode, int error); char *file_path(struct file *file, char *buf, int buflen); struct block_device *file_bdev(struct file *file); -/* Percpu rwsem - declarations for stub.c */ -int percpu_init_rwsem(struct percpu_rw_semaphore *sem); -void percpu_free_rwsem(struct percpu_rw_semaphore *sem); +/* percpu_init_rwsem/percpu_free_rwsem are in linux/percpu.h */ /* Block device sync - declarations for stub.c */ int sync_blockdev(struct block_device *bdev); @@ -2302,14 +2293,7 @@ struct xarray { int dummy; }; -/* Per-CPU stubs - U-Boot is single-threaded */ -#define DEFINE_PER_CPU(type, name) type name -#define per_cpu(var, cpu) (var) -#define per_cpu_ptr(ptr, cpu) (ptr) -#define this_cpu_inc(var) ((var)++) -#define this_cpu_read(var) (var) -#define for_each_possible_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++) -#define smp_processor_id() 0 +/* Per-CPU stubs are in linux/percpu.h */ /* XArray function stubs */ #define xa_init(xa) do { } while (0) @@ -2392,12 +2376,7 @@ struct seq_operations { /* Block layer constants */ #define BLK_MAX_SEGMENT_SIZE 65536 -/* num_possible_cpus - number of possible CPUs (always 1 in U-Boot) */ -#define num_possible_cpus() 1 - -/* Per-CPU allocation stubs */ -#define alloc_percpu(type) ((type *)kzalloc(sizeof(type), GFP_KERNEL)) -#define free_percpu(ptr) kfree(ptr) +/* num_possible_cpus, alloc_percpu, free_percpu are in linux/percpu.h */ /* Block device properties */ #define bdev_nonrot(bdev) ({ (void)(bdev); 0; }) diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 378ee76b8b5..a0c21dfd14c 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -455,10 +455,7 @@ void ext4_unregister_sysfs(void *sb) /* jbd2_journal_destroy is now in journal.c */ -/* percpu rwsem */ -void percpu_free_rwsem(struct percpu_rw_semaphore *sem) -{ -} +/* percpu_free_rwsem is now in linux/percpu.h */ /* Block device ops */ int sync_blockdev(struct block_device *bdev) @@ -589,11 +586,7 @@ void iput(struct inode *inode) } } -/* percpu init rwsem */ -int percpu_init_rwsem(struct percpu_rw_semaphore *sem) -{ - return 0; -} +/* percpu_init_rwsem is now in linux/percpu.h */ /* atomic_add and atomic64_add are now in asm-generic/atomic.h */ diff --git a/include/linux/percpu.h b/include/linux/percpu.h new file mode 100644 index 00000000000..3aa71c1451f --- /dev/null +++ b/include/linux/percpu.h @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Per-CPU variable and operation stubs for U-Boot + * + * U-Boot is single-threaded, so per-CPU variables are just regular + * variables and per-CPU operations are simple direct accesses. + */ +#ifndef _LINUX_PERCPU_H +#define _LINUX_PERCPU_H + +#include +#include + +/* + * Per-CPU variable definitions - just regular variables in U-Boot + */ +#define DEFINE_PER_CPU(type, name) type name +#define per_cpu(var, cpu) (var) +#define per_cpu_ptr(ptr, cpu) (ptr) +#define this_cpu_inc(var) ((var)++) +#define this_cpu_read(var) (var) + +/* CPU iteration - only one CPU in U-Boot */ +#define for_each_possible_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++) +#define smp_processor_id() 0 +#define num_possible_cpus() 1 + +/* Per-CPU allocation - just regular allocation in U-Boot */ +#define alloc_percpu(type) ((type *)kzalloc(sizeof(type), GFP_KERNEL)) +#define free_percpu(ptr) kfree(ptr) + +/* + * Per-CPU read-write semaphore stubs + * U-Boot is single-threaded, so these are no-ops + */ +struct percpu_rw_semaphore { + int dummy; +}; + +#define percpu_down_read(sem) do { } while (0) +#define percpu_up_read(sem) do { } while (0) +#define percpu_down_write(sem) do { } while (0) +#define percpu_up_write(sem) do { } while (0) + +static inline int percpu_init_rwsem(struct percpu_rw_semaphore *sem) +{ + return 0; +} + +static inline void percpu_free_rwsem(struct percpu_rw_semaphore *sem) +{ +} + +#endif /* _LINUX_PERCPU_H */ From patchwork Wed Jan 14 22:56:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1507 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=1768431472; bh=1DzLU6Y7gW2Rx3p7z8e7aa2xGfz9avEuqP5Ijg15DW8=; 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=sWz+ZE0CUETLahSGE8V/bIxV74O22kOC5FhXSb+TQIxn22GUAHhZtNxS/IJqMLxDC xaQZtQcx8oeSE9oi3BEp5qwPsCwc4JAj6mN58RzkN6PDDcuxFW16Oij0mfLvwTujca hx2dIVSoDMUMMk0E5kf+GAnwNuC2dQnA6pjhCco0+v7pqnKSzqvjKa+203a/RJn5S/ eP6PPRvJuNehXoK3PVqRlgTVGd3CHbjS8p5D5+8AKKBYB+4kB7fRdDEz2E8ucR8mYh sbE7j7leUjnRADKlIwixpkD3QFxs4g9aSoYz7Flln2BETv8nSol0bnBrxbwxcyQA1e iGJv9DOTN4y+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 93F206935F for ; Wed, 14 Jan 2026 15:57: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 NGPT9a0YJQzh for ; Wed, 14 Jan 2026 15:57:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431472; bh=1DzLU6Y7gW2Rx3p7z8e7aa2xGfz9avEuqP5Ijg15DW8=; 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=sWz+ZE0CUETLahSGE8V/bIxV74O22kOC5FhXSb+TQIxn22GUAHhZtNxS/IJqMLxDC xaQZtQcx8oeSE9oi3BEp5qwPsCwc4JAj6mN58RzkN6PDDcuxFW16Oij0mfLvwTujca hx2dIVSoDMUMMk0E5kf+GAnwNuC2dQnA6pjhCco0+v7pqnKSzqvjKa+203a/RJn5S/ eP6PPRvJuNehXoK3PVqRlgTVGd3CHbjS8p5D5+8AKKBYB+4kB7fRdDEz2E8ucR8mYh sbE7j7leUjnRADKlIwixpkD3QFxs4g9aSoYz7Flln2BETv8nSol0bnBrxbwxcyQA1e iGJv9DOTN4y+Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7D1CB69342 for ; Wed, 14 Jan 2026 15:57:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431470; bh=sSm3k49y/6MkpxYic8RWlsZAHVLo8cP8Wb2LvE9H7lA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UUATGuRC8n5vGwlve0Da2aIJgJ/MDeGhNzzOoOrJ7GN8X4IDSQ4wrgvvB5EnPI9cW sQxqsXLpIAOz3xcSM8p588c2QxPtKjicPDuVnaK0cPOazN3SM2I9yNizqHgAlExSLm 9WwhVid3e6TUpT7ARNUUXdTSQux500MPh3FNitCP9t9bVjTWV+lWnulQHgdsu8RwE2 feWT9/8uCFMBd1HKLDm87Qe6nRHQ0wE7TSzDm23SUoTdg3KLH+QolcyP01Zx8dfIob YFdxTfhyS7dgG9nw+VyF+5MdEhCMd43ZGCqMDIHS9qm0/cqQAqdGXCmdp1WI/FkvGi xOu9unovODxAw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9243B69342; Wed, 14 Jan 2026 15:57: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 SsA7QPD8uMue; Wed, 14 Jan 2026 15:57:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431464; bh=bH870bpLtHfTkcEQcIjJH4CXL+Y1uk9JzTXBdO+TkMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RvT+3diRtAVv0gfwCQrsg0b/6c22dZ0Q0JZlFGCnAV/00wB9WHoh1ZmZ3pP7CrFPw VbIollaBwrED538qu8SRj5n8NA3RXJkbEl+Jm/QC2KKaAYChLRfb7S5fcEzyDsSs4H b4K3TTZdatHLH+19/hlNc/50SBFOegLfGSH4kUj6LusrBjagYGRMshW13Ga5Wt1SQZ sn05zZEKRYmUo7f6ZHKO22KkfEensSK+kD674h8j9xlqjSgC88T7WOuB0kyxu4dao3 wr2MGrVSELeih0L71bFrAcIcu9/RLY+X1XdoOAcx3hCpzaaGmKLvd/0WZP2CKO18f+ ZYn+bHlsWGAxQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 31E89692EF; Wed, 14 Jan 2026 15:57:44 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:03 -0700 Message-ID: <20260114225635.3407989-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Z7YOXETZDQEOLBFSD4GFAKG7ZT6TFMFN X-Message-ID-Hash: Z7YOXETZDQEOLBFSD4GFAKG7ZT6TFMFN 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/34] ext4l: Remove redundant forward declarations 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 forward declarations for struct inode and struct address_space since linux/fs.h is already included earlier and provides these declarations. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 166768985b1..e09f5c31ebe 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -166,9 +166,7 @@ struct lock_class_key { int dummy; }; /* File flags */ #define O_SYNC 0 -/* Forward declarations for iomap_ops */ -struct inode; -struct address_space; +/* Forward declarations (struct inode, struct address_space) are in linux/fs.h */ /* Page types */ typedef unsigned long pgoff_t; From patchwork Wed Jan 14 22:56:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1508 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=1768431477; bh=WG8WT3L1ThXyrebTbHSMhvsZCN9xksWrFyAedLFRnkA=; 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=fyDjoJUl9SqrFvAPylPuf/Cut6PyXOuFCnJb2TPvluQN2SedeUhN1+tcZcPMs38rz TuoYdUTegURqXPz3J4IJPe9B0YKuPeetGQ4v6D3FnlH75UmASZ7/PY6RimVUD+Fbsv lauGbk9EjX+wq9E9xDSbe3xa7/z9aiM94YrMWbs1e4F+iIffiiEn3BehV9eOTLMZRZ mKAW50rrEgQnpP5UtE1bLGNVJ/Apn93G8uevNo3F0zv52uVbiQrlTv7apRk2HOrNig d7n2tzLlsgIk/HDP2vpnGli9gnX63ERE2lV0oXEfmYgu+qCNc8DKWHsfZFSZLqoAQD Ppai7a/UwmZqg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2717F6935F for ; Wed, 14 Jan 2026 15:57: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 sl3iFZ-f6c1O for ; Wed, 14 Jan 2026 15:57:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431477; bh=WG8WT3L1ThXyrebTbHSMhvsZCN9xksWrFyAedLFRnkA=; 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=fyDjoJUl9SqrFvAPylPuf/Cut6PyXOuFCnJb2TPvluQN2SedeUhN1+tcZcPMs38rz TuoYdUTegURqXPz3J4IJPe9B0YKuPeetGQ4v6D3FnlH75UmASZ7/PY6RimVUD+Fbsv lauGbk9EjX+wq9E9xDSbe3xa7/z9aiM94YrMWbs1e4F+iIffiiEn3BehV9eOTLMZRZ mKAW50rrEgQnpP5UtE1bLGNVJ/Apn93G8uevNo3F0zv52uVbiQrlTv7apRk2HOrNig d7n2tzLlsgIk/HDP2vpnGli9gnX63ERE2lV0oXEfmYgu+qCNc8DKWHsfZFSZLqoAQD Ppai7a/UwmZqg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1309169345 for ; Wed, 14 Jan 2026 15:57:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431474; bh=50jS5eSxQKLMmVuTbC1kxnBD79GxWiG6v83YdPX1Kyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bJMDo7iQYxc/WaPP0aemB+98veVjxv1nbu+W8UTLcbWiMud2eu+Aya3UT7AG0H7v/ rddPJaO4BmFK8x0RGbgmsBSk9ve8sWGrtQ5tsg4gElADxW0sxsSpcRLGqNLXa2R13w BFhOaHoD/7cMGuZlBFCxAiKVZLMIiDq8fSxKnjWogQ1HkCtnACmK8N+g4SqYtLTaBq xDU/r3e/+/0Xy4xKqX8pnoXq/GCW59rpaZkRKrIOs0TKp5R+N8pi9xB6aYGFNUWvjM a3/ojKMC41e/noeCZxxp3dYTEVD9jgmU918CKRmq3gxeyaBT0FUT56U413cL9xVAN+ l899oiCOPRP3g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0F0F69342; Wed, 14 Jan 2026 15:57: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 o7ocqjwnfLFP; Wed, 14 Jan 2026 15:57:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431469; bh=2aoXk/tFTlN70PUSrmp/whOXSozm2TD5Z+uSAygtvRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UOGcLKP1N+eTpJqxJwNBQmPUuseNqf3e6aCU5fSGQRPrYbL7KVOVVI8X1koMcFhVi m4pdho/JP3S47Pt4HjSBhzssd5vCy/JqSVbJy9OGzKBESJyKuFvzN7OF9yXVpqvfrq P9M021Naoy3B5wEW8A3gsiCKXxLMQA6GuAZeuT3S6XpgKsJmgDnP2FpjVNdnXXE6eP t9M9xUWElxiS6pE2mLMXF5VOQewX8dWFW2e4dc+z2xlMf32RxJ1JsAR3BPJhPGBVOg hnhpgjkksprTA2RNiPYlCp8ci9oihvJCDu8OcWn/wVHlT3mNxI9AcYu5BaV7lExjHN ut+iQIHrDUjyg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B9A2569345; Wed, 14 Jan 2026 15:57:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:04 -0700 Message-ID: <20260114225635.3407989-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YET3JGB6S7UQVYQKBEGBHQ4DHEH2KGX2 X-Message-ID-Hash: YET3JGB6S7UQVYQKBEGBHQ4DHEH2KGX2 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/34] ext4l: Move buffer operation stubs to linux/buffer_head.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 simple buffer operation stubs to include/linux/buffer_head.h where they belong. These operations are no-ops in single-threaded U-Boot: - wait_on_buffer: no waiting needed - __bforget: no buffer cache to forget from - lock_buffer: uses set_buffer_locked (already in header) - unlock_buffer: uses clear_buffer_locked (already in header) - test_clear_buffer_dirty: always returns 0 The mark_buffer_dirty macros remain in ext4_uboot.h as they depend on sync_dirty_buffer which is defined later in ext4l. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 +------ include/linux/buffer_head.h | 9 +++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index e09f5c31ebe..9329d854bd3 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -260,15 +260,10 @@ extern struct user_namespace init_user_ns; /* Trace stubs are now in ext4_trace.h */ -/* Buffer operations - stubs */ -#define wait_on_buffer(bh) do { } while (0) -#define __bforget(bh) do { } while (0) +/* Buffer operations - wait_on_buffer, lock_buffer, unlock_buffer etc are in linux/buffer_head.h */ #define mark_buffer_dirty_inode(bh, i) sync_dirty_buffer(bh) #define mark_buffer_dirty(bh) sync_dirty_buffer(bh) -#define lock_buffer(bh) set_buffer_locked(bh) -#define unlock_buffer(bh) clear_buffer_locked(bh) struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); -#define test_clear_buffer_dirty(bh) ({ (void)(bh); 0; }) #define wait_on_bit_io(addr, bit, mode) do { (void)(addr); (void)(bit); (void)(mode); } while (0) /* inode_needs_sync - stub */ diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index b22df564119..94bd2bab96a 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -177,4 +177,13 @@ static inline void put_bh(struct buffer_head *bh) void brelse(struct buffer_head *bh); void __brelse(struct buffer_head *bh); +/* + * Buffer operation stubs - U-Boot is single-threaded + */ +#define wait_on_buffer(bh) do { } while (0) +#define __bforget(bh) do { } while (0) +#define lock_buffer(bh) set_buffer_locked(bh) +#define unlock_buffer(bh) clear_buffer_locked(bh) +#define test_clear_buffer_dirty(bh) ({ (void)(bh); 0; }) + #endif /* _LINUX_BUFFER_HEAD_H */ From patchwork Wed Jan 14 22:56:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1509 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=1768431481; bh=jcMgIMTEZpjp9IJlY+gmvUJxqOAMFLOXJ9UfNSyWCKk=; 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=pBAW72op+gAVb7BaG0sQ3cYXxhYvh/hsJY2+D/AqQv1nxpLHltL3A0jS78S4EQqZq uJLhWfapon1pouk2qxhnNuRU9E633q0WY42XovI2WC6u6rkWj3GDiiDe6+r/lMpxPR KEk4bEYbeRiHdpVQcXToAwD7BoWtZ7oVppcCJh7UYNWwKIVhyBOe856Ktcmq57jK0u sotf9/BMa5slqtTdfgb1r64/UehhRtAe++1QUkhfiItys/gGMLUGtkMjftvAVFROHx ZUc/O4GtE2ZqpSYZMiKGXKKu0x1aYgfEkMH19Kld6M6pWJUsqV9pZWXa/9iFs3vOX/ 0c7M6q4V6jqGg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1DC3692EF for ; Wed, 14 Jan 2026 15:58:01 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1WN7MHo-vg7q for ; Wed, 14 Jan 2026 15:58:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431481; bh=jcMgIMTEZpjp9IJlY+gmvUJxqOAMFLOXJ9UfNSyWCKk=; 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=pBAW72op+gAVb7BaG0sQ3cYXxhYvh/hsJY2+D/AqQv1nxpLHltL3A0jS78S4EQqZq uJLhWfapon1pouk2qxhnNuRU9E633q0WY42XovI2WC6u6rkWj3GDiiDe6+r/lMpxPR KEk4bEYbeRiHdpVQcXToAwD7BoWtZ7oVppcCJh7UYNWwKIVhyBOe856Ktcmq57jK0u sotf9/BMa5slqtTdfgb1r64/UehhRtAe++1QUkhfiItys/gGMLUGtkMjftvAVFROHx ZUc/O4GtE2ZqpSYZMiKGXKKu0x1aYgfEkMH19Kld6M6pWJUsqV9pZWXa/9iFs3vOX/ 0c7M6q4V6jqGg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 906D269345 for ; Wed, 14 Jan 2026 15:58:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431479; bh=ieOdLOk5Mg6onND50e5mpFVDGtv6gtmxjDwUzBpkQkc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P9d3op5KDKn8F9YtBz1zMK7u0mV36HEF7uapd7ZPX6HRtrJWxzjHb1LHf+qiSEGLI xhzhgc95ok/ad6hLrSoqFxcWruRcnv6KX36kH6ZYB5i8FBHd6+o+pihns7PNzeI/S/ QGRUJSfcLb9gUHfJaLxWFUI52qk6pFIyaAbZwQSV5T0YrOwoqljg3DQ39x8wJ0RpsX nAbvwSzpJdLgY0Lyh+3eangp6G3BaG0OlpZnS749UJi0vUJSnUBGFR0M7z1iRz8pku pfjGxCuFhll/xWvYjjQAfbYt9U0Z3MYFfeV2AykWkeCw6ZsyaQBurYe/MoRCXU6bjd VLTdyC/AFf8zQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9009D69345; Wed, 14 Jan 2026 15:57:59 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id QMm2ZREy5Md8; Wed, 14 Jan 2026 15:57:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431473; bh=DhYO0N5saOoJ2AH+6QOi9nBekgZHolrWDatqEXMDh9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDIfhrjuAYwXb1Fp2tasjXZ2y4wm/4tvAvUtsPiUa6rlgGeWhhVeMA91jmG3jqscX +rjG6IgwQQkWUZq1RgO+9hDPMMpqKFG+vyjuFoowWDMjkwD6iv9LQR8p993MtokdIO VQ9HEpdZNQlgf7tyRjsObXWdekeEXtH8ug7/XjnOFtdpW1l1Ok18apes9sugBFFGtd P+nUmgup9WKKMd79IST/4Tyc/NJzUILyOTB+p0QlTi8DJrjBW5xzeUhXpYprOuXzyP QZGL7UkW3mE8XwGHlDHQbEVb/fDbbx8jcYNbVKReyuKgUm8+nZimGfmWaVhP5CuZeW YAJNRKaZmQrWQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 55657692EF; Wed, 14 Jan 2026 15:57:53 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:05 -0700 Message-ID: <20260114225635.3407989-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6ZF5FPPDZAU57DOJR77SP6HMJWLXN34B X-Message-ID-Hash: 6ZF5FPPDZAU57DOJR77SP6HMJWLXN34B 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/34] ext4l: Move address_space_operations to linux/fs.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move struct address_space_operations from ext4_uboot.h to linux/fs.h where it belongs alongside struct address_space. This matches the Linux kernel structure where both are defined in include/linux/fs.h. Add necessary forward declarations for types used in the function pointers (struct file, struct folio, struct readahead_control, etc.). Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 21 +-------------------- include/linux/fs.h | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 9329d854bd3..715407b83d8 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1224,26 +1224,7 @@ struct readahead_control { #define readahead_pos(rac) ({ (void)(rac); 0LL; }) #define readahead_length(rac) ({ (void)(rac); 0UL; }) -/* Forward declarations for address_space_operations */ -struct writeback_control; -struct swap_info_struct; - -/* address_space_operations stub */ -struct address_space_operations { - int (*read_folio)(struct file *, struct folio *); - void (*readahead)(struct readahead_control *); - sector_t (*bmap)(struct address_space *, sector_t); - void (*invalidate_folio)(struct folio *, size_t, size_t); - bool (*release_folio)(struct folio *, gfp_t); - int (*write_begin)(const struct kiocb *, struct address_space *, loff_t, unsigned, struct folio **, void **); - int (*write_end)(const struct kiocb *, struct address_space *, loff_t, unsigned, unsigned, struct folio *, void *); - int (*writepages)(struct address_space *, struct writeback_control *); - bool (*dirty_folio)(struct address_space *, struct folio *); - bool (*is_partially_uptodate)(struct folio *, size_t, size_t); - int (*error_remove_folio)(struct address_space *, struct folio *); - int (*migrate_folio)(struct address_space *, struct folio *, struct folio *, int); - int (*swap_activate)(struct swap_info_struct *, struct file *, sector_t *); -}; +/* address_space_operations is in linux/fs.h */ /* Stub for buffer_migrate_folio */ static inline int buffer_migrate_folio(struct address_space *mapping, diff --git a/include/linux/fs.h b/include/linux/fs.h index 54c0148ee72..241711eded1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -15,7 +15,12 @@ struct inode; struct super_block; struct buffer_head; -struct address_space_operations; +struct file; +struct folio; +struct readahead_control; +struct kiocb; +struct writeback_control; +struct swap_info_struct; /* errseq_t - error sequence type */ typedef u32 errseq_t; @@ -55,6 +60,9 @@ struct path { #define FOLIO_CACHE_MAX 64 #endif +/* address_space_operations - forward declare for address_space */ +struct address_space_operations; + /* address_space - extended for inode.c */ struct address_space { struct inode *host; @@ -70,6 +78,27 @@ struct address_space { #endif }; +/* address_space_operations - filesystem address space methods */ +struct address_space_operations { + int (*read_folio)(struct file *, struct folio *); + void (*readahead)(struct readahead_control *); + sector_t (*bmap)(struct address_space *, sector_t); + void (*invalidate_folio)(struct folio *, size_t, size_t); + bool (*release_folio)(struct folio *, gfp_t); + int (*write_begin)(const struct kiocb *, struct address_space *, + loff_t, unsigned, struct folio **, void **); + int (*write_end)(const struct kiocb *, struct address_space *, + loff_t, unsigned, unsigned, struct folio *, void *); + int (*writepages)(struct address_space *, struct writeback_control *); + bool (*dirty_folio)(struct address_space *, struct folio *); + bool (*is_partially_uptodate)(struct folio *, size_t, size_t); + int (*error_remove_folio)(struct address_space *, struct folio *); + int (*migrate_folio)(struct address_space *, struct folio *, + struct folio *, int); + int (*swap_activate)(struct swap_info_struct *, struct file *, + sector_t *); +}; + /* block_device - minimal stub */ struct block_device { struct address_space *bd_mapping; From patchwork Wed Jan 14 22:56:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1510 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=1768431483; bh=ZQ60/OSpz3Mm0bE1DSKZwNAJJXYro6i5mfCpaiOU1uU=; 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=U0ysUuZuzK60Ku0EnxXq3RHe5zFZIPEH34+NwdSZh082RUw+Pwai89Y7rUwXLa84E oxGCy2indUvhWsVfjkSZJBu9Kta38Ilvzy7r5ud4jZkPGmcQ4lCkD5+TcPLHi+tN34 v3Blpw4xMkUl9KAfcH0FdOqUUyLxw+Ob3CrYkmaByT5Ef7g+D6/Y7d2aI5RswMJtMk pAuyil7CVm2kzyx1HGA3edZrd/krevgANyD3/GDYJ7XQYujqOczBHQlZ0Fzx/uaFIT FNYp87wWL5y+FzvzXG8GtAENmfyHRYN097jtffqG8Zp47hwKAx1VxoAgrBKHf5Dbjk 84AyE265KBZyA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0045692E6 for ; Wed, 14 Jan 2026 15:58:03 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id F2l62mqRK-Mw for ; Wed, 14 Jan 2026 15:58:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431483; bh=ZQ60/OSpz3Mm0bE1DSKZwNAJJXYro6i5mfCpaiOU1uU=; 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=U0ysUuZuzK60Ku0EnxXq3RHe5zFZIPEH34+NwdSZh082RUw+Pwai89Y7rUwXLa84E oxGCy2indUvhWsVfjkSZJBu9Kta38Ilvzy7r5ud4jZkPGmcQ4lCkD5+TcPLHi+tN34 v3Blpw4xMkUl9KAfcH0FdOqUUyLxw+Ob3CrYkmaByT5Ef7g+D6/Y7d2aI5RswMJtMk pAuyil7CVm2kzyx1HGA3edZrd/krevgANyD3/GDYJ7XQYujqOczBHQlZ0Fzx/uaFIT FNYp87wWL5y+FzvzXG8GtAENmfyHRYN097jtffqG8Zp47hwKAx1VxoAgrBKHf5Dbjk 84AyE265KBZyA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9F38D6934D for ; Wed, 14 Jan 2026 15:58:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431482; bh=GHslN7zWmwIh0aG88pOFGOI5COaxWBefLGI2wGDQtzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjw4QDT9yV7w2w2stbOftt5wIHrzZLOZTZiuFrk1OFrAv6gAxPC4pRE9XyyRNN1NE cCIVGFFwIWva3ppt+z7U6obNPJbAWgKTL01fJLalPlrFfnbejampqg7/TTdAU3PAtM uLc/rIm9hGQUSuvy2Sv13zf9hPjJwkBGwZVU4Ivmt58MxZVez3+RQZlC0KeKV+DJO2 7wE9Udc2ABW2EkZ61ofgjMkwfYDMz3LiP9D8Ir5T2csTohJX20oO2Ax41VBRPOXWCM PHjMg5jsS/ZFQbwZptnXl4aflM3KTdMoMXC4ERyQTAPF7zMDkxgUlruMCUOftas7y6 WmOthM4KrWmog== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D019692E6; Wed, 14 Jan 2026 15:58: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 10026) with ESMTP id 8wUb7wn3P79z; Wed, 14 Jan 2026 15:58:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431478; bh=nZpknmCrJTusXwJOyxiXr2Pd+hHI4IHjUCvT0I7ZcB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vkklIwsCqQRSrHiW5gGOEqtMWxskZwE578jNt92/yc2wwkVbTqUb6sEP3Wkixtvuy 8C4mfZAIJ/PJEI5LhKyJcSgYC2eqqHZ8yxGVfHgw8fIFjFnABcI+PjtOJaHNiU4HHX 2Y4W0iwDPGHCuQzj0nu7ugOOszK0be7cHtpTituLjvrMAfmfSqwQcIDD1ogiMdTTbE GbdwRpBHeSAG4FN4898utffG+4dVD5vjQO9XzoznomVDGYrRc4tFUNiOCrnP1ET8+Q Qi/UuH5rwfmGeYGsU7wD6d9piVu2+4LVRjTSIJFs5fZ2NqyOH8DCEjCicMh2gaifkf G6OILh9PJNLdw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E6D1D69342; Wed, 14 Jan 2026 15:57:57 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:06 -0700 Message-ID: <20260114225635.3407989-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ABE67JVXDWJ4UPMULVIHOQEIZDML3PP5 X-Message-ID-Hash: ABE67JVXDWJ4UPMULVIHOQEIZDML3PP5 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/34] ext4l: Use linux/build_bug.h and linux/bug.h for macros List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The ext4l code defines local versions of BUILD_BUG_ON(), WARN_ON(), and WARN_ONCE() instead of using the standard U-Boot headers. Use linux/build_bug.h and linux/bug.h to provide these macros. Keep BUG()/BUG_ON() as no-op stubs since linux/bug.h's versions call panic(). Some BUG_ON() conditions check for race conditions that can trigger in single-threaded U-Boot, so they must be stubbed out. Add a bio_sectors() inline function which is now needed because WARN_ONCE() evaluates its arguments (unlike the previous no-op stub). Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 715407b83d8..b13e653c883 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -39,6 +39,8 @@ #include #include /* Real rbtree implementation */ #include /* For timespec64, time64_t */ +#include /* For BUILD_BUG_ON */ +#include /* For WARN_ON, WARN_ONCE */ #include /* For crc32() used by crc32_be */ #include "ext4_trace.h" /* Trace event stubs */ #include "ext4_fscrypt.h" /* fscrypt stubs */ @@ -248,8 +250,15 @@ struct user_namespace { }; extern struct user_namespace init_user_ns; -/* BUG_ON / BUG - stubs (panic is in vsprintf.h) */ -#define BUG_ON(cond) do { } while (0) +/* + * BUG_ON / BUG - stubs (not using linux/bug.h which panics) + * In Linux, these indicate kernel bugs. In ext4l, some BUG_ON conditions + * that check for race conditions can trigger in single-threaded U-Boot, + * so we stub them out as no-ops. + */ +#undef BUG_ON +#undef BUG +#define BUG_ON(cond) do { (void)(cond); } while (0) #define BUG() do { } while (0) /* might_sleep - stub */ @@ -930,13 +939,8 @@ struct seq_file; #define fallthrough __attribute__((__fallthrough__)) #endif -/* BUILD_BUG_ON - compile-time assertion */ -#define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) - -/* Warning macros - stubs */ -#define WARN_ON_ONCE(cond) ({ (void)(cond); 0; }) -#define WARN_ON(cond) ({ (void)(cond); 0; }) -#define WARN_ONCE(cond, fmt, ...) ({ (void)(cond); 0; }) +/* BUILD_BUG_ON is in linux/build_bug.h */ +/* WARN_ON, WARN_ON_ONCE, WARN_ONCE are in linux/bug.h */ #define pr_warn_once(fmt, ...) do { } while (0) /* lockdep stubs */ @@ -2418,6 +2422,12 @@ struct bio { void (*bi_end_io)(struct bio *); }; +/* bio_sectors - return number of sectors in bio */ +static inline unsigned int bio_sectors(struct bio *bio) +{ + return bio->bi_iter.bi_size >> 9; +} + /* folio_iter for bio iteration */ struct folio_iter { int i; From patchwork Wed Jan 14 22:56:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1511 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=1768431488; bh=1SiEvfyMvA/Nq/HuuSLiBXwS0nv3hWK3WbKfoteoFM0=; 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=m5JcyeLgXO3kwmF1dB0jMt80U2+B5EV+WqsFDhLzAWODl+g90OLI6A5GaDj4bvvvF L1lzSRAH46v9k6g2m86xiTGpPr3NJPE9U0VyV1VsdvcN2dhLySOTWJZA7P32R7Mcdr +ees9aznlWNQJ2AAE9iA2Ehx7NhN0FT5W3ZjFWrUc77EYksNjUtZA6/VnUEbu+NoCy 2eNrHb6P3/eJLq+0ohLgD7Z6FKd+uwMaXWJ3obbAr3du7JqiF4L2rTZrhqUvKO1gBD BHFNqkCLkYUeLiF55FFboACxtPHtj0k0yuH8fIChzy2b100blaYb+NEmKP1/2aO3rk ixvN4G2dxCq0Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3408B692E6 for ; Wed, 14 Jan 2026 15:58: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 R3fWXKl8m536 for ; Wed, 14 Jan 2026 15:58:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431488; bh=1SiEvfyMvA/Nq/HuuSLiBXwS0nv3hWK3WbKfoteoFM0=; 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=m5JcyeLgXO3kwmF1dB0jMt80U2+B5EV+WqsFDhLzAWODl+g90OLI6A5GaDj4bvvvF L1lzSRAH46v9k6g2m86xiTGpPr3NJPE9U0VyV1VsdvcN2dhLySOTWJZA7P32R7Mcdr +ees9aznlWNQJ2AAE9iA2Ehx7NhN0FT5W3ZjFWrUc77EYksNjUtZA6/VnUEbu+NoCy 2eNrHb6P3/eJLq+0ohLgD7Z6FKd+uwMaXWJ3obbAr3du7JqiF4L2rTZrhqUvKO1gBD BHFNqkCLkYUeLiF55FFboACxtPHtj0k0yuH8fIChzy2b100blaYb+NEmKP1/2aO3rk ixvN4G2dxCq0Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 21C3D69345 for ; Wed, 14 Jan 2026 15:58:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431486; bh=nlLs/i6GvCPXdE6l3hpoNWfGjz8OOZBFac6IKXIc78g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vkhlhk3vuHIxywjL7da3z23E4+YFlyvr/y/b8URFEAaL8Uq7rUGCmiy+QSCckecff gbON3lCyAxYRDNmwKsWmG7Mc6b++UHLvIfDvI99xnyM+shFGCDXuvkLFRCN18NnfFu QF7kd2eyTVHT/ilHqO/Ln6qtoZh2wZNdkLS6PhvW2ATPJTnr4Cs/mj9J6ZO799kbcw ETH+IEm8c/G5PWzFkJgrYKVq1nJEWCqzrSQFz3FHrnUgasett3NU6JlykYl+GX7CB6 2Y4e50ix4pbOsqhkVqWQaS+Eb6aE4vVaMStXH/Flo5KUrmEPrg4Sn7Fmv9ClexH8H0 sTLbIw2MV1aig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DEFFC692E6; Wed, 14 Jan 2026 15:58:06 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ZAIPnB6fMugc; Wed, 14 Jan 2026 15:58:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431482; bh=ggBtWVo4hi1dnWxkQ1eJ0n+87GG4GW4UMj1/YyPs4Yk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IaIgkR39zfCL2KqL7oDsJOGOM0SCZq/SoY9sc4HvTCcElMTmeHIj4NXMsVW5hTk7E 6H4u/KDNq5eWc/JlufQlbFdznQhRuQSis3YlTaHrJ4qsRiuWu9BqRkoO4J5KIHgC+o igXCxftJ6TlhcA3KpoEcrF8q+VmNUogVM94TFpyBAfNd/egKAiUcAkyHbyhDDVSldY OGb5clbXv0lJXi1jjelY9/RkBOBtcEN092LemQXdq4gw/tQFJix5g1HGCrgbLUVns8 4ALo1esEG6cBLycg/jsbj3Cvfrew2mxoJV5v3LSFc1f9JwhPvDDxA4yHgV/6FIR+xM FNijNwzIvb0aA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8D9CF6935F; Wed, 14 Jan 2026 15:58:02 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:07 -0700 Message-ID: <20260114225635.3407989-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LIPD2JHGJDCUKZ3ZCJ53TFZXULQM7MXB X-Message-ID-Hash: LIPD2JHGJDCUKZ3ZCJ53TFZXULQM7MXB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/34] ext4l: Move seq_file definitions to linux/seq_file.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move struct seq_operations and SEQ_START_TOKEN to linux/seq_file.h where they belong, following standard Linux header organisation. Also move GFP_NOIO to linux/slab.h with the other GFP flags, and remove the redundant bh_end_io_t typedef since it is already defined in linux/buffer_head.h Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 28 ++++++---------------------- include/linux/seq_file.h | 13 +++++++++++++ include/linux/slab.h | 3 +++ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index b13e653c883..3cc37f65dda 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -524,11 +524,7 @@ typedef long long qsize_t; /* blk_opf_t - block operation flags */ typedef unsigned int blk_opf_t; -/* Forward declare buffer_head for bh_end_io_t */ -struct buffer_head; - -/* bh_end_io_t - buffer head end io callback */ -typedef void bh_end_io_t(struct buffer_head *bh, int uptodate); +/* bh_end_io_t and struct buffer_head are in linux/buffer_head.h */ /* Directory entry types */ #define DT_UNKNOWN 0 @@ -919,9 +915,7 @@ struct dx_hash_info { #define EXT4_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1) /* jbd2_buffer_trigger_type is defined in jbd2.h */ - -/* seq_file - forward declaration */ -struct seq_file; +/* struct seq_file is in linux/seq_file.h */ /* fscrypt_has_encryption_key, fscrypt_fname_siphash are in ext4_fscrypt.h */ @@ -1151,8 +1145,7 @@ static inline ktime_t ktime_add_ns(ktime_t kt, s64 ns) int name __attribute__((unused)) = 0 #define __ratelimit(state) ({ (void)(state); 1; }) -/* seq_file tokens */ -#define SEQ_START_TOKEN ((void *)1) +/* SEQ_START_TOKEN is in linux/seq_file.h */ /* folio - memory page container stub */ struct folio { @@ -1874,8 +1867,7 @@ struct kstatfs { long f_spare[4]; }; -/* seq_file stubs */ -struct seq_file; +/* struct seq_file is in linux/seq_file.h */ /* Module stubs */ struct module; @@ -2339,13 +2331,7 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, /* pde_data - proc dir entry data (not supported in U-Boot) */ #define pde_data(inode) ((void *)NULL) -/* seq_operations for procfs iteration */ -struct seq_operations { - void *(*start)(struct seq_file *m, loff_t *pos); - void (*stop)(struct seq_file *m, void *v); - void *(*next)(struct seq_file *m, void *v, loff_t *pos); - int (*show)(struct seq_file *m, void *v); -}; +/* struct seq_operations is in linux/seq_file.h */ /* DEFINE_RAW_FLEX - define a flexible array struct on the stack (stubbed to NULL) */ #define DEFINE_RAW_FLEX(type, name, member, count) \ @@ -2462,9 +2448,7 @@ struct folio_iter { #define blk_status_to_errno(status) (-(status)) /* atomic_inc is in asm-generic/atomic.h */ - -/* GFP_NOIO - allocation without I/O */ -#define GFP_NOIO 0 +/* GFP_NOIO is in linux/slab.h */ /* fscrypt page-io stubs are in ext4_fscrypt.h */ diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index e4139f48e16..c10da3e4f98 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -2,6 +2,8 @@ #ifndef _LINUX_SEQ_FILE_H #define _LINUX_SEQ_FILE_H +#include + /* * Stub definitions for seq_file interface. * U-Boot doesn't use /proc filesystem. @@ -12,6 +14,17 @@ struct seq_file { struct file *file; }; +/* seq_operations for procfs iteration */ +struct seq_operations { + void *(*start)(struct seq_file *m, loff_t *pos); + void (*stop)(struct seq_file *m, void *v); + void *(*next)(struct seq_file *m, void *v, loff_t *pos); + int (*show)(struct seq_file *m, void *v); +}; + +/* SEQ_START_TOKEN for iteration start marker */ +#define SEQ_START_TOKEN ((void *)1) + #define seq_printf(m, fmt, ...) do { (void)(m); } while (0) #define seq_puts(m, s) do { (void)(m); (void)(s); } while (0) #define seq_putc(m, c) do { (void)(m); (void)(c); } while (0) diff --git a/include/linux/slab.h b/include/linux/slab.h index 2b374641534..f0c0add0cbd 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -42,6 +42,9 @@ #ifndef __GFP_NOFAIL #define __GFP_NOFAIL ((gfp_t)0) #endif +#ifndef GFP_NOIO +#define GFP_NOIO ((gfp_t)0) +#endif void *kmalloc(size_t size, gfp_t flags); From patchwork Wed Jan 14 22:56:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1512 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=1768431493; bh=VnXp8ZKuFcOmUS13lCU88Ga+DIpb6vyBDAf3ieguFL4=; 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=oLbc76ifT5rKkQLPvtpgumnwuQcFVtXM4RjGj7bLw5Fk6UVCUv8aVqynLHs2oymJP p7XJhEM6CmXaB4+wlkcsKzghhJA5CE10BMI87SPp8E7KYrck/aCOzl1KjI0CfZLHQT 0up0PPzYUxY0Yqx2/MbyE2mH2jBURHhQwu3LrWWBzozZDanzgw7qM64T8yLNy/jCRC IRG+ySma1JiMj4bsTPINky6a20Gd67hZ8CrgfDDEN0vyWySUWeVGcDpbpr+0u/beJO Ypl6fHeWObeZYkNqj3YhIERa7AK+OqIspgcHaIiZzuevNF4zFL0QwiNED3z33zcVll 2nonIa7HGu1Yg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AA50E6935F for ; Wed, 14 Jan 2026 15:58:13 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id tZuJqWPL1rZU for ; Wed, 14 Jan 2026 15:58:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431493; bh=VnXp8ZKuFcOmUS13lCU88Ga+DIpb6vyBDAf3ieguFL4=; 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=oLbc76ifT5rKkQLPvtpgumnwuQcFVtXM4RjGj7bLw5Fk6UVCUv8aVqynLHs2oymJP p7XJhEM6CmXaB4+wlkcsKzghhJA5CE10BMI87SPp8E7KYrck/aCOzl1KjI0CfZLHQT 0up0PPzYUxY0Yqx2/MbyE2mH2jBURHhQwu3LrWWBzozZDanzgw7qM64T8yLNy/jCRC IRG+ySma1JiMj4bsTPINky6a20Gd67hZ8CrgfDDEN0vyWySUWeVGcDpbpr+0u/beJO Ypl6fHeWObeZYkNqj3YhIERa7AK+OqIspgcHaIiZzuevNF4zFL0QwiNED3z33zcVll 2nonIa7HGu1Yg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 96B6F69345 for ; Wed, 14 Jan 2026 15:58:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431491; bh=VBj5XgYa2dkDU/CGSxWepeL4VBSfCGq8dgQOpxnPYaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fvpwMvGz4URjlMKNczRetRNXQh8l0tdKpCbxZiPGUjw4OW516cfEmA/HyJKz2QCha qKZFobZy629XyuDzd8CMDDyvXdvmQmtRWwYhNdjLTybQjUF1sV8G3uQrzJT6takab/ pdMzFZTMOaxTikmLMdMnqRuCk9fwYnneHKNPMZKlSnyDiyrL6FKPGa0PEh0Lppa8I3 O1mD+JS82l3sjWNM9oobXcJH++/PjBtGidT+SbP0lmmn2xWBeCatcEJIkeHNATC5ya aeRGZqKkBUEwwb40/Fnul4i2yVlZiR0GUQ0ns29VxXZXUulxWb+SeL8X2cS5/VFov6 sj+le8V3gGpeQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 79504692E6; Wed, 14 Jan 2026 15:58:11 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id NPYZYC9sQaJD; Wed, 14 Jan 2026 15:58:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431487; bh=ILZMBbioZ9TNmY/+dA6HaQE6BDcoZVMmDMNy1i2hAEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DQE1LvrHjCKMdrmcWCuX4OFNRjwZbOtVxH68KjfJP8Sc9e5s3dcPt/XzTzuq/3bBP UpdrkEfs2n57bnGRoQ5NNr7GyVKZN7UGi/3L0NP2ewGT9tRYpiv5TWseFZBx23NJRr tFgDPG/MBO/guEL3GxOzm+ydBpTaQ2+jGYTV6TS1830GmBPF20U43bYspEA9xE3gvg A8YtPBWJbBsEd9K2lFoMh3wtW5kusnRv5QlvDHlOoz5i8XwndGS3PNogQSg2tLitWS l5x1dyqMX9iB3xwgIa9XdeW0fcfOb/eJbjIqqRIV2N6L7ewekYntZwTTtJv48XG6SH zlHBASAdSCtNQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 344BE692EF; Wed, 14 Jan 2026 15:58:07 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:08 -0700 Message-ID: <20260114225635.3407989-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Z7EILO2NCBF7MW72JM5NSSMMOJWFQ7GS X-Message-ID-Hash: Z7EILO2NCBF7MW72JM5NSSMMOJWFQ7GS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/34] ext4l: Use linux/pagevec.h for folio_batch 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 Replace the duplicate struct folio_batch definition and folio_batch_init macro with the existing linux/pagevec.h header which provides the same functionality. This consolidates the folio batch handling into a single location. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 3cc37f65dda..253f09b73f9 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -39,6 +39,7 @@ #include #include /* Real rbtree implementation */ #include /* For timespec64, time64_t */ +#include /* For struct folio_batch */ #include /* For BUILD_BUG_ON */ #include /* For WARN_ON, WARN_ONCE */ #include /* For crc32() used by crc32_be */ @@ -1158,11 +1159,7 @@ struct folio { int _refcount; }; -/* folio_batch - batch of folios */ -struct folio_batch { - unsigned int nr; - struct folio *folios[16]; -}; +/* struct folio_batch is in linux/pagevec.h */ /* folio operations - stubs */ #define folio_mark_dirty(f) do { (void)(f); } while (0) @@ -1182,7 +1179,7 @@ struct folio_batch { #define folio_unlock(f) do { (void)(f); } while (0) /* folio_put and folio_get are implemented in support.c */ #define folio_lock(f) do { (void)(f); } while (0) -#define folio_batch_init(fb) do { (fb)->nr = 0; } while (0) +/* folio_batch_init is in linux/pagevec.h */ #define filemap_get_folios(m, i, e, fb) ({ (void)(m); (void)(i); (void)(e); (void)(fb); 0U; }) /* xa_mark_t - xarray mark type */ From patchwork Wed Jan 14 22:56:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1513 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=1768431496; bh=xZkNmOh+Bsh1f+z62KjUAl1JtHieP3hdbnrSt871mXA=; 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=p2veal7DPsFHYvg08yu+5om4Gity2fgB6gMq+cpbsfJ37MqGNFsC8/4/tzFy06z50 7FV4XRAJrk2PvJjxli3d0Czc6OBIb/py/EOm+hxxVWfnCTcRS0pdcK0UOxRTanEG6O BNQZ+RFdkxQvq6fr0HRirob64LaLC37fpMeBV6gmd7ETkTL+HfMOVVP8tEHP3OeIqu Hymwhq/SeJZvxQfsbTd1trHZGKi3VCUQIqbupUcELGhFfy3c4RoHex4LsQorW2D3QK YUxONalzTX5URDuCSaeDm7UR3N6R0j4am8Qnhrm4tuLPaVFdcz0O4zBWPw3HL7LzDA UKCS+vTJOwmQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 23A4069368 for ; Wed, 14 Jan 2026 15:58:16 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id cFd_pz1dCso9 for ; Wed, 14 Jan 2026 15:58:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431494; bh=xZkNmOh+Bsh1f+z62KjUAl1JtHieP3hdbnrSt871mXA=; 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=cnnO/IDyA0q5XGXG4Np0CCrumEh/3/ddyaUYW+c0Cczmc1vQapRFNjlzU1gMsoRSS IBES6Swp3/6sVKvT3UTbFrP7r0SHeEVa89VIp5nYD0Q8a25UtCVtvoFiIYOZrf5LRB 5tyaCOgS6fwQI5DPIdrwgfTWBzhUovKGvjR2k4xnG50pkkvvP1C8DWRWmCnnMbHB0U nukCYHzgHTR47xnodjJ4/1t/1c1VWxs35wacu5GUO0KQLCDcm+1zcvRzw+RezOa0VN 69PPrMNcJoblSQtoEC9uwn3VwSrrISlHLuBEyES9VNJ6hYfUBNAV1Fo212xOfJ85E2 /qlN9IE3BDdIg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 32A556934D for ; Wed, 14 Jan 2026 15:58:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431492; bh=iVtwIqYK+vJ0RiZMLJkpdUShY9QzILJf8E46JRd+4EA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p2zVJVrjzAH96egO24wcP/EZxeP0JfnfqiRZsqlA5XjoTrvEsPqKpVRxr0SWQkH/R 5pXFHSZr+84vueaWSAfAWb12GiWXNsBcs0toBApRerqe0GePOWUca/hF1CA5NXufqa PaWcfYw8UL754t1pyrgzfvI0kekwOv5N1FCQDcmQ0mewgpO+b2hL0QT2WImiBt52ox i1Vpx7mEkxd2DKB1sPrTaji1xW2U8mEFP9ijE3LCQPtDbjhlV144QsRooJQHWPnONr mpUbO1I4813bPbKABtbVPSSfx2UVcsA93XNWzYvTS4noX1KA6ffhD4r/GyMWpc512A smuIh1GXUDimA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 52666692E6; Wed, 14 Jan 2026 15:58:12 -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 36IxwmGzr7t8; Wed, 14 Jan 2026 15:58:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431492; bh=i5MgDn+AJ7cIaYSJHgW+19HFAn7xfnbkhPB3xDIBMwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V27kmdP/KufnysCLeFFjvPoR5TKGBvld97+PfPvlQ7d5HkGOKyI1h9PnPX47VGGkH 5s5WdRXARJbkQjDEq0hIvoKREZTlv0XGnXslPJmIC/1HRYudG1z3G+gBcsRr7vhbYM LueydQJ1KX7tQkmvp4LS6nr9nrg0FqNoieaslCKIErxpt4QzXsISAy3EjnchEB46w5 z54qliz2CjLkv8prUyXVMenTMckjZ97HSoqXnVv4tJYhri+OQGv7JlJKvwuNUo1+fe /9+kWviI2KRbSW3+178v2LctPgMcKZsJJbPCMiY4pxJwdWFMkvPKqY5lFBHh8JJCUX 5TvyBlVNeHscA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BC2E8692EF; Wed, 14 Jan 2026 15:58:11 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:09 -0700 Message-ID: <20260114225635.3407989-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AGYFKFFF4FQVW2UPO6GBA4MNWBS222BZ X-Message-ID-Hash: AGYFKFFF4FQVW2UPO6GBA4MNWBS222BZ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 19/34] ext4l: Move printk variants to linux/printk.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 The ext4l code defines pr_warn_once(), printk_ratelimited(), and pr_notice_ratelimited() locally instead of in the common printk header. Move these macros to linux/printk.h where they belong with the other printk macros. Also add additional _once and _ratelimited variants for consistency. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 8 +++----- include/linux/printk.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 253f09b73f9..1c58f64ba2f 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -936,7 +936,7 @@ struct dx_hash_info { /* BUILD_BUG_ON is in linux/build_bug.h */ /* WARN_ON, WARN_ON_ONCE, WARN_ONCE are in linux/bug.h */ -#define pr_warn_once(fmt, ...) do { } while (0) +/* pr_warn_once is in linux/printk.h */ /* lockdep stubs */ #define lockdep_assert_held_read(l) do { (void)(l); } while (0) @@ -2435,8 +2435,7 @@ struct folio_iter { /* xchg - exchange value atomically */ #define xchg(ptr, new) ({ typeof(*(ptr)) __old = *(ptr); *(ptr) = (new); __old; }) -/* printk_ratelimited - just use regular printk */ -#define printk_ratelimited(fmt, ...) do { } while (0) +/* printk_ratelimited is in linux/printk.h */ /* mapping_set_error - record error in address_space */ #define mapping_set_error(m, e) do { (void)(m); (void)(e); } while (0) @@ -2635,8 +2634,7 @@ int bh_read(struct buffer_head *bh, int flags); #define free_pages(addr, order) free((void *)(addr)) #define get_order(size) ilog2(roundup_pow_of_two((size) / PAGE_SIZE)) -/* Ratelimited printk for journal.c */ -#define pr_notice_ratelimited(fmt, ...) pr_notice(fmt, ##__VA_ARGS__) +/* pr_notice_ratelimited is in linux/printk.h */ /* * Stubs for mmp.c diff --git a/include/linux/printk.h b/include/linux/printk.h index 00452944c48..7c075ae9bca 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -84,6 +84,17 @@ #define printk_once(fmt, ...) \ printk(fmt, ##__VA_ARGS__) +/* _once variants - just call the base function (no actual once tracking) */ +#define pr_warn_once(fmt, ...) pr_warn(fmt, ##__VA_ARGS__) +#define pr_info_once(fmt, ...) pr_info(fmt, ##__VA_ARGS__) +#define pr_notice_once(fmt, ...) pr_notice(fmt, ##__VA_ARGS__) + +/* _ratelimited variants - just call the base function (no rate limiting) */ +#define printk_ratelimited(fmt, ...) printk(fmt, ##__VA_ARGS__) +#define pr_notice_ratelimited(fmt, ...) pr_notice(fmt, ##__VA_ARGS__) +#define pr_warn_ratelimited(fmt, ...) pr_warn(fmt, ##__VA_ARGS__) +#define pr_err_ratelimited(fmt, ...) pr_err(fmt, ##__VA_ARGS__) + struct va_format { const char *fmt; va_list *va; From patchwork Wed Jan 14 22:56:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1514 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=1768431499; bh=U/N47+3MXv+ZJLN1DN3WIi6w+zya2y3PgzlepbnSfEw=; 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=JQrnrghj8yQTIM8EefCbeR1uzPAFc97Y02II/tc+0v4TN/WRFfGgBNuE7F1B6B+Mh LPLts4v45tdBVg1K0IYXcDdAqrKUX7sE7QuAc3cRZmfurBKMO2X63FeSfgAb0yYHs4 zKTirwUgScHr0P2np/ZLKPUfjUiCaylc0mdqJZLjWjTAUDNjfLTa8ehRaCaPQ1DUg8 CRYUqF9vnMlidCy1iDl2Nc/dB+gx+mWEIo1S9ekJKbNfEri9gN9K+kQ8ZGtd2WMYXr 4kRjX8dkLDLc3KI1GH+CqDjRfCwfWWZiCBGB+y2S9yp+rmjk0j15Y3AZq+dFL9O4fU xEYeDBHM6gwcw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB64B6935F for ; Wed, 14 Jan 2026 15:58:19 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id XYLI7rzCydry for ; Wed, 14 Jan 2026 15:58:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431499; bh=U/N47+3MXv+ZJLN1DN3WIi6w+zya2y3PgzlepbnSfEw=; 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=JQrnrghj8yQTIM8EefCbeR1uzPAFc97Y02II/tc+0v4TN/WRFfGgBNuE7F1B6B+Mh LPLts4v45tdBVg1K0IYXcDdAqrKUX7sE7QuAc3cRZmfurBKMO2X63FeSfgAb0yYHs4 zKTirwUgScHr0P2np/ZLKPUfjUiCaylc0mdqJZLjWjTAUDNjfLTa8ehRaCaPQ1DUg8 CRYUqF9vnMlidCy1iDl2Nc/dB+gx+mWEIo1S9ekJKbNfEri9gN9K+kQ8ZGtd2WMYXr 4kRjX8dkLDLc3KI1GH+CqDjRfCwfWWZiCBGB+y2S9yp+rmjk0j15Y3AZq+dFL9O4fU xEYeDBHM6gwcw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DA55C69345 for ; Wed, 14 Jan 2026 15:58:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431498; bh=nvPghFj3zewUifgzJnSeRzVbnp41fOWWAB3p1Ckk29M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RiN6Lv/yOF+u7N/0HTYnNnnucu/x7W7UhZNt8WTiZRwvmTSW6w5ynYQz6nTozuFIp zFwcPO0FkUfMnG1UE6MtS29Tbo7lVxKgoxoy+v/C1Zp06B5Awp+SDhhg2wpmlqRg9j 9lzBK3WcbGGH9HU70vjUXstUwZduYORt34Ls/l+XP7O+rZ2vSZuCtit1Xoxuhs5KVH oGmmlVHvn0mDWFrMTduC8ABpQ+hwTSSEIAAaOO+TyTWNrbWGOh91IOOKwjREwxKqzj hM55sq4/K4eGNd6RK6FqlLNExSt8crBG3QNC3or16+Enk6oDdjMS0lg2ncxDQC9fg9 /w5TvPWxKElGw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7C36369345; Wed, 14 Jan 2026 15:58: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 nqub_Xu5Ms3V; Wed, 14 Jan 2026 15:58:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431492; bh=T6AI0CKpXCl2hwFK/xNe/QNxu5SEZF93QXGTrSTl4lM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sRMYdp1lf7qmkWyEDBXazvNf8fdh0HUT+U3q49+XAskWVAyBkRvJY1ajh/kWXLxSA 5OlT1UvNon+P9qLMqXzBRrOsNaZvHWVPm6VYgT87RCLunH2zhl1/XkbrmScbI8YjtY z0bKiTv+IPC1UZd67HdEnAyKRY84jfv0nQfx6ME70K87akyYcHy3GGUGo+KqC6yfCP kiOetIK+AFt6ZLLxuGlHwMUM7WhXP9iC9t607scpsyftDhcHXmGaFjH+2eHya1QwtJ mxfgPqDixdRJ75s93sgHG9lwggGHS+YC1NakBv3kpb1nK2nFCsWtxjcbZcuQshPhWD 0qBXC02RjZszg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 92211692EF; Wed, 14 Jan 2026 15:58:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:10 -0700 Message-ID: <20260114225635.3407989-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BT4VUR7QIVUOC6EQDILEWDIPTZQXOEGF X-Message-ID-Hash: BT4VUR7QIVUOC6EQDILEWDIPTZQXOEGF X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 20/34] ext4l: Move jiffies definitions to linux/jiffies.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The ext4l code defines HZ, jiffies, msecs_to_jiffies(), jiffies_to_msecs(), nsecs_to_jiffies(), and round_jiffies_up() locally instead of in the common jiffies header. Move these to linux/jiffies.h where they belong. Also remove the redundant NSEC_PER_SEC definition since it is already in linux/time.h Time comparison macros time_before() and time_after() are provided by include/time.h which has a better implementation with typecheck() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 18 +++--------------- include/linux/jiffies.h | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 1c58f64ba2f..44f1d2fabc8 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1968,18 +1968,7 @@ struct fs_parse_result { /* crc16 - use U-Boot's implementation */ #include -/* Timer and timing stubs */ -#define HZ 1000 -#define jiffies 0UL -#ifndef time_before -#define time_before(a, b) ((long)((a) - (b)) < 0) -#endif -#ifndef time_after -#define time_after(a, b) time_before(b, a) -#endif -#define msecs_to_jiffies(m) ((m) * HZ / 1000) -#define jiffies_to_msecs(j) ((j) * 1000 / HZ) -#define round_jiffies_up(j) (j) +/* Timer and timing stubs are in linux/jiffies.h */ /* Path lookup flags */ #define LOOKUP_FOLLOW 0x0001 @@ -2022,8 +2011,7 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate); /* Block size */ #define BLOCK_SIZE 1024 -/* Time constants */ -#define NSEC_PER_SEC 1000000000L +/* NSEC_PER_SEC is in linux/time.h */ /* EXT4 magic number */ #define EXT4_SUPER_MAGIC 0xEF53 @@ -2115,7 +2103,7 @@ void *kvzalloc(size_t size, gfp_t flags); /* Time operations */ #define ktime_get_ns() (0ULL) -#define nsecs_to_jiffies(ns) ((ns) / (NSEC_PER_SEC / HZ)) +/* nsecs_to_jiffies is in linux/jiffies.h */ /* Superblock write operations */ #define sb_start_write_trylock(sb) ({ (void)(sb); 1; }) diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index daef4a337a2..153a2841bf5 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -15,4 +15,18 @@ #define MAX_JIFFY_OFFSET ((LONG_MAX >> 1) - 1) +/* HZ - timer frequency (simplified for U-Boot) */ +#define HZ 1000 + +/* jiffies - always 0 in U-Boot (no timer tick counter) */ +#define jiffies 0UL + +/* Time comparison macros are in include/time.h */ + +/* Jiffies conversion */ +#define msecs_to_jiffies(m) ((m) * HZ / 1000) +#define jiffies_to_msecs(j) ((j) * 1000 / HZ) +#define nsecs_to_jiffies(ns) ((ns) / (1000000000L / HZ)) +#define round_jiffies_up(j) (j) + #endif /* _LINUX_JIFFIES_H */ From patchwork Wed Jan 14 22:56:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1515 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=1768431503; bh=ggis0HkvdWItXGkbIY/AgOzSFR3C92EBOvHzSPYUM38=; 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=Nyz9RrP83EceO5I5+kTYr/wKNixRocZ2aRV3ivY7Ey5aqwimZ4OU6m/b2FFwG2hCb a6Pk1nQKn84U+VrtTZTh2JUgUwH/XOt21XL4SsVPZNM/mv5HZVRx/LBhl2/oEIGbND VIN/ISjtNzadZI3opIFqNDKsH7oA+/ODHtXIz5xgYJcqfsBIv12Nj+IfuoAa8E6Yd/ 8WKwTCE5Ub2IzuvPRd8yV/++PG7Ac+6sUlkoQILBqjN1qjz9Ykw47+NmPjNXo/uGn6 dgD5JVVaVHVzcuI94nd3eHZoFIqG4QJw/bR+reQZEVnqqlu3ATKXh62wdLZSvfwNxa A2r2cC2Z3Dflw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 60A4A6935F for ; Wed, 14 Jan 2026 15:58:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id bXXZ9SBP_XBF for ; Wed, 14 Jan 2026 15:58:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431503; bh=ggis0HkvdWItXGkbIY/AgOzSFR3C92EBOvHzSPYUM38=; 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=Nyz9RrP83EceO5I5+kTYr/wKNixRocZ2aRV3ivY7Ey5aqwimZ4OU6m/b2FFwG2hCb a6Pk1nQKn84U+VrtTZTh2JUgUwH/XOt21XL4SsVPZNM/mv5HZVRx/LBhl2/oEIGbND VIN/ISjtNzadZI3opIFqNDKsH7oA+/ODHtXIz5xgYJcqfsBIv12Nj+IfuoAa8E6Yd/ 8WKwTCE5Ub2IzuvPRd8yV/++PG7Ac+6sUlkoQILBqjN1qjz9Ykw47+NmPjNXo/uGn6 dgD5JVVaVHVzcuI94nd3eHZoFIqG4QJw/bR+reQZEVnqqlu3ATKXh62wdLZSvfwNxa A2r2cC2Z3Dflw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 50C9469345 for ; Wed, 14 Jan 2026 15:58:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431502; bh=s3Byb8nbGRFL1eGJG4CaUA8igJgzLdUux+gm9IIYwI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WLEZfD1KBY/FGDiQZ6S2pmsbJmSSO+nNsNkKy+auzWN0tVMoTYLCIdzySrAxeG0UR 1s0d0pC5889SNtaQQwkU+TlzW0CNFF3j2cAvQnYDb0e5gDIuY6d5JV5/2et6Vwh2FY XmiCSKFTs5XOmBOl6SNk6j0pjoOGRbMx53P/z3RRzN2H9FK3Lxbmrc8XWgrGgcD/YR cM3xICTK1XxUKNlucjzC/T28H8+WRwo4haIMda1ZaSaATKlYsLCchsk2wT5BQvcZkI qJ4pBoX0yzjJu8qXmZcS/Ow/brOCDon9pi4YUQMaLsyBWKldkt3qGvpNV5lZXzZWAU gnvP1G58NeT6w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 53DC969345; Wed, 14 Jan 2026 15:58: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 hDd_aY4sjpHh; Wed, 14 Jan 2026 15:58:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431497; bh=rVlBMUj1qC6zN7cfFULoxyJ4ZA/AKeHB50G6v37+0Fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q3p8Doqhpl/js1mQ41WaLZyOL9GzjpSstI9Dfmu35I6GGXsm/52JFM1yl6K0wAmwX 5CYFPAPuOQsf6v+gpdY5IqEOFbToUKiwCWUUFcNBVEyqEVR/gqtxlhY3F0apdAEFBg T/V/nrS8jIOh6UKe2h1PzQePJvlFzKh44a7PFNMqLp6nRPfErR94jmVBeqmH+GVa90 LjBdSCEFX5fAla3RS1DzXaDvYGvwqbWAzynUrhw/14KwngxHb6GxNT+0Y5N3IGlsCw k6UILYY6A+mGj9cg1Eu8w7sjBX/85uWBUZimAnboyjJ7arthEAHX3RB0uZvA72XAxI AggKEKAC9/9uQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2DD2E6913F; Wed, 14 Jan 2026 15:58:17 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:11 -0700 Message-ID: <20260114225635.3407989-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YHVFMC5YV43IZ3M2FLS4GTMEMSGOYT6C X-Message-ID-Hash: YHVFMC5YV43IZ3M2FLS4GTMEMSGOYT6C X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 21/34] ext4l: Move module stubs to linux/module.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 The ext4l code defines MODULE_ALIAS_FS() and filesystem registration macros register_filesystem() and unregister_filesystem() locally instead of in the common module header. Move these to linux/module.h where they belong with the other module-related stubs. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 12 ++---------- include/linux/module.h | 5 +++++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 44f1d2fabc8..4c214fa5bdc 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1866,16 +1866,8 @@ struct kstatfs { /* struct seq_file is in linux/seq_file.h */ -/* Module stubs */ -struct module; -#ifndef THIS_MODULE -#define THIS_MODULE NULL -#endif -#define MODULE_ALIAS_FS(name) - -/* register/unregister filesystem */ -#define register_filesystem(fs) ({ (void)(fs); 0; }) -#define unregister_filesystem(fs) ({ (void)(fs); 0; }) +/* Module stubs and register_filesystem are in linux/module.h */ +#include /* EXT4_GOING flags */ #define EXT4_GOING_FLAGS_DEFAULT 0 diff --git a/include/linux/module.h b/include/linux/module.h index fba06096cbc..834f7d66d49 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -33,5 +33,10 @@ struct module; #define MODULE_ALIAS(alias) #define MODULE_SOFTDEP(dep) #define MODULE_INFO(tag, info) +#define MODULE_ALIAS_FS(name) + +/* Filesystem registration - not used in U-Boot */ +#define register_filesystem(fs) ({ (void)(fs); 0; }) +#define unregister_filesystem(fs) ({ (void)(fs); 0; }) #endif /* _LINUX_MODULE_H */ From patchwork Wed Jan 14 22:56:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1516 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=1768431507; bh=jhvNcFIYpAiMWZjvSq8G2bx/WT+snuDVQWFody5DiEg=; 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=DJiFN33NOdBzRkoSoRwXVZ0BTEj9R0RCq1HJ/X+dDcJKfE0u02jgFdSMCNj4xR5rP Pq3tqYd29xnITbH42kivtnU4IXb2rJKun4aZB8KHQ6kWKbDlQcgErQl3aROY+3Dqn1 KXFfC6GcO0Eo6mZpNTrvGfUFB6KaQkD7KCbc5IwAIZfdyTK+gnBLLwugT+pzsevBWQ MAzcukd4IPUho0e7Tp7uwxZZP89+s3p9rrsjb9WHhSzqdSFcrNf1vMwHvpW3f2KZ1n WOamiGD3MbbqxItI/29CxviR9qCGWkDIkVgOPHSetS0V0VQEa1gtOt1GA9pmprkbfA 2eoqbl1jyzRug== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CF68B6935F for ; Wed, 14 Jan 2026 15:58:27 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id DF1-ZQ2uREjr for ; Wed, 14 Jan 2026 15:58:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431507; bh=jhvNcFIYpAiMWZjvSq8G2bx/WT+snuDVQWFody5DiEg=; 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=DJiFN33NOdBzRkoSoRwXVZ0BTEj9R0RCq1HJ/X+dDcJKfE0u02jgFdSMCNj4xR5rP Pq3tqYd29xnITbH42kivtnU4IXb2rJKun4aZB8KHQ6kWKbDlQcgErQl3aROY+3Dqn1 KXFfC6GcO0Eo6mZpNTrvGfUFB6KaQkD7KCbc5IwAIZfdyTK+gnBLLwugT+pzsevBWQ MAzcukd4IPUho0e7Tp7uwxZZP89+s3p9rrsjb9WHhSzqdSFcrNf1vMwHvpW3f2KZ1n WOamiGD3MbbqxItI/29CxviR9qCGWkDIkVgOPHSetS0V0VQEa1gtOt1GA9pmprkbfA 2eoqbl1jyzRug== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BDA6669345 for ; Wed, 14 Jan 2026 15:58:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431506; bh=N1ooO7Mm1brEoCtPxuR1bR2L8c7J8UlUuYJC6jjXmQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FrcENL+KlWKgYWbfEqlh8c4CzLQ5KkieKeT8ProICNToYsCoB2XL8YsMzIN0jWIW1 U64FKeHPYsCG/4p79BuMKj8t5njfw9hnfXpq9pUMH1wRJACixGWBCFVBHA6wimmEID vhkcxF+AtNrCLApm++GWxZjkFJdG2wjnUCYH/fLxoP69g6C5JGucgxPxlJ8qlYUIgE RKmVERjCnGc9kLfBlhS9D4PD+4i0BGWA+O7R254StnuYotQtuE6FBq/nIupSYg8Cav BIdpTg76ERUMcN6kjEaargi9NtBSgdC6ayPlJhiQeFsDmLwwaNkFHWfx/wzF6YiX1R M7TXIILlcReGg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1F3F96913F; Wed, 14 Jan 2026 15:58:26 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id XlCPLvl0jQfa; Wed, 14 Jan 2026 15:58:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431502; bh=NbG9G5hx/pZDfNEY5NlnXkrez4QXr+7k7o6q6CmPLUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fhgps9PS9LESn1Doyi9JetpgiYX94m0DUGrzmdcNwEOhAyTKfcymO4eZF0wiGLRh+ 17rOKO0rXYIzB+r4rDo1X0oyzsLfeUrZJqjZQMQyMxxjcj/E4y43nC1Y5Z20GSR99I E3pwQQKObtezIqmMk4IvcFQ6H8rNbZL54MXqZVzYTS/WV2LnrxEej3Sx/ieivMcn8y F3zIoMaKc4xWg81wTDKZDW4M/2xdiFEV9JsnyE9uHG8hoe8z76l4+3hCjADA5w0iyc sJy8abng1m7v51N0C6O+sgnXGBtXJfDTgTAUxMjiGq8NFVGNfLBXj0rE6cI259/44Y f22Z56PJXA0Pw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B9E16692EF; Wed, 14 Jan 2026 15:58:21 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:12 -0700 Message-ID: <20260114225635.3407989-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NRKPXY536MQ3NDK4CFSRPKM5ZYXWSFGO X-Message-ID-Hash: NRKPXY536MQ3NDK4CFSRPKM5ZYXWSFGO X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 22/34] ext4l: Create linux/lockdep.h for lock dependency stubs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create a new linux/lockdep.h header to consolidate all the scattered lockdep stubs from ext4_uboot.h. This includes lock_class_key, lockdep_map, and all the lockdep assertion macros. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 22 ++++++---------------- include/linux/lockdep.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 include/linux/lockdep.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4c214fa5bdc..ce40888879e 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -123,11 +123,7 @@ struct kobject { }; /* lockdep stubs - needed before jbd2.h is included */ -struct lockdep_map { int dummy; }; -struct lock_class_key { int dummy; }; -#define rwsem_acquire(l, s, t, i) do { } while (0) -#define rwsem_acquire_read(l, s, t, i) do { } while (0) -#define rwsem_release(l, i) do { } while (0) +#include #define _THIS_IP_ ((unsigned long)0) /* completion - use Linux header */ @@ -388,8 +384,7 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, /* RCU head for callbacks - defined in linux/compat.h as callback_head */ -/* lockdep stubs */ -#define lockdep_is_held(lock) (1) +/* lockdep_is_held is in linux/lockdep.h */ /* Memory allocation - use linux/slab.h which is already available */ #include @@ -938,8 +933,7 @@ struct dx_hash_info { /* WARN_ON, WARN_ON_ONCE, WARN_ONCE are in linux/bug.h */ /* pr_warn_once is in linux/printk.h */ -/* lockdep stubs */ -#define lockdep_assert_held_read(l) do { (void)(l); } while (0) +/* lockdep_assert_held_read is in linux/lockdep.h */ /* strtomem_pad - copy string to fixed-size buffer with padding */ #define strtomem_pad(dest, src, pad) do { \ @@ -987,9 +981,7 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) #define inode_trylock_shared(inode) (1) #define inode_dio_wait(inode) do { } while (0) -/* Lock debugging - no-ops in U-Boot */ -#define lockdep_assert_held_write(l) do { } while (0) -#define lockdep_assert_held(l) do { } while (0) +/* Lock debugging stubs are in linux/lockdep.h */ /* File operations */ #define file_modified(file) ({ (void)(file); 0; }) @@ -2502,8 +2494,7 @@ struct wait_bit_entry { #define release_dentry_name_snapshot(snap) \ do { (void)(snap); } while (0) -/* lockdep stubs */ -#define lockdep_assert_not_held(lock) do { (void)(lock); } while (0) +/* lockdep_assert_not_held is in linux/lockdep.h */ /* Request flags for block I/O */ #define REQ_IDLE 0 @@ -2591,8 +2582,7 @@ loff_t seq_lseek(struct file *f, loff_t o, int w); ({ (void)(n); (void)(m); (void)(p); (void)(ops); (void)(d); (struct proc_dir_entry *)NULL; }) #define remove_proc_entry(n, p) do { (void)(n); (void)(p); } while (0) -/* lockdep stubs (struct lock_class_key defined earlier) */ -#define lockdep_init_map(...) do { } while (0) +/* lockdep_init_map and lock_class_key are in linux/lockdep.h */ /* Block device operations for journal.c */ int bh_read(struct buffer_head *bh, int flags); diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h new file mode 100644 index 00000000000..e95b6d171ad --- /dev/null +++ b/include/linux/lockdep.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Lock dependency validator stubs for U-Boot + * + * U-Boot is single-threaded, so lock dependency checking is not needed. + * These stubs allow Linux kernel code to compile unchanged. + */ +#ifndef _LINUX_LOCKDEP_H +#define _LINUX_LOCKDEP_H + +/* Lock class key - used for lockdep annotations */ +struct lock_class_key { + int dummy; +}; + +/* Lockdep map - used for lock tracking */ +struct lockdep_map { + int dummy; +}; + +/* Lockdep assertion macros - all no-ops in U-Boot */ +#define lockdep_is_held(lock) (1) +#define lockdep_assert_held(lock) do { (void)(lock); } while (0) +#define lockdep_assert_held_read(lock) do { (void)(lock); } while (0) +#define lockdep_assert_held_write(lock) do { (void)(lock); } while (0) +#define lockdep_assert_not_held(lock) do { (void)(lock); } while (0) + +/* Lockdep initialisation and tracking - no-ops */ +#define lockdep_init_map(...) do { } while (0) + +/* RW semaphore lockdep stubs */ +#define rwsem_acquire(l, s, t, i) do { } while (0) +#define rwsem_acquire_read(l, s, t, i) do { } while (0) +#define rwsem_release(l, i) do { } while (0) + +#endif /* _LINUX_LOCKDEP_H */ From patchwork Wed Jan 14 22:56:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1517 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=1768431512; bh=ctPMEcAKe9Ru0PaXzw/CV6BK4deMbNCqVsBvZ7U8AIA=; 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=Hp0Ff/ewXx7WkOf+bmoLwmL9hV9enYGvZxmYni77fqzau+Hh4a1xiLfrCgY+yj/w+ Awjp50lQmTypAyVf4M9vahdDV4HOwHDfAaVsTmFn4qhxGm9kGWddxy+euT5ZtylXNH sZbSw6FstVUnVemYC3lKervKo3HihcTSxGRA4v71pq8XYyFd9NbKt3EfU2f8JrbfBE BEbsR8fRBMR948PSKAsaYk0twTnHKgp+F71PSDYM0JbSvl/l2mRUod0mgT/sJ/tpVr peNbfCDjW++v62kHFSAJwK5Sd+Qb0waX3cFGQaJ4jEdMYCrADeFvE/Ykc1f4ARSvsQ D0EpKKWHRDepA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 514E26935F for ; Wed, 14 Jan 2026 15:58:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HrqXHjAiBNEx for ; Wed, 14 Jan 2026 15:58:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431512; bh=ctPMEcAKe9Ru0PaXzw/CV6BK4deMbNCqVsBvZ7U8AIA=; 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=Hp0Ff/ewXx7WkOf+bmoLwmL9hV9enYGvZxmYni77fqzau+Hh4a1xiLfrCgY+yj/w+ Awjp50lQmTypAyVf4M9vahdDV4HOwHDfAaVsTmFn4qhxGm9kGWddxy+euT5ZtylXNH sZbSw6FstVUnVemYC3lKervKo3HihcTSxGRA4v71pq8XYyFd9NbKt3EfU2f8JrbfBE BEbsR8fRBMR948PSKAsaYk0twTnHKgp+F71PSDYM0JbSvl/l2mRUod0mgT/sJ/tpVr peNbfCDjW++v62kHFSAJwK5Sd+Qb0waX3cFGQaJ4jEdMYCrADeFvE/Ykc1f4ARSvsQ D0EpKKWHRDepA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 401AB69345 for ; Wed, 14 Jan 2026 15:58:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431510; bh=DHIqpBv9TpdL3P+i/EXAljVChJYQ6LxYNO7GoHI7Rd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lAFUQ9D/dzMtp3tDx3Ul9kYm3Y+rUEO+70jfasb/N/7ZT0gTYdz480NJhWoXnABAF 9UJuD4U4y1wwZ2aeb+tKpCC27dct/cRe5iqS0wHGrvSfBzs0CXQApXk3o2mEgVDy9K JcbS/RvK15ATckwag6/5UMLwmMm+ds4QulujGebkpypHqZIYTNjo08WcgE7TO2oacd r5KgtRVJF9vss6TBmp+9fCuttNKJRVmv4Qp4nJ8N66ynLGziZrKzxL/ctDVlrt2QmU YpNcWUFxZuj4uQmB91+t2HXqv5wrlTGpkgnjAX5RDs2s0mpjmQBbQCirSEX0Vq4bQa 3P72Il7sARQaQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CCA6B6913F; Wed, 14 Jan 2026 15:58:30 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id iVh3tfzptfGG; Wed, 14 Jan 2026 15:58:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431506; bh=XSWyl3O0ntFEa2YkiAhrSNH+HW9RDYJIraFwNZvKUJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QxAXGwZO6BgeMxtAVyztoQxZ2M363eZ/3lW/SbegKUu9WGJklaFA7Rq823X+f/x+H 58wu00cEty6Km/sfsFM5liaJCMwQanaGgVWOxBfG98YrSzdffqVCGrZPCOtE6qQY2e ADhNyy0DwaBdkytmwcjvTuZ8xrDyqPkhLql08veYvphV+sumqjkOg3/wniAMUA9Mbq 42M0bhWYN/63i3GkbUmjzWEvxlt8m/qBzdamedgH98pQybTGHvgxbxsJ7iy9hRlvs8 I7MsMQ+5iWbCxLDLuEl8mE5UivDqnmXZnp7nOflBbFtaKer3OAHdp+M4mr92En6TPt 4ObTRZ3+Lqueg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6697E692EF; Wed, 14 Jan 2026 15:58:26 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:13 -0700 Message-ID: <20260114225635.3407989-24-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: J5H3XE3NVIEHAVKXVUCBSPWLIE5FPB5X X-Message-ID-Hash: J5H3XE3NVIEHAVKXVUCBSPWLIE5FPB5X X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 23/34] ext4l: Move string helpers to standard locations List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The ext4l code defines string helper functions locally instead of in the standard Linux compatibility headers. Move these functions to their proper locations: - strtomem_pad(): macro added to linux/string.h - strscpy_pad(): macro added to linux/string.h - strreplace(): declaration in linux/string.h, implementation in lib/string.c - kmemdup_nul(): declaration in linux/slab.h (alongside kmemdup()), implementation in lib/string.c This makes these functions available to other parts of U-Boot and reduces duplication in ext4l. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 20 ++++---------------- fs/ext4l/stub.c | 32 ++++---------------------------- include/linux/slab.h | 13 +++++++++++++ include/linux/string.h | 41 +++++++++++++++++++++++++++++++++++++++++ lib/string.c | 25 +++++++++++++++++++++++++ 5 files changed, 87 insertions(+), 44 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index ce40888879e..7b90276b2bc 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -934,16 +934,8 @@ struct dx_hash_info { /* pr_warn_once is in linux/printk.h */ /* lockdep_assert_held_read is in linux/lockdep.h */ - -/* strtomem_pad - copy string to fixed-size buffer with padding */ -#define strtomem_pad(dest, src, pad) do { \ - size_t _len = strlen(src); \ - if (_len >= sizeof(dest)) \ - _len = sizeof(dest); \ - memcpy(dest, src, _len); \ - if (_len < sizeof(dest)) \ - memset((char *)(dest) + _len, (pad), sizeof(dest) - _len); \ -} while (0) +/* 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) @@ -2075,10 +2067,7 @@ struct dentry *generic_fh_to_parent(struct super_block *sb, struct fid *fid, /* I/O priority - declaration for stub.c */ int IOPRIO_PRIO_VALUE(int class, int data); -/* String operations */ -char *kmemdup_nul(const char *s, size_t len, gfp_t gfp); -#define strscpy_pad(dst, src) strncpy(dst, src, sizeof(dst)) - +/* kmemdup_nul is in linux/slab.h */ /* fscrypt declarations are in ext4_fscrypt.h */ /* Memory allocation - declarations for stub.c */ @@ -2191,8 +2180,7 @@ struct mb_cache_entry { void generic_set_sb_d_ops(struct super_block *sb); struct dentry *d_make_root(struct inode *inode); -/* String operations - declarations for stub.c */ -char *strreplace(const char *str, char old, char new); +/* strreplace is in linux/string.h */ /* Ratelimit - declaration for stub.c */ void ratelimit_state_init(void *rs, int interval, int burst); diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index a0c21dfd14c..c14132815cd 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -373,32 +373,8 @@ int ext4_update_overhead(struct super_block *sb, bool force) return 0; } -/* String stubs */ -/* strtomem_pad is now a macro in ext4_uboot.h */ - -char *strreplace(const char *str, char old, char new) -{ - char *s = (char *)str; - - while (*s) { - if (*s == old) - *s = new; - s++; - } - return (char *)str; -} - -char *kmemdup_nul(const char *s, size_t len, gfp_t gfp) -{ - char *buf; - - buf = kmalloc(len + 1, gfp); - if (buf) { - memcpy(buf, s, len); - buf[len] = '\0'; - } - return buf; -} +/* strtomem_pad, strscpy_pad, strreplace are now in linux/string.h */ +/* kmemdup_nul is now in linux/slab.h, with implementation in lib/string.c */ /* Page allocation */ unsigned long get_zeroed_page(gfp_t gfp) @@ -506,8 +482,8 @@ int sb_set_blocksize(struct super_block *sb, int size) return size; } -/* strscpy_pad is now a macro in ext4_uboot.h */ -/* kmemdup_nul is defined earlier in this file */ +/* strscpy_pad is now a macro in linux/string.h */ +/* kmemdup_nul is now in lib/string.c */ /* Address check */ int generic_check_addressable(unsigned int blocksize_bits, u64 num_blocks) diff --git a/include/linux/slab.h b/include/linux/slab.h index f0c0add0cbd..4f413f93fa3 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -87,6 +87,19 @@ static inline void *krealloc(const void *p, size_t new_size, gfp_t flags) void *kmemdup(const void *src, size_t len, gfp_t gfp); +/** + * kmemdup_nul - Duplicate a string with null termination + * @s: Source string + * @len: Maximum length to copy + * @gfp: GFP flags for allocation + * + * Allocates len + 1 bytes, copies up to @len bytes from @s, and + * ensures the result is null-terminated. + * + * Return: pointer to new string, or NULL on allocation failure + */ +char *kmemdup_nul(const char *s, size_t len, gfp_t gfp); + /* kmem_cache stubs */ struct kmem_cache { int sz; diff --git a/include/linux/string.h b/include/linux/string.h index d943fcce690..591d99c46a1 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -147,6 +147,47 @@ char *memdup(const void *src, size_t len); unsigned long ustrtoul(const char *cp, char **endp, unsigned int base); unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base); +/** + * strreplace() - Replace all occurrences of a character in a string + * @str: The string to operate on + * @old: The character being replaced + * @new: The character @old is replaced with + * + * Replaces all occurrences of character @old with character @new in + * the string @str in place. + * + * Return: pointer to the string @str itself + */ +char *strreplace(char *str, char old, char new); + +/** + * strtomem_pad - Copy string to fixed-size buffer with padding + * @dest: Destination buffer (must be an array, not a pointer) + * @src: Source string + * @pad: Padding character to fill remaining space + * + * Copy @src to @dest, truncating if necessary. If @src is shorter + * than @dest, fill the remaining bytes with @pad. + */ +#define strtomem_pad(dest, src, pad) do { \ + size_t _len = strlen(src); \ + if (_len >= sizeof(dest)) \ + _len = sizeof(dest); \ + memcpy(dest, src, _len); \ + if (_len < sizeof(dest)) \ + memset((char *)(dest) + _len, (pad), \ + sizeof(dest) - _len); \ +} while (0) + +/** + * strscpy_pad - Copy string to fixed-size buffer with padding + * @dest: Destination buffer (must be an array) + * @src: Source string + * + * Copy @src to @dest ensuring null termination and zero-padding. + */ +#define strscpy_pad(dest, src) strncpy(dest, src, sizeof(dest)) + #ifdef __cplusplus } #endif diff --git a/lib/string.c b/lib/string.c index d56f88d4a84..e297eb99df1 100644 --- a/lib/string.c +++ b/lib/string.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -802,3 +803,27 @@ void *memchr_inv(const void *start, int c, size_t bytes) return check_bytes8(start, value, bytes % 8); } #endif + +char *strreplace(char *str, char old, char new) +{ + char *s = str; + + while (*s) { + if (*s == old) + *s = new; + s++; + } + return str; +} + +char *kmemdup_nul(const char *s, size_t len, gfp_t gfp) +{ + char *buf; + + buf = kmalloc(len + 1, gfp); + if (buf) { + memcpy(buf, s, len); + buf[len] = '\0'; + } + return buf; +} From patchwork Wed Jan 14 22:56:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1518 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=1768431517; bh=cq7Y+rH51pvwNBUyWOtBU2HqZFcZCfay74TzPtGe06U=; 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=ExC6hTP563bMVddhf4P06A7RTzcXuQTAT2Q7mQVOKiuiUfi254hkTdM7W6KvFgTSJ JAjMhwzECJRvJdMRVVrDWZbSV3Fnf6Jdr1M05vT//d09kE1AkwZz51U0Y10KZoBX6A I7PASQJNLN2EIcPal46oHTuyGdkreAZ5MAnG27akwYTZ6HqqZaO+7BJQJ8Z+5583no 3yfzew8QgISB0eCs/R4HgPbYd7CESUppDhlDMgwkXeB3AwzWrUAKsrRzlr9CZJdPok eR1VXEEiry42AOHq7Svuj8yL0sU/SB6ubbE15DkmdcG/DMfGjp9J4mA3y/RnL5BZzf U0Q72AzDaWN+g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5BB9A6913F for ; Wed, 14 Jan 2026 15:58: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 10024) with ESMTP id a0R31mrXGnrC for ; Wed, 14 Jan 2026 15:58:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431517; bh=cq7Y+rH51pvwNBUyWOtBU2HqZFcZCfay74TzPtGe06U=; 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=ExC6hTP563bMVddhf4P06A7RTzcXuQTAT2Q7mQVOKiuiUfi254hkTdM7W6KvFgTSJ JAjMhwzECJRvJdMRVVrDWZbSV3Fnf6Jdr1M05vT//d09kE1AkwZz51U0Y10KZoBX6A I7PASQJNLN2EIcPal46oHTuyGdkreAZ5MAnG27akwYTZ6HqqZaO+7BJQJ8Z+5583no 3yfzew8QgISB0eCs/R4HgPbYd7CESUppDhlDMgwkXeB3AwzWrUAKsrRzlr9CZJdPok eR1VXEEiry42AOHq7Svuj8yL0sU/SB6ubbE15DkmdcG/DMfGjp9J4mA3y/RnL5BZzf U0Q72AzDaWN+g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 47BF06934D for ; Wed, 14 Jan 2026 15:58:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431515; bh=sEdS9/AgoHuhfLdx3W3xA58f+aYF24SxFu3qXPVmH7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h5P52s1Nea91EXncJFL0U+rHUN//X8e+/gYXbUNVx+IJjqD9yr3inIwvZYKCAGan1 szZ99gdccO3zR4nVHzJhTljGIE2Q9A3eKk3nTnG8c8NbZb5U4WNe5CUx2vtefVj3kC NhcWGf2g/eKyu7nDU1X66B/3aLjkH3U3XIDf+F3VJy7+b6AfF3TbDtXK5SG/A/8YW2 mk9tjy2lTQhsH1OcacSaWsXvn/rYMwzxgdhfT5Xd9zu8roBZJ08dx4SfFna6XhNVwx pDaMP9nZ9ExOfBPbip+p76C0GUJ6vwKVDoDJSLu1SeqCW+GJTx2Zuvi97VaZtzc1O9 4BSi9Z/Mj2trw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 69E706913F; Wed, 14 Jan 2026 15:58:35 -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 Zk76Gfs1Cxlv; Wed, 14 Jan 2026 15:58:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431511; bh=o4Ptv2/oXBtvAptov+sOM+SCrFBkInV2453yiBTYytI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wpvwil7xqjc7nnHLf4xtrDJiQXFWTk9IL9tRgV2Vmpef80ZvISPdCs5rbEDnOGjGO Kl1G0ddBFOr3XQou5ucpIq5SmK3c6HUcO5TYTwzca5rUgUCAPcGCkXitmqRdDVHV6u jNyJWhMIm1Hq0zUiKUigsTvNCOkS0bPpzdG4bUDw+wvPH+T9b+QegP/3rhgPz3D5wQ UM0fxaip93EvfWVitndw7OM61MGToLh0RKoCiMl+oVSjxC4s7qzTz9uM3V72oTcezX IMzN0VVXTSYwEpeW//n1oPv6CLIUnwEhVQPqqwjYrg2WhszON/2H9vdaUnw3RdNDc+ zVyhjKQcJtqvg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1AF9D692EF; Wed, 14 Jan 2026 15:58:31 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:14 -0700 Message-ID: <20260114225635.3407989-25-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: L7NOHG5H7MDGSJYUCCAGKTTO5UFLQHWQ X-Message-ID-Hash: L7NOHG5H7MDGSJYUCCAGKTTO5UFLQHWQ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 24/34] ext4l: Move FMODE hash flags 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 FMODE_32BITHASH and FMODE_64BITHASH flags from ext4_uboot.h to linux/fs.h where they belong alongside other file mode flags. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 +--- include/linux/fs.h | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 7b90276b2bc..4b342089489 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -173,9 +173,7 @@ typedef unsigned long pgoff_t; #define PAGE_SHIFT 12 #endif -/* File mode flags */ -#define FMODE_32BITHASH 0x00000001 -#define FMODE_64BITHASH 0x00000002 +/* FMODE_32BITHASH, FMODE_64BITHASH are in linux/fs.h */ /* struct file is defined in linux/fs.h */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 241711eded1..049033c0cd7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -36,6 +36,10 @@ typedef unsigned int fmode_t; #define FMODE_CAN_ODIRECT ((__force fmode_t)(1 << 21)) #define FMODE_CAN_ATOMIC_WRITE ((__force fmode_t)(1 << 22)) +/* Directory file mode flags - use low bits for hash mode */ +#define FMODE_32BITHASH ((__force fmode_t)0x00000001) +#define FMODE_64BITHASH ((__force fmode_t)0x00000002) + /* Seek constants */ #ifndef SEEK_HOLE #define SEEK_HOLE 4 From patchwork Wed Jan 14 22:56:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1519 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=1768431521; bh=qI70Qs8hmtr1o1WRFf3joZYyp4DRrBoaAwrESdxl2wk=; 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=Az48Bm8HGhvkK2KWe8ZRCU1XMqFfZ7fzrHwcGAPYgGBcMt4SeIqxeBGzqLUDbqZ5k xoZI3efRRfI82b2k7GRi6zU5c2nJYIYCbbcDOSvGbX08t/CuEpPduJr2uUpJJD0Af+ 8Ed5AZZKvOE2B7+0EV76ZbmVN9CnMs7U7g+aoo/Han4fvWmzgu76DkYwbdlIWL5HK3 xE7LvKHWOyAnJsAz0bggp1xMN1cA4VJtZ5TsKj8l/0fiQmhla4Udw5vgUk8jgkzOto LyedVZV5uTnDna4xxJNBYkcf01ksRoBSvwlcMccNdO7oT+bOQWwKlXLeZswkqw9edr ItumDWrtPegLQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C5A0069360 for ; Wed, 14 Jan 2026 15:58: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 10024) with ESMTP id R_Bw0tzqFDlS for ; Wed, 14 Jan 2026 15:58:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431521; bh=qI70Qs8hmtr1o1WRFf3joZYyp4DRrBoaAwrESdxl2wk=; 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=Az48Bm8HGhvkK2KWe8ZRCU1XMqFfZ7fzrHwcGAPYgGBcMt4SeIqxeBGzqLUDbqZ5k xoZI3efRRfI82b2k7GRi6zU5c2nJYIYCbbcDOSvGbX08t/CuEpPduJr2uUpJJD0Af+ 8Ed5AZZKvOE2B7+0EV76ZbmVN9CnMs7U7g+aoo/Han4fvWmzgu76DkYwbdlIWL5HK3 xE7LvKHWOyAnJsAz0bggp1xMN1cA4VJtZ5TsKj8l/0fiQmhla4Udw5vgUk8jgkzOto LyedVZV5uTnDna4xxJNBYkcf01ksRoBSvwlcMccNdO7oT+bOQWwKlXLeZswkqw9edr ItumDWrtPegLQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B4F026934D for ; Wed, 14 Jan 2026 15:58:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431520; bh=Sy6jh+y7PsgcM79R5aEcg+uSn/r+azI5XMJAKRWnrHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cBObL+B6/CdjmnK4FUv+VUHnDaveko+0AZrWS7eY0ljwqtw0gq7bwUAcHlN9RVk5q 19laf6+o7GNaeK7z0sweLXCt04QvdMHhaHH3LuAZEXfrxD3GT/2dY4LRI475WaS5/p 6n54QPZnVMdGuwaQd2KBGGjkD7n5b06avcujhYogz3QTtfeyEKq4Wo5hFoMNYarWJn wxV7+TqChWJLm3ES0ykSY6Dgc+GXKy3dCMMGX/4pHr3/4cDNDIfdzZ2dj04ecnJht5 elpWHhhLO9oHvaJMyiDZpEe5SpNIiUNvsDipwXGG2+DAL5lNAAGet/N2qkZ45SghaP rB0kqk4aHATRQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 166436913F; Wed, 14 Jan 2026 15:58:40 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id rWSyVICmCvYh; Wed, 14 Jan 2026 15:58:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431516; bh=+4L6qWPc/0T0pGsIh3HasoWt2IDe39CXwEUyXuqJWm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OnBLWZDUaCJUPFYH8HaDeo5cOEaghQ/Rr47Uqh6c4X5HwK+iaUzGUju7Y1jsPQhh4 yCEt6hNJdx4nrUvJk7EGg+HbKu27hhBfO1kIKrR2OpY/ayyfnr3dNXKysuHrhkQCMW D3Kw4aXmth5CXGPG0lrLf8jgOg8/f+U+LLjMCQODuyiVUBm9O5a4Sfx0BgCLQvcDYX qFE6jQYWx6DjQTshP28ygfwPNGUUBSDpxnfmHYiDpl1QAO1vQ4YLdyq/ICJa9P3T4u jSM3+G3/Vqm8DjpbKQVwv8c16SmQasgonslnOMgOtezd2x5+avrxYrgTZi9Y64t7qj xTz0GQwN1b4CA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AEDDB692EF; Wed, 14 Jan 2026 15:58:35 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:15 -0700 Message-ID: <20260114225635.3407989-26-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WQXGQG3UJ5HXCEUXVVCAJU4XNM6PENWD X-Message-ID-Hash: WQXGQG3UJ5HXCEUXVVCAJU4XNM6PENWD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 25/34] ext4l: Move struct dir_context to linux/fs.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the directory iteration types and helpers from ext4_uboot.h to linux/fs.h where they belong as part of the VFS interface: - struct dir_context: context for directory iteration - filldir_t: callback type for directory entry emission - dir_emit(): helper to emit a directory entry - dir_relax_shared(): lock relaxation macro (no-op in U-Boot) This makes these types available for other filesystem implementations. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 17 ++--------------- include/linux/fs.h | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4b342089489..4cb9b23a8c7 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -198,14 +198,7 @@ struct kiocb { /* __counted_by attribute - not available in U-Boot */ #define __counted_by(x) -/* dir_context for directory iteration */ -struct dir_context; -typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64, unsigned); - -struct dir_context { - filldir_t actor; - loff_t pos; -}; +/* dir_context, filldir_t are in linux/fs.h */ /* iomap types and structs are in linux/iomap.h */ @@ -1545,13 +1538,7 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); #define inode_eq_iversion(i, v) ({ (void)(i); (void)(v); 1; }) #define inode_query_iversion(i) ({ (void)(i); 0ULL; }) -/* Directory context operations - call the actor callback */ -static inline bool dir_emit(struct dir_context *ctx, const char *name, int len, - u64 ino, unsigned int type) -{ - return ctx->actor(ctx, name, len, ctx->pos, ino, type) == 0; -} -#define dir_relax_shared(i) ({ (void)(i); 1; }) +/* dir_emit, dir_relax_shared are in linux/fs.h */ /* File llseek */ #define generic_file_llseek_size(f, o, w, m, e) ({ (void)(f); (void)(o); (void)(w); (void)(m); (void)(e); 0LL; }) diff --git a/include/linux/fs.h b/include/linux/fs.h index 049033c0cd7..af9cf21692b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -173,4 +173,23 @@ static inline void inode_init_once(struct inode *inode) /* S_ISDIR, etc. - already in linux/stat.h */ #include +/* Directory context for readdir iteration */ +struct dir_context; +typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, + u64, unsigned); + +struct dir_context { + filldir_t actor; + loff_t pos; +}; + +/* dir_emit - emit a directory entry to the context callback */ +static inline bool dir_emit(struct dir_context *ctx, const char *name, int len, + u64 ino, unsigned int type) +{ + return ctx->actor(ctx, name, len, ctx->pos, ino, type) == 0; +} + +#define dir_relax_shared(i) ({ (void)(i); 1; }) + #endif /* _LINUX_FS_H */ From patchwork Wed Jan 14 22:56:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1520 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=1768431527; bh=y/vOvhS6NOyyyYQV/02hiyGhAW3eYj9l5CMcE+P7P+o=; 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=AfeuO6jZnGw67tggFYb2Cp2iA+opBhvAcoL8EHbklkh+P1J1F4DkZ3Jl193d5iHg3 5xPbRDDQDpC4OSKaZRICsC2WeK6drqugSqXF0mu/PlBHbrMlGrQinGCtQv8p0WFk3c HQfhFlnrjNZKkFfG2ak+CqMUqMGrkkimDNJUJ8wQYd0L5odSTv/tuwgEsagqz7yDrj dPOeos/eSrtUjwAhtl9j6UF4kbEwXUjxIdNdTOYDwnF4c0RGz+LSdnSoP1t+X6FULG weTAZSwVVrHeChFNlD2mJTvwi50Ya3tyYydGc3TFqI7bde92syW+HXjfKgBSZGgDJu rfgIrSl9vdWfw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5097B6913F for ; Wed, 14 Jan 2026 15:58:47 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id XMPxEYnPwklp for ; Wed, 14 Jan 2026 15:58:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431527; bh=y/vOvhS6NOyyyYQV/02hiyGhAW3eYj9l5CMcE+P7P+o=; 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=AfeuO6jZnGw67tggFYb2Cp2iA+opBhvAcoL8EHbklkh+P1J1F4DkZ3Jl193d5iHg3 5xPbRDDQDpC4OSKaZRICsC2WeK6drqugSqXF0mu/PlBHbrMlGrQinGCtQv8p0WFk3c HQfhFlnrjNZKkFfG2ak+CqMUqMGrkkimDNJUJ8wQYd0L5odSTv/tuwgEsagqz7yDrj dPOeos/eSrtUjwAhtl9j6UF4kbEwXUjxIdNdTOYDwnF4c0RGz+LSdnSoP1t+X6FULG weTAZSwVVrHeChFNlD2mJTvwi50Ya3tyYydGc3TFqI7bde92syW+HXjfKgBSZGgDJu rfgIrSl9vdWfw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E12B6934D for ; Wed, 14 Jan 2026 15:58:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431524; bh=pdMoN1oK/WT+sEKNwPHveNWKDLxZ4q6tpSEu9s5R0og=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nsx0PNyjFRpW8/r5z49Gfmwg67CPMZV7YcymwZ30B+FrExOrGDL+5/5DwwYZ13Vf4 h3uoCs889qhiy4ClAJBrEF4D/JByLfVyeflap9weBSj2xQ+IgZ2VaNhRUElrccYsU5 Y3vhhfdWjGgfBK9KhthoxYMeLMaXh2Ph8/ZOEUbDjeddNLoSche4mI0+DDNpv/TrtC QsHuiyblmvwwTibos2XNU7ftKViesI+BY62I5NNkzXBR5hDSxcb9RrxPXIq+wkYswb uoqipW785eRT9XhJnj1Nm7+o0nImpJQe3YTdQxtWm/1QMb90o+k3iDHEoTUzA4rbod qYBfdN199aOSA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A3EF26913F; Wed, 14 Jan 2026 15:58:44 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ibvM9GV-nmBR; Wed, 14 Jan 2026 15:58:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431520; bh=eHMXn7LPdZiee45ZX/wXl1sJK8kjz21c3Pkfmi8wMQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T7uuEYxbB0UTcuY/+7ghvJRnUa7wPQFV0chNPdk+BKb0K5rCU5ObvjtuJgC5o3qb6 w/lKMwwW3U0nvnnq2zHsCioZT3uuN953Vf6OjZB9Y8AWa9KkpIvwefvDZwDXuZ/AUy ybQgNYJ4EQDrteDSR30L5lsUMkTc3Dg0Vf5WuzOLtgvU+P81ikE/zSAFheA4R20p5g sdYBWbuPeBVEc12GhJ8k3h1ReA8bQcK5R6QHC2AXhPGXHmnY1aL5xnTmCG5+bumyA3 FxTVmsHupg0nqeFOtAiHgZifxX6slHXZ4eYVYCyoGui+XXw+cbNgknqDktFxBwe/tG Ihy0ddGOn67AQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5948A692EF; Wed, 14 Jan 2026 15:58:40 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:16 -0700 Message-ID: <20260114225635.3407989-27-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NPKIAO4RADYHQSJ7OCWVOMEUK7VY5ZAB X-Message-ID-Hash: NPKIAO4RADYHQSJ7OCWVOMEUK7VY5ZAB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 26/34] ext4l: Move pgoff_t to linux/types.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move pgoff_t (page cache offset type) from ext4_uboot.h to linux/types.h where it belongs alongside other fundamental Linux types like sector_t and blkcnt_t. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 +-- include/linux/types.h | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4cb9b23a8c7..08d28fd01ad 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -167,8 +167,7 @@ struct kobject { /* Forward declarations (struct inode, struct address_space) are in linux/fs.h */ -/* Page types */ -typedef unsigned long pgoff_t; +/* pgoff_t is in linux/types.h */ #ifndef PAGE_SHIFT #define PAGE_SHIFT 12 #endif diff --git a/include/linux/types.h b/include/linux/types.h index 957284d37ab..5255eecd407 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -165,6 +165,9 @@ typedef s64 ktime_t; typedef u64 sector_t; typedef u64 blkcnt_t; +/* Page cache offset type */ +typedef unsigned long pgoff_t; + #ifdef __linux__ struct ustat { __kernel_daddr_t f_tfree; From patchwork Wed Jan 14 22:56:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1521 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=1768431531; bh=RdNCnjNutikt1YcB8EJ4nh6aUkl0z7d1nvZu+lAl25M=; 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=PEHs1wJXCSIKBzXJfWkGt7ky/qLFyaHIxezWaD2RWeOs/bF8puUZxNmEt3HnU1bNl ZC/n8xIbHt3gudcsd86r1p9c3RI3VkE5dL0UWt3zbotbBZ7sxAlX8M+1+4lto6oZlC VQcQgayWQgQ5kLw9SMo/Ref65dsoPSNDSM+4++b5yoW3LfTL6VxytyLERGdygWY8gA s7zQ2kL33wqXup0sR4NbKvbLZSC+ehWCgKwP/UaYK+XDLRMg0/lh4QF5oc/9ZT4ciM MOvH4wMcjSckucSsH+abinb/J06clxopDFaN3HlzIKwEMa/xmGPTIlCauRW3q+UiAH izj74O1/bkLaw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C94F469360 for ; Wed, 14 Jan 2026 15:58:51 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7siN8TO9UNvm for ; Wed, 14 Jan 2026 15:58:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431531; bh=RdNCnjNutikt1YcB8EJ4nh6aUkl0z7d1nvZu+lAl25M=; 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=PEHs1wJXCSIKBzXJfWkGt7ky/qLFyaHIxezWaD2RWeOs/bF8puUZxNmEt3HnU1bNl ZC/n8xIbHt3gudcsd86r1p9c3RI3VkE5dL0UWt3zbotbBZ7sxAlX8M+1+4lto6oZlC VQcQgayWQgQ5kLw9SMo/Ref65dsoPSNDSM+4++b5yoW3LfTL6VxytyLERGdygWY8gA s7zQ2kL33wqXup0sR4NbKvbLZSC+ehWCgKwP/UaYK+XDLRMg0/lh4QF5oc/9ZT4ciM MOvH4wMcjSckucSsH+abinb/J06clxopDFaN3HlzIKwEMa/xmGPTIlCauRW3q+UiAH izj74O1/bkLaw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B90566934D for ; Wed, 14 Jan 2026 15:58:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431529; bh=ULQrK4LlxmjKazAH9ABlAuC6Yi7GJotcpXKOM9TwLlc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eXMoePPr70cRyTeVJdqyDYk+sjvgFX/LhuuWQwejPmRGR5s2N+wRePgWRdFqlZu8A j2El5Jyq90Lejt+rrjWetqftPWz4dyigkIJ2NNesXNsZ/ilycsCtkWQvCkbGHoZbq6 9ULU63jv/7ezHovNfS2KlWFUc/Jzrh3qMyaGDfVi/4R+uhdtj1oh66sw/cx7IS4v+E kyFjpRwlPXIw7EZvkRKVpbRl8Avt3sud0dthTlu3xGrSnloSwXx//W70TEBKRoUnnj o5Xgn4bjY+HMQj+1XVcRhrPJEHTgBLYx+jrp3IasdDNBwUu1R5SAHntYX7kYFU8ieZ Zj3JAdlaPvKVw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BA40A6934D; Wed, 14 Jan 2026 15:58:49 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 6GsQ-weoOJR0; Wed, 14 Jan 2026 15:58:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431525; bh=m3qExGfzGGhdy4BNgurCAgtDqe3tuhfYRmX9QQQ21nw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uqhecy70FMc0q9NnNz2e3++Qe35NTzq8iV4iYoyowub8uKVjw2EVibUscXav/T+G7 /P1Y+wzimQmbe6Gce0x188ID4sp8fVrfzjJgHzRWBjKdWqHwy8ANWiMtBCtibhhoMM dHmz8gT3ueFWYYxR7PL2ZILadPJWplurz5rCDN3SuKQiI3Uv4sXCjvpmrTDoFB9swT 01ouF4V2cSaNjDIagG1lWkSImsPUemICMQpd5dvfjS/RroKwqsRG4PVKfaGTus78Pk tcjE3+wBUxMXXUAcgrp7LZlxlpknqpffXHG7HcUqF2VFsF56FBg3KpYXXPsMHecQ15 Y+n83U74nLTQw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E8862692EF; Wed, 14 Jan 2026 15:58:44 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:17 -0700 Message-ID: <20260114225635.3407989-28-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VIRAQYLUB5ACP74K27RG4CBTTJ5E5VYT X-Message-ID-Hash: VIRAQYLUB5ACP74K27RG4CBTTJ5E5VYT X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 27/34] ext4l: Use linux/blk_types.h for blk_opf_t 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 Use the existing linux/blk_types.h header for blk_opf_t instead of defining it locally in ext4_uboot.h. This avoids duplication and uses the proper __bitwise annotation for type safety. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 08d28fd01ad..68acbd489f4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -78,10 +78,12 @@ * atomic_t, atomic64_t are now in asm-generic/atomic.h * MAX_JIFFY_OFFSET is now in linux/jiffies.h * BDEVNAME_SIZE is now in linux/blkdev.h + * blk_opf_t is now in linux/blk_types.h */ #include #include #include +#include /* atomic_dec_if_positive, atomic_add_unless, etc. are now in asm-generic/atomic.h */ @@ -507,8 +509,7 @@ struct folio; /* qsize_t - quota size type */ typedef long long qsize_t; -/* blk_opf_t - block operation flags */ -typedef unsigned int blk_opf_t; +/* blk_opf_t is in linux/blk_types.h */ /* bh_end_io_t and struct buffer_head are in linux/buffer_head.h */ From patchwork Wed Jan 14 22:56:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1522 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=1768431533; bh=UTjHPJDmexrsRAHY+pgFaJHXvbJ3FKsag35on+nh19s=; 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=cdw0Z4RLhUdTkDzW0/D91BfyUmOYKP+WmT25hbRJdy5v8jfqqrkORuiILWZ1XS5+F Pbu3LqiPMpozTAEFQuJi8/8BA7Z0gSQFFGIIugz3ob0To7/0iTRrzTwS9vcjw1sjcS yQU7HB4v6yTMUKsvjopXYS/8XCkeOmcaR+zEbafCq2SMLCj0GhhVbp4YLdLjK+rHQn wddYFthbeV7lpJwCrIrSVmKJctM/hVDOAKz3BpiiZzL9kwzi+xtTbEaRNsOfswm6lU oQVlyNWIL5dFO+WVute+68U01/Iu64NpsuFjdtjqXLYHOwuWihVJv6TV/jRUHTmc09 pqBHJv9rl2TGA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4406669360 for ; Wed, 14 Jan 2026 15:58:53 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ZJLLjChWW0x5 for ; Wed, 14 Jan 2026 15:58:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431532; bh=UTjHPJDmexrsRAHY+pgFaJHXvbJ3FKsag35on+nh19s=; 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=wExm6MNZk4/mMBEYB7agGR9iLN5gyJxUWUBsZNtwjZGDbLkD7ae67sj+d0pWW+LEC WAaSFdhbMgQT0Xz/4GFky4bwp4Nftfezul1SMO6YSS704mtvqlIZRnNkMOd2k0AM5D 0aEa2yXXKRKcxYeQXV+NUxz09unuW2FXjLZBu7Yd9E+sbWDxGnrToX2IJZtVpnc6Bk PA4VjAE1rvLHsWIZZGpmnQ14DNCTOy0noCnmoKajXOi5Qtah6GLMVMrbfcyVktuL5M 60yrKFawYXE1xSsppRBpaeIwjWNej7DEh28UMTO7+3gXDy6SF4Qpr727cOB1HlR6Y6 4KIipeiNs+KNg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C886A69361 for ; Wed, 14 Jan 2026 15:58:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431530; bh=/L3GW3CpBfpg40e+qMu4Hbv8hhRFSGRku4br1mqVkl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FVKIQyrSBoXO8PfdOVtxGOynw49bCWRswaLGlmfC5zzA4qgkF+Aqy6HoQvqdgDqS8 FOMbYNiau/cnwvc5FwVh06rTDKw6hZafT8Q/+uPy/CL25R1PzaGznU9vRDWtw7p985 qRYydEGdQeDluDjnPZZ5H38/b9Bp73VM488W0Gptmrr8CDciFOfZkhj4bllSE5i8Uv iDZAv0X96QFbg08YVP5wR1xu6S2tDuMH8O1QynaLNtZpVoqcZWrVcjTRjMyzwKRDcO Q6P3eryioe7neQKjgT+wE4BNEUACJ5xuFxlg6NbJHrDaAMTX+DLti89DJaIG0uU5xz Vs9WglBEW1LwA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0BE68692EF; Wed, 14 Jan 2026 15:58: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 U17EdrYf_kg8; Wed, 14 Jan 2026 15:58:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431529; bh=bWA5YWKpow3p5atJjaaN4Zl2qzoN0XD+I6ZdGt/AJUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qXeqDQdTfpypnOKqN8YhpJMO0qZ8jHS+qiISM2atGgfo3VDSKninjuyKsuhxGG9lT bcoU3uJccVN+AnpLjiI1+ouMjRBQBJjOrH5LsC7OJhvIoq4e5nL1EKqP9NjyfURZfx gPpDhXzQlO3gmE2OWmeWnx9lV/7Nma4TNruV8sttl0Mislv+ie7l54kB8KBPPQZDjB I1RhYAEkH7442/mLQzjuGQcbjtv5NPWN2kxNFS5gt+shD2NXl6r8Z3oXOfujXs41Za hUE8Uo9wOlAVObHkjqwngFqj/uddNmv1YwuBbb5aPmDSSnPAsmTielDrWuzJVE100o tl90RS2A6Jy+g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 813266913F; Wed, 14 Jan 2026 15:58:49 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:18 -0700 Message-ID: <20260114225635.3407989-29-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JCHEJIJ7A767IPZFU5EMRSBDAQUQTRLQ X-Message-ID-Hash: JCHEJIJ7A767IPZFU5EMRSBDAQUQTRLQ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 28/34] ext4l: Move DT_* directory entry types to linux/fs.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the DT_* directory entry type constants from ext4_uboot.h to linux/fs.h where they belong alongside struct dir_context and other directory-related definitions. This includes: DT_UNKNOWN, DT_FIFO, DT_CHR, DT_DIR, DT_BLK, DT_REG, DT_LNK, DT_SOCK and DT_WHT Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 11 +---------- include/linux/fs.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 68acbd489f4..cc0cb48fc24 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -513,16 +513,7 @@ typedef long long qsize_t; /* bh_end_io_t and struct buffer_head are in linux/buffer_head.h */ -/* Directory entry types */ -#define DT_UNKNOWN 0 -#define DT_FIFO 1 -#define DT_CHR 2 -#define DT_DIR 4 -#define DT_BLK 6 -#define DT_REG 8 -#define DT_LNK 10 -#define DT_SOCK 12 -#define DT_WHT 14 +/* DT_* directory entry types are in linux/fs.h */ /* mnt_idmap - stub */ struct mnt_idmap { diff --git a/include/linux/fs.h b/include/linux/fs.h index af9cf21692b..7963e931fad 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -173,6 +173,17 @@ static inline void inode_init_once(struct inode *inode) /* S_ISDIR, etc. - already in linux/stat.h */ #include +/* Directory entry types */ +#define DT_UNKNOWN 0 +#define DT_FIFO 1 +#define DT_CHR 2 +#define DT_DIR 4 +#define DT_BLK 6 +#define DT_REG 8 +#define DT_LNK 10 +#define DT_SOCK 12 +#define DT_WHT 14 + /* Directory context for readdir iteration */ struct dir_context; typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, From patchwork Wed Jan 14 22:56:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1523 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=1768431537; bh=eTlTSc9oCVC9OiS0yu+FI8QeKKmBJL3ohMJKjnHJhUM=; 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=HRvGfzmC0aQY3LJ3oWSwBl96LM8bP4IzSAvFh4QVmEbn7lwDsrKqZPVKBbLPYYOzc SR62rpXOYAHq7Al9p3hGIlvsGDwaC3OeEvJJFGmFN7tkUNXQw9oqdIQ70RkaFzHGuN 5cHsaKfsYPh2GprNZ4zXTxfM0FHM7t0TiRWeNOd/3peSxM3dhlTIXCjrazDoh9Fzbq Chxa/iXeEhpoKJ0M256Rvwj9NCi0mgCEuocGTcHcYBdSg7UrfIctBIUxnC6SCLqRSa QEM70yZ+PgtJsOWpE5N5FnEE13mJScK6rjaPd8yGDTgsKf7BgKWYftvLZgzpoYpJBZ L0UJkLNvZrYCg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 711B069360 for ; Wed, 14 Jan 2026 15:58: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 ixBs7nbCvWKV for ; Wed, 14 Jan 2026 15:58:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431537; bh=eTlTSc9oCVC9OiS0yu+FI8QeKKmBJL3ohMJKjnHJhUM=; 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=HRvGfzmC0aQY3LJ3oWSwBl96LM8bP4IzSAvFh4QVmEbn7lwDsrKqZPVKBbLPYYOzc SR62rpXOYAHq7Al9p3hGIlvsGDwaC3OeEvJJFGmFN7tkUNXQw9oqdIQ70RkaFzHGuN 5cHsaKfsYPh2GprNZ4zXTxfM0FHM7t0TiRWeNOd/3peSxM3dhlTIXCjrazDoh9Fzbq Chxa/iXeEhpoKJ0M256Rvwj9NCi0mgCEuocGTcHcYBdSg7UrfIctBIUxnC6SCLqRSa QEM70yZ+PgtJsOWpE5N5FnEE13mJScK6rjaPd8yGDTgsKf7BgKWYftvLZgzpoYpJBZ L0UJkLNvZrYCg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 602F7692EF for ; Wed, 14 Jan 2026 15:58:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431535; bh=jTcgBaVQch5maFvaIFh4qplYOUeFHhUBBT+w88gIpA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ggazi0KJoEtIA+MJ08+gn7BHt8q4dcUoKcpPf7sIDEkek3kCtWrQ9F9ZvDag4z5zc Tf7eAQfT5KxV+Cl1FS/ywn3OkYPXa8FJTRKyIA8OdSWclMnk1vuYggdZJNBuR5L/oV Ho28btj7i/wLMtNJ1xx1WRwB4SNI8BBTKLC+QuJ26qQfe7W1G5C2Bu0okYIbXqjn8C l8Qj9Uwi/874ADsrS8j7eTo/Gy5VHuzjNv5W6o26hfJmDAmR+DmB6DMACHJBsY2dkl TVUyCJoRQFj4/2pOx4prfJzNHC5mTRhDJvMTRmWjwld6Ui0wSTNPZbKQ0eSEZ6/3Dg 6qKBKONmk9sTA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9143D692EF; Wed, 14 Jan 2026 15:58:55 -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 EsXRt01TpIUp; Wed, 14 Jan 2026 15:58:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431530; bh=xJ8Pg1Z7ai56kPo3XgsSeHet3BDDP+1YQvEn23H9ywA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gagKvmysvnR0hXHoMomRNzmTqL+kst1vYMSSDAMwAhIjEEDAgeHwWkrr+zL52R2ey Q6ct95hkSqJvZNoo+Ps5F80ZtPro7cxRuT0jJX/5UNOtCyQB+shmiODKL0ddPaWN25 q/SLCxhMxve8xf+EyGNjPTrccBNM0VgvAchiuz5s7NRZOW3D2LBd+KISz9PH+wuJus REW79aZKEfIvAHPbOBm08cSc3Q+0/euLWILa7qM+TaM3WIkkUOAkkdxXhXrk8Gd2h8 s9iKvMXqrdGolshpzKJXlHudzCe9kexNi4WyKmH9KDZyiC733VhmLX7hUIOaXBCJde B9dU1GPMCPtvg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 50FCA6913F; Wed, 14 Jan 2026 15:58:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:19 -0700 Message-ID: <20260114225635.3407989-30-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RSEUEJCZU3O554BA5DURRJO6IKVS2QJK X-Message-ID-Hash: RSEUEJCZU3O554BA5DURRJO6IKVS2QJK X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 29/34] ext4l: Move S_* inode flags to linux/fs.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the inode attribute flags (S_SYNC, S_NOATIME, S_APPEND, S_IMMUTABLE, S_DAX, S_DIRSYNC, S_ENCRYPTED, S_CASEFOLD, S_VERITY) and the permission constant S_IRWXUGO from ext4_uboot.h to linux/fs.h where they belong alongside other filesystem definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 15 ++------------- include/linux/fs.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index cc0cb48fc24..2ed5a5d4984 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -589,19 +589,8 @@ static inline int bdev_read_only(struct block_device *bdev) #define I_FREEING (1 << 1) #define I_DIRTY_DATASYNC (1 << 2) -/* Inode flags for i_flags */ -#define S_SYNC 1 -#define S_NOATIME 2 -#define S_APPEND 4 -#define S_IMMUTABLE 8 -#define S_DAX 16 -#define S_DIRSYNC 32 -#define S_ENCRYPTED 64 -#define S_CASEFOLD 128 -#define S_VERITY 256 - -/* Permission mode constants */ -#define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) +/* S_SYNC, S_NOATIME, etc. inode flags are in linux/fs.h */ +/* S_IRWXUGO is in linux/fs.h */ /* Whiteout mode for overlayfs */ #define WHITEOUT_DEV 0 diff --git a/include/linux/fs.h b/include/linux/fs.h index 7963e931fad..2b05c39e88a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -173,6 +173,20 @@ static inline void inode_init_once(struct inode *inode) /* S_ISDIR, etc. - already in linux/stat.h */ #include +/* Inode flags for i_flags field */ +#define S_SYNC 1 /* Synchronous writes */ +#define S_NOATIME 2 /* No access time updates */ +#define S_APPEND 4 /* Append only */ +#define S_IMMUTABLE 8 /* Immutable file */ +#define S_DAX 16 /* Direct access */ +#define S_DIRSYNC 32 /* Directory sync */ +#define S_ENCRYPTED 64 /* Encrypted */ +#define S_CASEFOLD 128 /* Case-folded */ +#define S_VERITY 256 /* Verity enabled */ + +/* Permission mode constants */ +#define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) + /* Directory entry types */ #define DT_UNKNOWN 0 #define DT_FIFO 1 From patchwork Wed Jan 14 22:56:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1524 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=1768431541; bh=g8eCHXcEL37jzt/zEI4G2N5wxSARTPNsqbfqWVSSt44=; 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=ZLJDJLD0xY9sUVIAIbnIx3jkdw7TMz1WVuEZJJfiiR9251FPLop/Drblyh5QSSz2g ypfZxm9QLHOgyA7CDq2/AsAsYqmrj/XkBM0dEbBIAVwDITXqWpMDrMalFwukgi/1xN 9TuReVrCpmuDAVlpOy38dvZH7QxIb5+BBaaHW48OM8UccscD+v8SAJ20SePFvg0VTO sCwmwz63vxuoE18kiMCe7z0AHTyibUjmANbCZROori3T678YKH9ODtcSR4YsEnOuIB I+UQ3R0Q+qWIzWDf0veh9QPNnSYHLfnlxsYtICbFb/87wIRIpmTBw4hUya3zcOregc uG1CQp0JNQ4Pw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE1F26934D for ; Wed, 14 Jan 2026 15:59:01 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id BxgZQGFhUJkK for ; Wed, 14 Jan 2026 15:59:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431541; bh=g8eCHXcEL37jzt/zEI4G2N5wxSARTPNsqbfqWVSSt44=; 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=ZLJDJLD0xY9sUVIAIbnIx3jkdw7TMz1WVuEZJJfiiR9251FPLop/Drblyh5QSSz2g ypfZxm9QLHOgyA7CDq2/AsAsYqmrj/XkBM0dEbBIAVwDITXqWpMDrMalFwukgi/1xN 9TuReVrCpmuDAVlpOy38dvZH7QxIb5+BBaaHW48OM8UccscD+v8SAJ20SePFvg0VTO sCwmwz63vxuoE18kiMCe7z0AHTyibUjmANbCZROori3T678YKH9ODtcSR4YsEnOuIB I+UQ3R0Q+qWIzWDf0veh9QPNnSYHLfnlxsYtICbFb/87wIRIpmTBw4hUya3zcOregc uG1CQp0JNQ4Pw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 353CE6935F for ; Wed, 14 Jan 2026 15:59:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431539; bh=BOAeaPj0QoY0+teb41LozmO7+TkjOvZ4DkEn4wsQa+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdhaCHqvDyiJkM/P2y0hmSxLAw6e68Hy4zv6WykXLHnOL6Gn0HVe2vs2zROtCk0PX 6ib9mHF/5aVOpd9gxm4LjAWDdjo7u5fWdqcFVH1e0eTYjS8XLMubDLJu0TQk7ElxWy 7IQnomlXAEOF3x8xf6yuwP08CPJwd2SH8PJPZCPaJX8KqvNW3O1V7xKGkQhc3KbSHP qUo8GluFC5dNwxPSsZ3+XFgju702VmuZtH3lSAYR0T28RKR1GTCzxgWAYseBCRikyl ERAfFU6mTPvjvdC7xBghM4JTlPKr56RQvYPqgk3WcnQEt1qYLuB85/1AfzG3c+XTdg +vSudkkgbT42Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AFE8769361; Wed, 14 Jan 2026 15:58:59 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id wRGb5XOS1I8z; Wed, 14 Jan 2026 15:58:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431535; bh=bd3EOIbwFoflguMUzDM5PE+DG4v1kjNZrmhPWMTph9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kRJnCbEMxlzd5XbiG0LD1Whr/MYLHLKy6YRmfJIqZXvQt9AWK1Q8QNqf5u7Cn4Z9r cf1IXg1jweLeYxagLVVAqQ/D4qsDQsTByJya8ocNcksz5HwdcAWkT5aWuKUYz6a9ww 5mVVX5WXfPVJZVZGvKPCQBHFfP9QXaseyOywLbgqrQ6Ocoeig6JIJ8bv9FU+FNn8ah k9OJu8FzCrcVMgyGUVmm7Xq+h4jV/R5QX8u+tmUY7XoAmzh7sKLiHjLKr97nPf9qTW +AtQ2xpQGBdg7zYa8JCigSSgYgC+dRef6YVqQgwzw2p/mjWAOUBPsthjzV/+6i+MrV XDGfocNrPeFNg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E16EF6934D; Wed, 14 Jan 2026 15:58:54 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:20 -0700 Message-ID: <20260114225635.3407989-31-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7VZI26OJVPOCQLRVB7JKMNGF574J6FB3 X-Message-ID-Hash: 7VZI26OJVPOCQLRVB7JKMNGF574J6FB3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 30/34] ext4l: Move S_IRUGO to linux/fs.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the S_IRUGO permission constant to linux/fs.h alongside S_IRWXUGO. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 +---- include/linux/fs.h | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 2ed5a5d4984..5f3fcaae30b 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -2524,10 +2524,7 @@ struct proc_ops { ssize_t seq_read(struct file *f, char *b, size_t s, loff_t *p); loff_t seq_lseek(struct file *f, loff_t o, int w); -/* S_IRUGO file mode if not defined */ -#ifndef S_IRUGO -#define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) -#endif +/* S_IRUGO is in linux/fs.h */ /* procfs stubs */ #define proc_mkdir(name, parent) ({ (void)(name); (void)(parent); (struct proc_dir_entry *)NULL; }) diff --git a/include/linux/fs.h b/include/linux/fs.h index 2b05c39e88a..25966447cf2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -186,6 +186,7 @@ static inline void inode_init_once(struct inode *inode) /* Permission mode constants */ #define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) +#define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) /* Directory entry types */ #define DT_UNKNOWN 0 From patchwork Wed Jan 14 22:56:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1525 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=1768431546; bh=x0+nmRM8Bkc8wmE65B9DX01M6WDKq5FAh0hyT8IMKfw=; 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=gw0CBcSRIYLB1fjjrRJLJwtQqmybRqgAcxAIwM3QZhqEYhTHl27I81Uu87Mou5nPt 56bGZBo7m5JduIuVMOX/3ck/oMxXHHxPFY70I3d4Vk9UdjnCSJn+WuRrA9hAns6Yb3 bniKeXD7wITKuPBm9gKP2JSFSXify1lH3qGmlzbmOx7gjXUcQ0C+92tO5EGgDevnrZ Hgsa8KtXB7Re6RQz6IjOWS2aLs5RksUH/KSKkOTWd82pQUSTm4rWbkhBZdZ1HlIVNx bGottD48tu/pufmYfc11HsXPeZy4sES4Jc4fsRiIUkrgiwH59Q9aIHLN+gwca0x7T7 ItNCEwJ0uOo/w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E8DB969361 for ; Wed, 14 Jan 2026 15:59: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 KHcTNYQgvsea for ; Wed, 14 Jan 2026 15:59:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431546; bh=x0+nmRM8Bkc8wmE65B9DX01M6WDKq5FAh0hyT8IMKfw=; 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=gw0CBcSRIYLB1fjjrRJLJwtQqmybRqgAcxAIwM3QZhqEYhTHl27I81Uu87Mou5nPt 56bGZBo7m5JduIuVMOX/3ck/oMxXHHxPFY70I3d4Vk9UdjnCSJn+WuRrA9hAns6Yb3 bniKeXD7wITKuPBm9gKP2JSFSXify1lH3qGmlzbmOx7gjXUcQ0C+92tO5EGgDevnrZ Hgsa8KtXB7Re6RQz6IjOWS2aLs5RksUH/KSKkOTWd82pQUSTm4rWbkhBZdZ1HlIVNx bGottD48tu/pufmYfc11HsXPeZy4sES4Jc4fsRiIUkrgiwH59Q9aIHLN+gwca0x7T7 ItNCEwJ0uOo/w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D717069360 for ; Wed, 14 Jan 2026 15:59:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431544; bh=c60LDle6XMDeMTH5mqMxOYqRffzmPBhAMJbZUYHClkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSuTROQHRzOquTNhsJZRIT2LMYXou7M86eAPcgdQ3jjTyw7SiyDSjzYg0zbfvN+Uv cwz/g6tl9FovTjdxens/Vq93lUGXoKQUCnbCsMTAV2hQJZk1ed28IgzmJDg/AYMM2Q 7ES464SHf+Er07ROKYROEJNU3mxTvo+Y+VDbt0jNzPTBNzvMhLIQkHUZuY77fTHriB bQ3XR9nH6D0dle0YzX3cAN56xmhhNBnMdwNYl9oaomOjKtKfbgzZQWC9S9S5nY69Bz Y7Q810PiWzb9OC/f/rBCaetZcyWBKECU2s1FafROqk5SaQpNa0l1MNSwjxh8vQ8ej5 zW9L7enfLBttA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4AB2169360; Wed, 14 Jan 2026 15:59: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 7ZA2oE_4NU3K; Wed, 14 Jan 2026 15:59:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431539; bh=Xr/+z/fMNYx1+kqw0YOK8U4nb3qMl7RsgMxn+kvGMZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=izmkDrmu2h+Tjn5ibt0TUmmKsSKfUKP44S/0HbYqYZ7HzkBlvFOI1+75zFy3xyC+Q 8fJFapEzx27D5Ctc9U4B2D3X2AzOTPlWPyXSD/wq74PC1WmtRV9iBkK9vyRZ/iqRFJ /rj0CV9tIrETIsUoEGbyQAH1xGXefZF4Nf4NdNKEoak8HeQO28/d0HnaguUJiqmBqK aaSceBghFatRbVXj74EmC7JpqfLc1jwHtuUETrWmx4O6gXRt2JoKlugOCF0wcgCxe4 BRwEUaAF1jcF/b0i8O7/9Maj+w/j/MlU9XSooFWCqy4MM6DeDurAc/U+nW6nMm906P zoXNGHLFP6APA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7DDA36913F; Wed, 14 Jan 2026 15:58:59 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:21 -0700 Message-ID: <20260114225635.3407989-32-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LBSARQBLRNQMCAZJHQAVEDBFZSXUYDNR X-Message-ID-Hash: LBSARQBLRNQMCAZJHQAVEDBFZSXUYDNR X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 31/34] ext4l: Move FALLOC_FL_* and RENAME_* flags to linux/fs.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move file operation flags from ext4_uboot.h to linux/fs.h: - FALLOC_FL_*: fallocate operation flags (KEEP_SIZE, PUNCH_HOLE, COLLAPSE_RANGE, ZERO_RANGE, INSERT_RANGE, WRITE_ZEROES, ALLOCATE_RANGE, MODE_MASK) - RENAME_*: rename operation flags (NOREPLACE, EXCHANGE, WHITEOUT) Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 15 ++------------- include/linux/fs.h | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 5f3fcaae30b..b7b42392033 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -154,15 +154,7 @@ struct kobject { #define FIEMAP_EXTENT_UNWRITTEN 0x00000800 #define EXT4_FIEMAP_EXTENT_HOLE 0x08000000 -/* FALLOC flags */ -#define FALLOC_FL_KEEP_SIZE 0x01 -#define FALLOC_FL_PUNCH_HOLE 0x02 -#define FALLOC_FL_COLLAPSE_RANGE 0x08 -#define FALLOC_FL_ZERO_RANGE 0x10 -#define FALLOC_FL_INSERT_RANGE 0x20 -#define FALLOC_FL_WRITE_ZEROES 0x40 -#define FALLOC_FL_ALLOCATE_RANGE 0x80 -#define FALLOC_FL_MODE_MASK 0xff +/* FALLOC_FL_* flags are in linux/fs.h */ /* File flags */ #define O_SYNC 0 @@ -596,10 +588,7 @@ static inline int bdev_read_only(struct block_device *bdev) #define WHITEOUT_DEV 0 #define WHITEOUT_MODE 0 -/* Rename flags */ -#define RENAME_NOREPLACE (1 << 0) -#define RENAME_EXCHANGE (1 << 1) -#define RENAME_WHITEOUT (1 << 2) +/* RENAME_* flags are in linux/fs.h */ /* Inode dirty state flags */ #define I_DIRTY_TIME (1 << 3) diff --git a/include/linux/fs.h b/include/linux/fs.h index 25966447cf2..3156a261724 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -188,6 +188,21 @@ static inline void inode_init_once(struct inode *inode) #define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) +/* Rename flags */ +#define RENAME_NOREPLACE (1 << 0) +#define RENAME_EXCHANGE (1 << 1) +#define RENAME_WHITEOUT (1 << 2) + +/* fallocate() flags */ +#define FALLOC_FL_KEEP_SIZE 0x01 +#define FALLOC_FL_PUNCH_HOLE 0x02 +#define FALLOC_FL_COLLAPSE_RANGE 0x08 +#define FALLOC_FL_ZERO_RANGE 0x10 +#define FALLOC_FL_INSERT_RANGE 0x20 +#define FALLOC_FL_WRITE_ZEROES 0x40 +#define FALLOC_FL_ALLOCATE_RANGE 0x80 +#define FALLOC_FL_MODE_MASK 0xff + /* Directory entry types */ #define DT_UNKNOWN 0 #define DT_FIFO 1 From patchwork Wed Jan 14 22:56:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1526 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=1768431551; bh=bfN9JKSZzphp4AK4qnVR6fRacNwoPckpCE1yGiMqaM4=; 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=vqFJB7EZllddovEVYGRC9ZX9Sf62au6IKknaxIOQlr2KnCMJH5Udk8Vy6J6o23Ckn 2WhukIkLUMAvlJMVric2vbKFf141ztD15Fn2tTOtXC3jh/Fu7h15w8zI7JvX/Pf7CE E/dEsZRV9mHL3bvgZeH7AkUgAU/pRxKmMxd3sa+9htooOE76rggMtTJHH+B5VvN5td BR/M5LgHQB7DB1iZO9lytpRQadWQnIk/IMF8pRDd+VgBrnH174sHWoYlEASVXPkQAU QnCn5yIVPcCTfD5iV3fE9g6VIg5bVy0WMYy78nx3Jwr/Yi1qC4vVQ5Dbi3dwY7XB0D Ufs6jZusofk2g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 56EA169361 for ; Wed, 14 Jan 2026 15:59:11 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id aRMZJr6ioJWo for ; Wed, 14 Jan 2026 15:59:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431551; bh=bfN9JKSZzphp4AK4qnVR6fRacNwoPckpCE1yGiMqaM4=; 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=vqFJB7EZllddovEVYGRC9ZX9Sf62au6IKknaxIOQlr2KnCMJH5Udk8Vy6J6o23Ckn 2WhukIkLUMAvlJMVric2vbKFf141ztD15Fn2tTOtXC3jh/Fu7h15w8zI7JvX/Pf7CE E/dEsZRV9mHL3bvgZeH7AkUgAU/pRxKmMxd3sa+9htooOE76rggMtTJHH+B5VvN5td BR/M5LgHQB7DB1iZO9lytpRQadWQnIk/IMF8pRDd+VgBrnH174sHWoYlEASVXPkQAU QnCn5yIVPcCTfD5iV3fE9g6VIg5bVy0WMYy78nx3Jwr/Yi1qC4vVQ5Dbi3dwY7XB0D Ufs6jZusofk2g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 472676935F for ; Wed, 14 Jan 2026 15:59:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431549; bh=1t2CdpY2VMXfQbYeiLSpUPB/GvvTTVQjhYUuPhlW3po=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mow28R8ikJLMDdw/daLGA8GsZeq6hSdgjyWEkpd52TGa7ZIROgFNaYyk6BBN681Ps 3zvZ8wVjmxD18IdDK+WnIRnUW/kwJPzqmUWZkkSfJ/3NiKCAuQKL+TpG95IKc4y9OB uRVsKVqDvb+fDaVmW+buJN7iquPwPItOtMrOeG6uux25h/9CarO540MU6zq2OVCfX1 YuhcCCru9KPUeB6sAYwYdC5hnLJm9bnCvQpR031OBv3qYYvV2tjGdHIL60Zg6cLR2l JTP30awELyn3K9ZcjaBTM36xkPUT8Mvxx1v014qqdPKplmwJw9mapFrOB+8UXGyJwd gkIeXsZtyMf+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 500686935F; Wed, 14 Jan 2026 15:59: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 1t4SnT-e0MDQ; Wed, 14 Jan 2026 15:59:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431544; bh=eh0JTKmEl9f5AF/LYICEY+v047Xeao5ieqdalf1nPwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D0r1iKM7bsP1TUSfm/uE0/JMGo9kkH9nzqij/254Q9sHFunhtKoWaGUfOrgXq5sjw k2juvyhxwYMHgBSOyD+ATICFHm49t/9yrVC5GzRKw/QDAmLEFBj1WPJoJARVuHIMdA cVtZmfHg3TFo/SF6yX4TNBrCjapXajqC+NdJrEWx94dWV/Ir41vmEKWpuN/Rf7MabM wdzVUB2uhfDA8V0SnRtEbJRO+2GqBRwCaxqJtPFEF92CIz+r+0SiOvrwgkUhRa2LrN 2A4Y24yYlPJT759xVpoJRerVXeBcfR+3AB1p+tjVt0GimsgwO7RgzwAaBK+DYQLjZd UVB7WB4rhq1wQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 23F4F6934D; Wed, 14 Jan 2026 15:59:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:22 -0700 Message-ID: <20260114225635.3407989-33-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2NVRBB7SU5CG7R6VCRITJGRQ4H3QLTIF X-Message-ID-Hash: 2NVRBB7SU5CG7R6VCRITJGRQ4H3QLTIF X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 32/34] ext4l: Move ATTR_* iattr flags to linux/fs.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the ATTR_* flags (used to indicate which fields of struct iattr are valid) from ext4_uboot.h to linux/fs.h alongside the struct iattr definition. This includes: ATTR_MODE, ATTR_UID, ATTR_GID, ATTR_SIZE, ATTR_ATIME, ATTR_MTIME, ATTR_CTIME, ATTR_ATIME_SET, ATTR_MTIME_SET, ATTR_FORCE, ATTR_KILL_SUID, ATTR_KILL_SGID, ATTR_TIMES_SET. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 15 +-------------- include/linux/fs.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index b7b42392033..4baf9410012 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -596,20 +596,7 @@ static inline int bdev_read_only(struct block_device *bdev) /* Superblock flags */ #define SB_LAZYTIME (1 << 25) -/* iattr valid flags */ -#define ATTR_MODE (1 << 0) -#define ATTR_UID (1 << 1) -#define ATTR_GID (1 << 2) -#define ATTR_SIZE (1 << 3) -#define ATTR_ATIME (1 << 4) -#define ATTR_MTIME (1 << 5) -#define ATTR_CTIME (1 << 6) -#define ATTR_ATIME_SET (1 << 7) -#define ATTR_MTIME_SET (1 << 8) -#define ATTR_FORCE (1 << 9) -#define ATTR_KILL_SUID (1 << 11) -#define ATTR_KILL_SGID (1 << 12) -#define ATTR_TIMES_SET ((1 << 7) | (1 << 8)) +/* ATTR_* iattr valid flags are in linux/fs.h */ /* STATX flags and attributes */ #define STATX_BTIME 0x00000800U diff --git a/include/linux/fs.h b/include/linux/fs.h index 3156a261724..ba4463cfc79 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -160,6 +160,21 @@ struct iattr { loff_t ia_size; }; +/* iattr valid flags - specify which fields of iattr are valid */ +#define ATTR_MODE (1 << 0) +#define ATTR_UID (1 << 1) +#define ATTR_GID (1 << 2) +#define ATTR_SIZE (1 << 3) +#define ATTR_ATIME (1 << 4) +#define ATTR_MTIME (1 << 5) +#define ATTR_CTIME (1 << 6) +#define ATTR_ATIME_SET (1 << 7) +#define ATTR_MTIME_SET (1 << 8) +#define ATTR_FORCE (1 << 9) +#define ATTR_KILL_SUID (1 << 11) +#define ATTR_KILL_SGID (1 << 12) +#define ATTR_TIMES_SET (ATTR_ATIME_SET | ATTR_MTIME_SET) + /* writeback_control - defined in linux/compat.h */ /* fsnotify - stub */ From patchwork Wed Jan 14 22:56:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1527 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=1768431556; bh=xEJf8KG+TUh8W3Pvy4Y3SVCM5QxIXABtNhepExCnDL8=; 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=O+7b6qp6mvGkF3DFXY7ZjTDS4a+jGvaoth29MiKJXRF8dk6NRxvrqt8DRVUNX+l5g FLzncTjC8wVtHn4ZfPTqw8SQPwSdazYfLSG9xNbwcy7o8dd4Y141wWmII3y+4UnVzN Ib4WilS8JG6H/T4Mm6PE5mAnPuLKhvKYqjP3LySkHGeg1JpU5zXeyXs4CMrSC2x/Rk fkk6tlbhdHItVk4UoyF6uK4TgqpSpxDy9ukrdtcUy9BUL8/cmQRfzNc9yBvesmYA9H iVb1/ot7Lol6n9KIqRru5RSYhppdcO4Rry6ZlklUTOaJ4/jhjquC3Ro5jXouMkAMaN TX7UDC17ce4jA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 241F46913F for ; Wed, 14 Jan 2026 15:59:16 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id FfcebM2um0Nm for ; Wed, 14 Jan 2026 15:59:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431556; bh=xEJf8KG+TUh8W3Pvy4Y3SVCM5QxIXABtNhepExCnDL8=; 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=O+7b6qp6mvGkF3DFXY7ZjTDS4a+jGvaoth29MiKJXRF8dk6NRxvrqt8DRVUNX+l5g FLzncTjC8wVtHn4ZfPTqw8SQPwSdazYfLSG9xNbwcy7o8dd4Y141wWmII3y+4UnVzN Ib4WilS8JG6H/T4Mm6PE5mAnPuLKhvKYqjP3LySkHGeg1JpU5zXeyXs4CMrSC2x/Rk fkk6tlbhdHItVk4UoyF6uK4TgqpSpxDy9ukrdtcUy9BUL8/cmQRfzNc9yBvesmYA9H iVb1/ot7Lol6n9KIqRru5RSYhppdcO4Rry6ZlklUTOaJ4/jhjquC3Ro5jXouMkAMaN TX7UDC17ce4jA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0F5EA69360 for ; Wed, 14 Jan 2026 15:59:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431553; bh=m7YWiaglgUNr3oUlTth1I5wP9DZB578b/iUci+aUHDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iek609Z2oEv+khSp8/4RG6Rg76pnqMBzzqogZ2FdBJ//0mjEAgGUWrt2cUnkTDRlY J2cYosp735cxZq0iG3900QWx2bSkJMVPSJx9lg9B1jk0iwxuNjz4gRSDNc/BhOVZMX y/ndpppX4K4Pj5+kT8lqvp4FYw+F9E1rixQnX7n2G8tr5qCXLxTp08R6mndMglqkig /e0sks8TbgsS3mE8r4P9n3Emj3sBkq1A/bt9bGMaEhmglqTSNopfSE5t2tQf0AUkk2 G0CbCSvLsaFOdScLGvQI/n0FDnLIYy8Tmyf5mOdZvVxHSuPO+mVaD4aswIUpAXaKd/ xOkEFcRCnvETA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A72F569360; Wed, 14 Jan 2026 15:59: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 W5JwXn9YpWv2; Wed, 14 Jan 2026 15:59:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431549; bh=IGzw7Ff2B+NmVKbmK8rHAxdpE1RE9TDwNHGpZIDfDME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=blkjvOQwuw6Drr/zpiKaKlIDUP29d/xzHGFpUIDFNW1FzYknuaHa6uzKN/He1iYY7 xrWTyOfVQpGLSzKwcJrXr+kKF03yCHxQqw0VT2vULvjVECMttjWG6JjuAAYMLKBKD4 kB2YBAwuvB/11zawhZWO1Fy8ygKqhDJCFnJAOJi/jJg6tl6ADa4PL6YPAOiUDBH9Gj njVhfIPj/JykdZZYIK+A7rohRfBoffcqsozd8f2msYvgjvhsJ5G29f2E9JH0Nrn9zH fVPkNE1xbsImTVw/+ZSs/qJ0nBXHX48UcFmXnDeroxPko/mDDQ8jN4guQTBRCigpa5 m5cJ6zQkYPehA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B18E26913F; Wed, 14 Jan 2026 15:59:08 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:23 -0700 Message-ID: <20260114225635.3407989-34-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CLZUAFV562OL5WVJVSL6ZJTLUZJ4IPVG X-Message-ID-Hash: CLZUAFV562OL5WVJVSL6ZJTLUZJ4IPVG X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 33/34] ext4l: Move SB_* superblock flags 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 common superblock flags from ext4_uboot.h to linux/fs.h: - SB_RDONLY: read-only mount flag - SB_POSIXACL: POSIX ACL support flag - SB_LAZYTIME: lazy time updates flag - SB_I_VERSION: inode version update flag - SB_INLINECRYPT: inline encryption flag - SB_ACTIVE: superblock active flag - SB_SILENT: silent mount errors flag - SB_FREEZE_*: filesystem freeze level constants Keep SB_I_CGROUPWB and SB_I_ALLOW_HSM as U-Boot stubs since these are not supported. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 26 +++++++------------------- include/linux/fs.h | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4baf9410012..87cc561538e 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -396,11 +396,7 @@ void iput(struct inode *inode); /* _RET_IP_ - return instruction pointer */ #define _RET_IP_ ((unsigned long)__builtin_return_address(0)) -/* SB_FREEZE constants */ -#define SB_FREEZE_WRITE 1 -#define SB_FREEZE_PAGEFAULT 2 -#define SB_FREEZE_FS 3 -#define SB_FREEZE_COMPLETE 4 +/* SB_FREEZE_* constants are in linux/fs.h */ /* sb_writers stub */ struct sb_writers { @@ -525,9 +521,7 @@ struct fstrim_range { /* block_device is defined in linux/fs.h */ -/* Superblock flags */ -#define SB_RDONLY (1 << 0) -#define SB_I_VERSION (1 << 26) /* Update inode version */ +/* SB_RDONLY, SB_I_VERSION, etc. superblock flags are in linux/fs.h */ /* UUID type */ typedef struct { @@ -593,9 +587,7 @@ static inline int bdev_read_only(struct block_device *bdev) /* Inode dirty state flags */ #define I_DIRTY_TIME (1 << 3) -/* Superblock flags */ -#define SB_LAZYTIME (1 << 25) - +/* SB_LAZYTIME is in linux/fs.h */ /* ATTR_* iattr valid flags are in linux/fs.h */ /* STATX flags and attributes */ @@ -1683,8 +1675,7 @@ static inline void end_buffer_read_sync(struct buffer_head *bh, int uptodate) } #define REQ_OP_READ 0 -/* Superblock flags */ -#define SB_ACTIVE (1 << 30) +/* SB_ACTIVE is in linux/fs.h */ /* Part stat - not used in U-Boot. Note: sectors[X] is passed as second arg */ #define STAT_WRITE 0 @@ -1893,12 +1884,9 @@ struct fs_parse_result { /* I/O priority classes */ #define IOPRIO_CLASS_BE 2 -/* Superblock flags */ -#define SB_INLINECRYPT (1 << 27) -#define SB_SILENT (1 << 15) -#define SB_POSIXACL (1 << 16) -#define SB_I_CGROUPWB 0 -#define SB_I_ALLOW_HSM 0 +/* SB_INLINECRYPT, SB_SILENT, SB_POSIXACL are in linux/fs.h */ +#define SB_I_CGROUPWB 0 /* Not supported in U-Boot */ +#define SB_I_ALLOW_HSM 0 /* Not supported in U-Boot */ /* Block open flags */ #define BLK_OPEN_READ (1 << 0) diff --git a/include/linux/fs.h b/include/linux/fs.h index ba4463cfc79..7393fd0d316 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -208,6 +208,21 @@ static inline void inode_init_once(struct inode *inode) #define RENAME_EXCHANGE (1 << 1) #define RENAME_WHITEOUT (1 << 2) +/* Superblock flags */ +#define SB_RDONLY (1 << 0) /* Read-only mount */ +#define SB_POSIXACL (1 << 16) /* POSIX ACL support */ +#define SB_LAZYTIME (1 << 25) /* Lazy time updates */ +#define SB_I_VERSION (1 << 26) /* Update inode version */ +#define SB_INLINECRYPT (1 << 27) /* Inline encryption */ +#define SB_ACTIVE (1 << 30) /* Superblock is active */ +#define SB_SILENT (1 << 15) /* Silent mount errors */ + +/* Superblock freeze levels */ +#define SB_FREEZE_WRITE 1 +#define SB_FREEZE_PAGEFAULT 2 +#define SB_FREEZE_FS 3 +#define SB_FREEZE_COMPLETE 4 + /* fallocate() flags */ #define FALLOC_FL_KEEP_SIZE 0x01 #define FALLOC_FL_PUNCH_HOLE 0x02 From patchwork Wed Jan 14 22:56:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1528 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=1768431560; bh=QmykCc/o1m1N5c3AuP5BT0PsvNr/xM2HIRiG4i7BWA4=; 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=TrGSZF9mOUSOeWAs+OOQlnebJL2BKZ25C9BrOAip4HjxafOWPYqQZScpUA6sMEvAB Fdg4BfLtCJ4L3CbEbefmiIs4gcBasfemj3KC4VCwEX7Q+q6tycQ2HPeReGhAfbapJP af3g+/OI6SGFNDh/yiLHEotdXMSw7I7a1hW/AIsQuwuvviuv/TKrofOaF7Wvn4LV6Q x9xcp3WBGOJoLYvKhIl2PSgfNuHy1IBsrhW1IEC1183+nfjmNwThzgzIxKPkUAgtRE RwKxc1LKmm0wYy7OLjF9FC0l9HhLxCs9DvQsETzBos/7/qD27k/FgkAq4hJWicnr8/ iN/OssZuwvvZQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AF50869361 for ; Wed, 14 Jan 2026 15:59: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 aJWNw3qgzChF for ; Wed, 14 Jan 2026 15:59:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431560; bh=QmykCc/o1m1N5c3AuP5BT0PsvNr/xM2HIRiG4i7BWA4=; 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=TrGSZF9mOUSOeWAs+OOQlnebJL2BKZ25C9BrOAip4HjxafOWPYqQZScpUA6sMEvAB Fdg4BfLtCJ4L3CbEbefmiIs4gcBasfemj3KC4VCwEX7Q+q6tycQ2HPeReGhAfbapJP af3g+/OI6SGFNDh/yiLHEotdXMSw7I7a1hW/AIsQuwuvviuv/TKrofOaF7Wvn4LV6Q x9xcp3WBGOJoLYvKhIl2PSgfNuHy1IBsrhW1IEC1183+nfjmNwThzgzIxKPkUAgtRE RwKxc1LKmm0wYy7OLjF9FC0l9HhLxCs9DvQsETzBos/7/qD27k/FgkAq4hJWicnr8/ iN/OssZuwvvZQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9D4C86935F for ; Wed, 14 Jan 2026 15:59:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431558; bh=wHgKvFoUlfloFwEsQKh7Rv07Lwhw+3JIFyR4MnRa07s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jzr/UbeztlvFF9M8jTJEMfu9lYQclzukWvayraJK6NNYN9TBYZCzttPDuNN7OKf4K HF5qPo5iz690jsVGWllqrjpTb53DJwaGNrfNnlNT4yjXt5Q+NS1/v6dNwjuajw8x6v twBViCHWHpPPN5vR/DofedzZdgJqDACTb5TWkLs5uRX3za51whRNs2hSrYNCnE8lMf HTt6NRqYBJFwR3U4X4w2KsNRoCgIdFIZzbCn6hJlz1/TpTDCk6MgQvKVZyKFclYo02 yMS1jY2AnATqBmdLVGuzOpZajtYDwXObFxIPtM/pg7c6y55XoGnaytItbnBTbDczws kUPdewttBOv0g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8A8DE6913F; Wed, 14 Jan 2026 15:59: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 r7_egZjZR0YV; Wed, 14 Jan 2026 15:59:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431553; bh=XQyxRQV0j6e7KrCgJRjnPkRVbrAQMlXAb2ljZnRj1YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CK0OzAFexLwZvxieY/zmhe7AMOsJyYD56M5ZCu0yJ/e+leRKCLTEGxughz3WcCHjQ NE+Jp+X+19ZFZMS6mABcZpqskBvR9mmM+T5xap65/8q2djVcBNZooJVe3HinzNkqNk i2Em/KHv3MdVJOIW751qosU9hxUt3Ww9j52XGMeZZ0v4nMIbxuAFiZZL/AkboxVD+6 /7T39/ysR2UKOpoLj8tFkZtNUq+U+nDIlSHBBln67ICnJIRmX9x07YORdD84T203x+ tUMOk/t7fmmi/+AlrwM+ncqDDRtAGVikpl+1jbpPhf2gWSgNsd0yhero0BdbgY0Xdh JLHQWpJrAHtAg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4D2E36935F; Wed, 14 Jan 2026 15:59:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:24 -0700 Message-ID: <20260114225635.3407989-35-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DH5OWFQNW3Z32DSKXAZWWLDHK5QUFWRL X-Message-ID-Hash: DH5OWFQNW3Z32DSKXAZWWLDHK5QUFWRL 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 34/34] ext4l: Move buffer migration stubs to linux/buffer_head.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 buffer and folio migration stubs from ext4_uboot.h to linux/buffer_head.h where they belong: - buffer_migrate_folio(): folio migration stub (returns -EOPNOTSUPP) - buffer_migrate_folio_norefs(): no-refs folio migration stub - noop_dirty_folio(): no-op dirty folio handler U-Boot doesn't support memory migration, so these remain as stubs. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 22 +--------------------- include/linux/buffer_head.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 87cc561538e..91e0ce95467 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1142,27 +1142,7 @@ struct readahead_control { #define readahead_length(rac) ({ (void)(rac); 0UL; }) /* address_space_operations is in linux/fs.h */ - -/* Stub for buffer_migrate_folio */ -static inline int buffer_migrate_folio(struct address_space *mapping, - struct folio *dst, struct folio *src, int mode) -{ - return -EOPNOTSUPP; -} - -/* Stub for buffer_migrate_folio_norefs */ -static inline int buffer_migrate_folio_norefs(struct address_space *mapping, - struct folio *dst, struct folio *src, int mode) -{ - return -EOPNOTSUPP; -} - -/* Stub for noop_dirty_folio */ -static inline bool noop_dirty_folio(struct address_space *mapping, - struct folio *folio) -{ - return false; -} +/* buffer_migrate_folio, buffer_migrate_folio_norefs, noop_dirty_folio are in linux/buffer_head.h */ /* Stub implementations for address_space_operations callbacks */ static inline bool block_is_partially_uptodate(struct folio *folio, diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 94bd2bab96a..a160b7d1a67 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -12,6 +12,7 @@ #include #include #include +#include #include enum bh_state_bits { @@ -186,4 +187,30 @@ void __brelse(struct buffer_head *bh); #define unlock_buffer(bh) clear_buffer_locked(bh) #define test_clear_buffer_dirty(bh) ({ (void)(bh); 0; }) +/* + * Folio migration stubs - U-Boot doesn't support memory migration + */ +static inline int buffer_migrate_folio(struct address_space *mapping, + struct folio *dst, struct folio *src, + int mode) +{ + return -EOPNOTSUPP; +} + +static inline int buffer_migrate_folio_norefs(struct address_space *mapping, + struct folio *dst, + struct folio *src, int mode) +{ + return -EOPNOTSUPP; +} + +/* + * noop_dirty_folio - no-op dirty folio handler + */ +static inline bool noop_dirty_folio(struct address_space *mapping, + struct folio *folio) +{ + return false; +} + #endif /* _LINUX_BUFFER_HEAD_H */