From patchwork Mon Jan 19 06:14: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: 1608 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=1768803350; bh=l2CseYpF9Wc304dfl2GJTDZXCT+CWMCootTu1582dbQ=; 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=gln8U3X6oumveKL4b3uY8wjkcYl02J9o7LLorvAlnzwCFQWgmHzu18SwJf8qvhUKj ieva8Y56DbxM/sSyRS3MMiRuAsL05CAoPNn2hlXdqJ8zkCMCvIIeuSl1wuv5MMKZdt oRbtwSXaX1VHYRYMiS53HWea7Uct3r4fdzWSlG7/klB6aLQWZC/J6Lo8sBCVK7SznV fzemq/AiWR/nl4zSmI09nCbjOYuiMx/OrrwhE+4vXAkk7fQNlbqoVfVv87IR2Y+m3V DgJ28zXpLK8TvEi6RYOxmaw92EsrRWKyIIPSV5jCp8UnJ8ub4Qx/wDr76nz27yc71b 0jUSsh+sAJd+A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 31419694CF for ; Sun, 18 Jan 2026 23:15: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 10024) with ESMTP id WCCYySztaa7m for ; Sun, 18 Jan 2026 23:15:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803350; bh=l2CseYpF9Wc304dfl2GJTDZXCT+CWMCootTu1582dbQ=; 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=gln8U3X6oumveKL4b3uY8wjkcYl02J9o7LLorvAlnzwCFQWgmHzu18SwJf8qvhUKj ieva8Y56DbxM/sSyRS3MMiRuAsL05CAoPNn2hlXdqJ8zkCMCvIIeuSl1wuv5MMKZdt oRbtwSXaX1VHYRYMiS53HWea7Uct3r4fdzWSlG7/klB6aLQWZC/J6Lo8sBCVK7SznV fzemq/AiWR/nl4zSmI09nCbjOYuiMx/OrrwhE+4vXAkk7fQNlbqoVfVv87IR2Y+m3V DgJ28zXpLK8TvEi6RYOxmaw92EsrRWKyIIPSV5jCp8UnJ8ub4Qx/wDr76nz27yc71b 0jUSsh+sAJd+A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2183C694C7 for ; Sun, 18 Jan 2026 23:15:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803348; bh=Oau4rgdkxxwR7jK1Gsra9Em9iq4KPAKyb8cc1+uOJgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H25KEku7Jth2bXDCuEDlBBltyS9pEnRhSB40epGQeJuaUsOj6t32GA2GjhGw6Xm76 Oljgn4PqXxyeaVWBwNlTjjb1DU6cLn0LxpK2NbsxjzTEoSoML+8TgDi7mWEwc3wzKv D4pySnR8uxF1T94Zl65jRfe4TBXxUjrKiP+vRuc6kdZ/K942oiSFPfVr8wmEOSG6UM N36rmh6+tJK6t7Gqu4d2yxoK/1gvbw+2Y9jEN597o+nGbcPqzfOHyJrMjVBTMxOOof n6l1HngLZjDTZJcg2jXuWcNBzoFXgAoYUwm2y97wjG0RXHfxlZltodqvDDlKSi8kDu JYskiLOzgZMbA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5D110693AE; Sun, 18 Jan 2026 23:15:48 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 87x50mrVuqSn; Sun, 18 Jan 2026 23:15:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803344; bh=17aDNw560M2nqMhxb8GaaWW/FsJZHXyExJguZhNMYsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SE6dWSeFf17PL39ZDkv+d6itmoRBor3Y6lB5AS3jeq+fWK42ShXIH1mjYagS8ubIn VM5NIwLcCeFYRIPQ5li3M7IAIwfGY0hBodDVWY0aWCL9tvQrmprZDu74HE7R63Amiy dC91z5NbP3ThEBI8lKCorO65cfO8BurnY7b3PA1xmTYmzD2mqVFN9vVOTOB+u/h5KQ eUOoskIJh18CNAp7N5zJcKIKXJcZqVRwqofTrwIPbJ/DdYqfS2Gk0IYOkH81ZQdfNz wcWcQzSSSUdfZwVmlkHDaAsLSApZw8s2SxOTJ8tAMt58PMi463l5gXpWM/cgM9y2aM oQAWRTLXU/Pog== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0F792694D9; Sun, 18 Jan 2026 23:15:44 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:14:59 -0700 Message-ID: <20260119061529.3383191-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AZKSIBYU5OQOBRVDFK4YZW6PUOSVYQMQ X-Message-ID-Hash: AZKSIBYU5OQOBRVDFK4YZW6PUOSVYQMQ 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/23] linux: random: Add get_random_u32_below and prandom_u32_max List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add get_random_u32_below() and prandom_u32_max() stub macros to linux/random.h for filesystem code that uses random number generation. Update ext4_uboot.h to use linux/random.h instead of duplicating these definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 8 +++----- include/linux/random.h | 25 ++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 3c6b3ca5507..4fb8f9111b0 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -252,8 +252,8 @@ struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); /* d_inode is now in linux/dcache.h */ -/* Random number functions */ -#define get_random_u32_below(max) (0) +/* Random number functions - use linux/random.h */ +#include /* Buffer cache operations */ #define sb_find_get_block(sb, block) ((struct buffer_head *)NULL) @@ -1267,9 +1267,7 @@ int ext4_fill_super(struct super_block *sb, struct fs_context *fc); int ext4_commit_super(struct super_block *sb); void ext4_unregister_li_request(struct super_block *sb); -/* prandom */ -#define get_random_u32() 0 -#define prandom_u32_max(max) 0 +/* prandom - get_random_u32, prandom_u32_max are in linux/random.h */ /* ctype */ #include diff --git a/include/linux/random.h b/include/linux/random.h index cb09c6c6b05..1a9de842a4c 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * Stub definitions for random number generation. + * Random number generation definitions for U-Boot + * + * Based on Linux random.h - random number generation. + * U-Boot stub - returns constant values. */ #ifndef _LINUX_RANDOM_H #define _LINUX_RANDOM_H @@ -12,4 +15,24 @@ #define get_random_u32() 0 #define get_random_u64() 0ULL +/** + * get_random_u32_below() - get random number below a ceiling + * @ceil: upper bound (exclusive) + * + * U-Boot stub - always returns 0. + * + * Return: random value in [0, ceil) + */ +#define get_random_u32_below(ceil) (0) + +/** + * prandom_u32_max() - get random number up to a maximum + * @max: upper bound (inclusive) + * + * U-Boot stub - always returns 0. + * + * Return: random value in [0, max] + */ +#define prandom_u32_max(max) (0) + #endif /* _LINUX_RANDOM_H */ From patchwork Mon Jan 19 06:15: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: 1609 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=1768803357; bh=xYFXuMF7udvPZf+h5Y/1vk1mqEFOdCwQ5QR7pg8g3BA=; 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=DL9BtD4hf0NQD2bPSxdh+5TxvyvRplJ+Vp4jvpMZ4UgsEROeimtKIxpKYGaU12OSn nkJjdvleoWCCFJst4gxgQWP3A60uvS9UnJ2NMOLPdiAInjWHyKtiqOddCnw6vVqV+5 ONQN9li6MZiEK4k6a25Lzpgu9nFqdlR4Ox3eVvN+LXwby5uSgKkhcXNAN2P8DlGzRs CKrsuCKSJzwwpwTiQ83waqyGn5snPE3hiI/js8iVwKviSbulj+8JOLY2rUj4Sfkpjb piD9BM8Xryhrjnxs+j8sOGtBDDM6jAo/2zzbda1G+dI6D8Wrdh/cZbgy59GUPHKwQp OZ4UI9mMaJTQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2C4FE693AE for ; Sun, 18 Jan 2026 23:15: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 vjhHhWJqgKkq for ; Sun, 18 Jan 2026 23:15:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803357; bh=xYFXuMF7udvPZf+h5Y/1vk1mqEFOdCwQ5QR7pg8g3BA=; 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=DL9BtD4hf0NQD2bPSxdh+5TxvyvRplJ+Vp4jvpMZ4UgsEROeimtKIxpKYGaU12OSn nkJjdvleoWCCFJst4gxgQWP3A60uvS9UnJ2NMOLPdiAInjWHyKtiqOddCnw6vVqV+5 ONQN9li6MZiEK4k6a25Lzpgu9nFqdlR4Ox3eVvN+LXwby5uSgKkhcXNAN2P8DlGzRs CKrsuCKSJzwwpwTiQ83waqyGn5snPE3hiI/js8iVwKviSbulj+8JOLY2rUj4Sfkpjb piD9BM8Xryhrjnxs+j8sOGtBDDM6jAo/2zzbda1G+dI6D8Wrdh/cZbgy59GUPHKwQp OZ4UI9mMaJTQw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 128E1694CE for ; Sun, 18 Jan 2026 23:15:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803355; bh=EU2Rc9CK/POpPq+9p7V9zjQsJWfVwr/jPQs4wYPIsJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gG77b/A21l8DNb9NGpLvU0K/4Yc3uepmKTqk+oSkDinTMGoJ5EIBpiol0IC9FgglT rM53PReJT1EhZv9ykkGN7CwgMhKRRolzs86jxPbTQe0jWFwYaYlTiFN8tqnFPM7lc5 HVYvlwykBxkbX8VLBqGC/HrfwjYLmyOkJhq8+WiuB45crbNEEB8De0884IJdaAtVbT JBlovDVh+0JM1HhplF50d2x2EoMWbHrRzi9DqDEm7HB7GUYaGXP/dN0iWm7bzT6Dds dn/CY1w8M1bwSu8GxrTvgwL9bBag8Tx07f4SyTBGwkKZIL42X0Wv67Z+8SreeUcJyW +mMACEeU5SSUA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 18ACD693AE; Sun, 18 Jan 2026 23:15: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 TVWRBF6zxJXC; Sun, 18 Jan 2026 23:15:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803351; bh=TJ76MO+jeEmPiLTaxa9EN7kCEmhl1pFgXCPbSsbQRoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u0/Hvgv5I3mRILGhpqbsdHA+MW20uSD6n7D2A3Ia+XDSiuIa0hqi8dChATG4p0sjp cxTHpw01RHBiTIvcuYZ7lQisfFEgJLIBNFCFN/UXieHsmEg0tWmP9uVcYJjcoCBa/8 lnjLTSXlMdVKfw9u9TEaof71D+63V38ZPf5GJ6oHfewCslos8bf0OfIC9sPcA18k/b QG0bbG5q+7W7oW1qrZ2AftD9YH/LPdaNa1G4xCM/hy1wLOF4a2dxcd7/yFxGd/lFtH diidGtyKItoYYT0Ce0KV0C8/KdFOxdcFgPFTImT5WYkkpYZZUX2fkXMIjvQWlOBjBi iIj6C9pEhet7Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BF272694CE; Sun, 18 Jan 2026 23:15:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:00 -0700 Message-ID: <20260119061529.3383191-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QTUQUKSLDNR2A4AMI7L6KMZNHE7MKQKL X-Message-ID-Hash: QTUQUKSLDNR2A4AMI7L6KMZNHE7MKQKL 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/23] linux: path: Add path_put and d_path 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 Add path_put() macro and d_path() stub function to linux/path.h for filesystem code that uses path operations. Update linux/fs.h to include linux/path.h instead of duplicating the struct path definition. Update ext4_uboot.h to use linux/path.h instead of duplicating these definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 12 +++--------- include/linux/fs.h | 7 ++----- include/linux/path.h | 31 +++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4fb8f9111b0..7ad24732cf4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -928,13 +928,8 @@ void mapping_clear_folio_cache(struct address_space *mapping); #define sb_start_pagefault(sb) do { (void)(sb); } while (0) #define sb_end_pagefault(sb) do { (void)(sb); } while (0) -/* d_path - get pathname - stub returns empty path */ -static inline char *d_path(const struct path *path, char *buf, int buflen) -{ - if (buflen > 0) - buf[0] = '\0'; - return buf; -} +/* d_path, path_put - use linux/path.h */ +#include /* fscrypt_file_open is in ext4_fscrypt.h */ #define fsverity_file_open(i, f) ({ (void)(i); (void)(f); 0; }) @@ -1379,8 +1374,7 @@ int inode_generic_drop(struct inode *inode); /* NFS export helpers are now in linux/exportfs.h */ -/* Path operations */ -#define path_put(p) do { } while (0) +/* Path operations - path_put, d_path are in linux/path.h */ /* I/O priority - declaration for stub.c */ int IOPRIO_PRIO_VALUE(int class, int data); diff --git a/include/linux/fs.h b/include/linux/fs.h index 7393fd0d316..28b57b59484 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -51,11 +51,8 @@ struct vfsmount { struct dentry *mnt_root; }; -/* path - pathname components */ -struct path { - struct vfsmount *mnt; - struct dentry *dentry; -}; +/* path - use linux/path.h */ +#include /* Buffer operations are in buffer_head.h */ diff --git a/include/linux/path.h b/include/linux/path.h index 27cc071026a..3ebcb16e3c7 100644 --- a/include/linux/path.h +++ b/include/linux/path.h @@ -1,4 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Path definitions for U-Boot + * + * Based on Linux path.h - filesystem path operations. + */ #ifndef _LINUX_PATH_H #define _LINUX_PATH_H @@ -10,4 +15,30 @@ struct path { struct dentry *dentry; }; +/** + * path_put() - release a path reference + * @path: path to release + * + * U-Boot stub - no reference counting. + */ +#define path_put(path) do { (void)(path); } while (0) + +/** + * d_path() - get pathname from path structure + * @path: path to convert + * @buf: buffer for pathname + * @buflen: size of buffer + * + * U-Boot stub - returns empty string. + * + * Return: pointer to pathname in buffer + */ +static inline char *d_path(const struct path *path, char *buf, int buflen) +{ + (void)path; + if (buflen > 0) + buf[0] = '\0'; + return buf; +} + #endif /* _LINUX_PATH_H */ From patchwork Mon Jan 19 06:15: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: 1610 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=1768803361; bh=tRRVg+wxh/WA4BkIJUy2krcGfhIKmPMyjWtvxBiARhg=; 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=kmzJ5IYzRpkizflI1dkTppzJya87Ra1IAT62Vf/Drpy0kUi5KZE4BKHSgHiG5uFPt frlo779zowT9D5lI0Rom0FeoBLHmpev6YTkPLb10FUStN5EZW7jP5L04qE5pTTeWv4 t37RmhVsDRcZnCJMosHiYUuIn8Pbg8/5LO0sPsy0Hrk5ydiW54B2AJWbdkXXZsLAeQ TJP+L/LcWoyTUb/hbEi6o/aZKek4Nn41Gg2yBtkISgz0l5dN2XhT6gAthz8AnHgNnM uIrUiqm/CsHcVl9YwBAX1wQ5V9nJCXW2DaYahTCS0QaKHDXFJ5541pxUT2I59BS0H5 TXqgWP+0tDfeQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DFC116913F for ; Sun, 18 Jan 2026 23:16: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 CgVUa9s1A36C for ; Sun, 18 Jan 2026 23:16:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803361; bh=tRRVg+wxh/WA4BkIJUy2krcGfhIKmPMyjWtvxBiARhg=; 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=kmzJ5IYzRpkizflI1dkTppzJya87Ra1IAT62Vf/Drpy0kUi5KZE4BKHSgHiG5uFPt frlo779zowT9D5lI0Rom0FeoBLHmpev6YTkPLb10FUStN5EZW7jP5L04qE5pTTeWv4 t37RmhVsDRcZnCJMosHiYUuIn8Pbg8/5LO0sPsy0Hrk5ydiW54B2AJWbdkXXZsLAeQ TJP+L/LcWoyTUb/hbEi6o/aZKek4Nn41Gg2yBtkISgz0l5dN2XhT6gAthz8AnHgNnM uIrUiqm/CsHcVl9YwBAX1wQ5V9nJCXW2DaYahTCS0QaKHDXFJ5541pxUT2I59BS0H5 TXqgWP+0tDfeQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C9877694C7 for ; Sun, 18 Jan 2026 23:16:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803359; bh=9lZrqEb1obkaQjYATfVaUNjzVJM3iI63Z0VluhNMrHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=llSozA2rNiQEwaAe2cJwMY5WtHxGGO0J9dNtM4td1XN5hsboWHbrLC5klT6gmhfDR yoL1EC/x07qPImvj6/yiAF27DVgeNJ11DVpcaUnhTQ/GrkeGTnPfJf7dlNeDBIzf6B P/z3nwFpK7eq0aba8wMo++LjjXVSrACKSUJgLs0PwWiD0tkPgODCqvdfxuD3IGH66d v/3s2ySI48sz8QWC76W0JimFuy6aB/a7562UEAXNa/nq91JgCJE5IqOrmZ+MI8VqbD P7/umMag9Ii9WvNhiH5m6JG9q3v86pf5j3OD6wolgXcqEq6+hf9vhXQttywjrfgZEi zN5bWRpTgaOow== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AFCF86913F; Sun, 18 Jan 2026 23:15: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 SBtDlytS901g; Sun, 18 Jan 2026 23:15:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803355; bh=MsKuaXJn+tgeicpafcy/KK3PVN6dKFZrHEhk5gLqO3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=elj1w1VTetr85qrrxJO9BPIi2YB7ZplNznh6hFfCp4Q/bKlfW6wvUtZSnvYbBGf7Y rSiB14kuKNyJEESzHyMKf5N1QHPD+ybtM9R8LoNBHV3PObHgeHP/pHfA14gpV5GfL+ bg/5R6Bwm5KknobmajSAQ7NFHylOBHw23L5YNqFMgI2Dw0hZWoxUtMm73mYfMWQg3A NfS4dniaRcJaKyyV0TTVgWhpfqPiPNdxe0pV3o6qQInnjDBbAUfcWuYYkd5o822/Pn Ihd9CQiKQBTQgLphVCRYj4gFnobLPMlHCJ44Zx6goOqg+ffoeA7O9nEN8oPbx7B62p inTKwZP44f40Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5FF8E694C7; Sun, 18 Jan 2026 23:15:55 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:01 -0700 Message-ID: <20260119061529.3383191-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: W2R7XEQOTBG26RUXWGAMKU342Z4QPIPW X-Message-ID-Hash: W2R7XEQOTBG26RUXWGAMKU342Z4QPIPW 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/23] linux: Add minmax.h with in_range helper List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create linux/minmax.h with in_range(), in_range64(), and in_range32() helper functions for range checking operations. Update ext4_uboot.h to use linux/minmax.h instead of duplicating the in_range definition. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 8 ++----- include/linux/minmax.h | 52 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 include/linux/minmax.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 7ad24732cf4..bfeb31f465c 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -815,12 +815,8 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) #define sb_no_casefold_compat_fallback(sb) ({ (void)(sb); 1; }) #define generic_ci_validate_strict_name(d, n) ({ (void)(d); (void)(n); 1; }) -/* in_range helper - check if value is in range [start, start+len) */ -static inline int in_range(unsigned long val, unsigned long start, - unsigned long len) -{ - return val >= start && val < start + len; -} +/* in_range - use linux/minmax.h */ +#include /* Quota stub */ #define dquot_reclaim_block(i, n) do { } while (0) diff --git a/include/linux/minmax.h b/include/linux/minmax.h new file mode 100644 index 00000000000..52ce477459d --- /dev/null +++ b/include/linux/minmax.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Min/max and related utilities for U-Boot + * + * Based on Linux minmax.h - min, max, clamp, and range helpers. + */ +#ifndef _LINUX_MINMAX_H +#define _LINUX_MINMAX_H + +#include + +/** + * in_range - check if value is within a range + * @val: value to test + * @start: start of range (inclusive) + * @len: length of range + * + * Return: true if @val is in [@start, @start + @len), false otherwise + */ +static inline bool in_range(unsigned long val, unsigned long start, + unsigned long len) +{ + return val >= start && val < start + len; +} + +/** + * in_range64 - check if 64-bit value is within a range + * @val: value to test + * @start: start of range (inclusive) + * @len: length of range + * + * Return: true if @val is in [@start, @start + @len), false otherwise + */ +static inline bool in_range64(u64 val, u64 start, u64 len) +{ + return (val - start) < len; +} + +/** + * in_range32 - check if 32-bit value is within a range + * @val: value to test + * @start: start of range (inclusive) + * @len: length of range + * + * Return: true if @val is in [@start, @start + @len), false otherwise + */ +static inline bool in_range32(u32 val, u32 start, u32 len) +{ + return (val - start) < len; +} + +#endif /* _LINUX_MINMAX_H */ From patchwork Mon Jan 19 06:15: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: 1611 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=1768803365; bh=GiBN7vfd8LA3EkoSWbBaxIamxCeO+vcmj0zBMOwVZyg=; 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=M6fBRaomR7/x4gN5ea5xyHz+W9yFMYxanMtml3NaB0fu3fv6P51clr8l41uuNw6iJ vJwyFirC9nWRcwl2oDpJT57PekRBhTGlQMZsyKuQ/t+ARndXfGeb9W5IuILtz3Qpu5 5dP3kkS2/bGbPNLfG8bEsKGAIUuSK/E3NdYs+083GP/WZYcts5cv8QSnl4r81mTwFT u85yzV5zQfh6CKz8edyHWcTU5G6Na1XU/n9k0AhDl9SI9WxRE6Pv57X5xCBJHFwxMq crVzrAZpVEuA+MlpFGSzvGdvbeEvCraaDRltsovaa2Cu4r8QStsygUwHKD9U8nDdl4 /lVX3Qby2gtww== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E311E6913F for ; Sun, 18 Jan 2026 23:16:05 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lGGIRstx5qoJ for ; Sun, 18 Jan 2026 23:16:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803365; bh=GiBN7vfd8LA3EkoSWbBaxIamxCeO+vcmj0zBMOwVZyg=; 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=M6fBRaomR7/x4gN5ea5xyHz+W9yFMYxanMtml3NaB0fu3fv6P51clr8l41uuNw6iJ vJwyFirC9nWRcwl2oDpJT57PekRBhTGlQMZsyKuQ/t+ARndXfGeb9W5IuILtz3Qpu5 5dP3kkS2/bGbPNLfG8bEsKGAIUuSK/E3NdYs+083GP/WZYcts5cv8QSnl4r81mTwFT u85yzV5zQfh6CKz8edyHWcTU5G6Na1XU/n9k0AhDl9SI9WxRE6Pv57X5xCBJHFwxMq crVzrAZpVEuA+MlpFGSzvGdvbeEvCraaDRltsovaa2Cu4r8QStsygUwHKD9U8nDdl4 /lVX3Qby2gtww== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D0295694C7 for ; Sun, 18 Jan 2026 23:16:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803364; bh=CtqbVfyj0oufBBY4oGx+QTc5Pj62RNU6BjSa8dEtcXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oaqWIHoeSA6egCn3qpELpggDlD73qjkmlw+6lfTy0aHcSoF6sn/OvjaXLix6mmQOJ +5GrsufVPr4ZrNo+5BVB/aFzn+uXY9NGY4pBY8Fmhugpivt7yffa5Ec7ARie13/G83 Z2/Bc3lrqwdQ9shKikCmpswnkdu9zWjM6eUxhc1A4kwMluTGK0iSB8F8LtxZcaqfxF 6hxIl/0jLK7puDHX7gSbflt5NrYr5Oh3tNPPKO6Okp5YyZgjP3oCE0D+OQ1/ZAfvLY OIerHe0r7o8rhTGTzRZFwATiUan24nt/x/3VEPz1eB1yIFQP9NIs4on6w2tYudVb0H wzOKAj/AS/ufg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4F4606913F; Sun, 18 Jan 2026 23:16: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 uc59JhcK4Ype; Sun, 18 Jan 2026 23:16:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803360; bh=pq0bD2IThZgoHAk/GedFDH+JP1MwJmXsel6YbvJchv8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nLRScLJrVFaWU8ggOfxEp9+Lup367bOcZzVmX4nQkOQzBmsrApOLEsO6qth51pUgA vDjTeAs2Q5yYq/KbW/55PmZw9cUU3uO5SMi40EBjSrrV99usqdrp+oUbnCF1gsuWlk CD4Yl8ZdUAj4bgMJYIjBq6oXO+ZFZZIPZM9I6tF50cROxqn7/oQXxyoBP/AYO/Dg5p ISLJuBj/sSJLewaAsXDBoSof5QAD69whvR7+rAe/khQ55DzZLpmwbwQkKuyL++7HV2 NNnXrd1JYHrJg5yt0iy/kLVEHWt7cRTsA05RxS7CwwvBMrRbGgRxGg4W5TrjTqNKmI W2LXlZ8u9np2w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F1D50693AE; Sun, 18 Jan 2026 23:15:59 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:02 -0700 Message-ID: <20260119061529.3383191-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZH6CONUK6JN63HZUHBFOXQAZKVBX6WPQ X-Message-ID-Hash: ZH6CONUK6JN63HZUHBFOXQAZKVBX6WPQ 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/23] linux: Add writeback.h with writeback operation stubs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create linux/writeback.h with wbc_to_tag() function, WB_REASON_* constants, and try_to_writeback_inodes_sb() stub for filesystem writeback control. Update ext4_uboot.h to use linux/writeback.h instead of duplicating these definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 14 +++-------- include/linux/writeback.h | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 include/linux/writeback.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index bfeb31f465c..873f02cf508 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -863,19 +863,11 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) #include #include -/* wbc_to_tag - convert writeback control to pagecache tag */ -static inline xa_mark_t wbc_to_tag(struct writeback_control *wbc) -{ - if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages) - return PAGECACHE_TAG_TOWRITE; - return PAGECACHE_TAG_DIRTY; -} +/* wbc_to_tag, WB_REASON_* - use linux/writeback.h */ +#include /* blk_plug is now in linux/blkdev.h */ -/* Writeback reasons */ -#define WB_REASON_FS_FREE_SPACE 0 - /* address_space_operations is in linux/fs.h */ /* buffer_migrate_folio, buffer_migrate_folio_norefs, noop_dirty_folio are in linux/buffer_head.h */ /* readahead_control, FGP_*, kmap/kunmap, folio stubs are in linux/pagemap.h */ @@ -952,7 +944,7 @@ void mapping_clear_folio_cache(struct address_space *mapping); /* percpu_counter_sub is in linux/percpu_counter.h */ /* Filemap operations are in linux/pagemap.h */ -#define try_to_writeback_inodes_sb(sb, r) do { } while (0) +/* try_to_writeback_inodes_sb is in linux/writeback.h */ /* Buffer operations - additional */ #define getblk_unmovable(bdev, block, size) sb_getblk(bdev->bd_super, block) diff --git a/include/linux/writeback.h b/include/linux/writeback.h new file mode 100644 index 00000000000..e408e3ddebb --- /dev/null +++ b/include/linux/writeback.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Writeback definitions for U-Boot + * + * Based on Linux writeback.h - writeback control and operations. + * U-Boot stub - writeback operations are no-ops. + */ +#ifndef WRITEBACK_H +#define WRITEBACK_H + +#include +#include + +/* Forward declarations */ +struct super_block; +struct writeback_control; + +/* Writeback reasons */ +#define WB_REASON_FS_FREE_SPACE 0 +#define WB_REASON_SYNC 1 +#define WB_REASON_PERIODIC 2 +#define WB_REASON_LAPTOP_TIMER 3 +#define WB_REASON_VMSCAN 4 +#define WB_REASON_FORKER_THREAD 5 + +/** + * wbc_to_tag() - convert writeback control to pagecache tag + * @wbc: writeback control structure + * + * Return: PAGECACHE_TAG_TOWRITE for sync writes, PAGECACHE_TAG_DIRTY otherwise + */ +static inline xa_mark_t wbc_to_tag(struct writeback_control *wbc) +{ + if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages) + return PAGECACHE_TAG_TOWRITE; + return PAGECACHE_TAG_DIRTY; +} + +/** + * try_to_writeback_inodes_sb() - try to start writeback on superblock + * @sb: superblock to writeback + * @reason: reason for writeback + * + * U-Boot stub - no-op since writeback is synchronous. + */ +#define try_to_writeback_inodes_sb(sb, reason) \ + do { (void)(sb); (void)(reason); } while (0) + +#endif /* WRITEBACK_H */ From patchwork Mon Jan 19 06:15:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1612 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803370; bh=5RslPj7gJe9VRZcG2QGz1d/FlSJff3b9iZzTZu4ccvg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZT5+9JJ7Q5xpR5juGls1NJPUUE+p4p5SSVEgFYFgE4jS56YyS4eccNTJu7owLffAN r+q3Z/DLnUTtDrR9avWoFgNjnbNv/M49T4IyNxtu7ybYGNJ1Jfstb1VbRzfHv42hpg TwFK/6TVWp2vDM4QpSuJgYgm236GJU9/1KCPmxgi4kU5otQDR5U1LNKL+UVQnI3vCf V7oZMgHbJB5slLfiWHdTj5hqQuZ/olKMNVnrzEKHrdfyleSEbchOFJb6jmVJeXAwYu +zOA6OJ6xCY8Fbstw9ZXzEuEHa6nxjhqdE/VvlK+yweXwdBgu4rL6wUTmkD3/6pypM 4z5WPodpJYUFw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 745DD6938F for ; Sun, 18 Jan 2026 23:16:10 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id sXQ2mWjykaYm for ; Sun, 18 Jan 2026 23:16:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803370; bh=5RslPj7gJe9VRZcG2QGz1d/FlSJff3b9iZzTZu4ccvg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZT5+9JJ7Q5xpR5juGls1NJPUUE+p4p5SSVEgFYFgE4jS56YyS4eccNTJu7owLffAN r+q3Z/DLnUTtDrR9avWoFgNjnbNv/M49T4IyNxtu7ybYGNJ1Jfstb1VbRzfHv42hpg TwFK/6TVWp2vDM4QpSuJgYgm236GJU9/1KCPmxgi4kU5otQDR5U1LNKL+UVQnI3vCf V7oZMgHbJB5slLfiWHdTj5hqQuZ/olKMNVnrzEKHrdfyleSEbchOFJb6jmVJeXAwYu +zOA6OJ6xCY8Fbstw9ZXzEuEHa6nxjhqdE/VvlK+yweXwdBgu4rL6wUTmkD3/6pypM 4z5WPodpJYUFw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 63F01694C7 for ; Sun, 18 Jan 2026 23:16:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803369; bh=17Mv9xYhKcgU1qhFQfnUozTNhOqgwE7PlgzW6sKJ6mk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v3wqRidc+vAQQNBaToQRtyZRblhlEbt3ZFX5qer5+d6f0YPKlc4FOhBRLy1qDDW6d L1i7eoPqRZYuf4/vrcbMyNarMMadszL9bWITTeS4voYUcBhkinc9aXqJyFh98wTen2 +j8Yn35/NNzO4sNP8RrayaLJ9lRZ2VOWPX+c2YFH9B+JfZQhhKf9LMOJKyhz6VCriY 2uF9aj3UhLDT+jbuXW5rxm6q7DOIXCK7qZJI89gnl9R+wxg9e5UqVbNYR0NzBhjhpf RkACSAYyxt0sr1amJ2uxuXmVeD1i5v0Ffq7CUmKpf2WNLBzAtrvIAf3p02QB2RhkbQ 7fsGRlUNM0yuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1D035694C7; Sun, 18 Jan 2026 23:16:09 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Z9ZCcREEmydf; Sun, 18 Jan 2026 23:16:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803364; bh=s/vz7l4CIdRjUq9HQxZutfrvita5W0/471HMl9HbcpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RT6Oo97emFP4eNsa86S1CSew/bxhUrQNFhVUh7uPnYWYHJt50hOVmBEK8nD1C9MW8 EhVQ0JLmqOluCwWNJQT8ltZmL3yneTZRKr4CmHHj0w0lT8txq8zdAiwNE5tId6xSXR 5HxckCh/Grg5iIQFCB8xMUI6tS30k791TsUm47FQqxeIfZJrFBfGnyypwybVGExXL7 q0NbUUcL4KeV1azwvcXIJRKSg+MrKiSD8O8wurCNlrZNrxhPHB4lM6Gy0CF+5S4qRq yqcHr4t9sSLEWev/P6VZMlQtLqZ9MAOgjwpl4y8tNvtwumOxDNpg9U3QiMSDUwXhju EdKtE3C37rztQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 94835693AE; Sun, 18 Jan 2026 23:16:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:03 -0700 Message-ID: <20260119061529.3383191-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ILOAEFMLUL2TC65XINZXYI5NXREHEVLT X-Message-ID-Hash: ILOAEFMLUL2TC65XINZXYI5NXREHEVLT X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/23] linux: Add iversion.h with inode version stubs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create linux/iversion.h with inode version operation stubs including inode_peek_iversion(), inode_set_iversion(), inode_inc_iversion(), inode_eq_iversion(), and inode_query_iversion(). U-Boot does not track inode versions, so these are all no-ops or return constant values. Update ext4_uboot.h to use linux/iversion.h and remove the inode_set_iversion() implementation from stub.c since it is now a macro. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 14 ++---- fs/ext4l/stub.c | 4 +- include/linux/iversion.h | 96 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 13 deletions(-) create mode 100644 include/linux/iversion.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 873f02cf508..35d1c8125df 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -982,13 +982,9 @@ static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, return ts; } -/* Inode version operations */ -#define inode_peek_iversion_raw(i) (0ULL) -#define inode_peek_iversion(i) (0ULL) +/* Inode version operations - use linux/iversion.h */ +#include #define inode_set_flags(i, f, m) do { } while (0) -#define inode_set_iversion_raw(i, v) do { } while (0) -#define inode_set_iversion_queried(i, v) do { } while (0) -#define inode_inc_iversion(i) do { } while (0) /* Inode credential helpers */ static inline unsigned int i_uid_read(const struct inode *inode) @@ -1062,9 +1058,7 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); /* Readahead operations are in linux/pagemap.h */ -/* Inode version operations */ -#define inode_eq_iversion(i, v) ({ (void)(i); (void)(v); 1; }) -#define inode_query_iversion(i) ({ (void)(i); 0ULL; }) +/* Inode version operations are in linux/iversion.h */ /* dir_emit, dir_relax_shared are in linux/fs.h */ @@ -1344,7 +1338,7 @@ void fs_put_dax(void *dax, void *holder); /* Inode allocation - declaration for stub.c */ void *alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, gfp_t gfp); -void inode_set_iversion(struct inode *inode, u64 version); +/* inode_set_iversion is in linux/iversion.h */ int inode_generic_drop(struct inode *inode); /* rwlock_init is a macro in linux/spinlock.h */ diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index c14132815cd..e223ec21936 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -346,9 +346,7 @@ void *alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, return NULL; } -void inode_set_iversion(struct inode *inode, u64 version) -{ -} +/* inode_set_iversion is now a macro in linux/iversion.h */ /* rwlock_init is now a macro in linux/spinlock.h */ diff --git a/include/linux/iversion.h b/include/linux/iversion.h new file mode 100644 index 00000000000..be0ccc64c6d --- /dev/null +++ b/include/linux/iversion.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Inode version definitions for U-Boot + * + * Based on Linux iversion.h - inode version management. + * U-Boot stub - version tracking not supported. + */ +#ifndef _LINUX_IVERSION_H +#define _LINUX_IVERSION_H + +#include + +/* Forward declarations */ +struct inode; + +/** + * inode_peek_iversion_raw() - read inode version without side effects + * @inode: inode to read + * + * U-Boot stub - always returns 0. + * + * Return: inode version + */ +#define inode_peek_iversion_raw(inode) (0ULL) + +/** + * inode_peek_iversion() - read inode version + * @inode: inode to read + * + * U-Boot stub - always returns 0. + * + * Return: inode version + */ +#define inode_peek_iversion(inode) (0ULL) + +/** + * inode_set_iversion_raw() - set inode version directly + * @inode: inode to modify + * @version: version to set + * + * U-Boot stub - no-op. + */ +#define inode_set_iversion_raw(inode, version) \ + do { (void)(inode); (void)(version); } while (0) + +/** + * inode_set_iversion() - set inode version + * @inode: inode to modify + * @version: version to set + * + * U-Boot stub - no-op. + */ +#define inode_set_iversion(inode, version) \ + do { (void)(inode); (void)(version); } while (0) + +/** + * inode_set_iversion_queried() - set inode version as queried + * @inode: inode to modify + * @version: version to set + * + * U-Boot stub - no-op. + */ +#define inode_set_iversion_queried(inode, version) \ + do { (void)(inode); (void)(version); } while (0) + +/** + * inode_inc_iversion() - increment inode version + * @inode: inode to modify + * + * U-Boot stub - no-op. + */ +#define inode_inc_iversion(inode) do { (void)(inode); } while (0) + +/** + * inode_eq_iversion() - check if inode version matches + * @inode: inode to check + * @version: version to compare + * + * U-Boot stub - always returns true. + * + * Return: true if versions match + */ +#define inode_eq_iversion(inode, version) \ + ({ (void)(inode); (void)(version); true; }) + +/** + * inode_query_iversion() - query inode version + * @inode: inode to query + * + * U-Boot stub - always returns 0. + * + * Return: inode version + */ +#define inode_query_iversion(inode) ({ (void)(inode); 0ULL; }) + +#endif /* _LINUX_IVERSION_H */ From patchwork Mon Jan 19 06:15: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: 1613 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=1768803376; bh=HInUyPZZXrzCVYw18DFJmWfFByqxogZ+yFcXbQop4d0=; 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=ClPd0Nnf4mcH07Q1uq6dimvEbOrM5AkpW4JkuTQYK4/zGzpXDoQV77OIGkAK21xFR 2RsCGOTa86Xupzl9cl+472r6uuin4a19HqhhmY1lgiqQ14gEs7nkUtNkppluUvAXpW qaXkkftJZy2GzMyPcdMXmXgHUY0+RbrEUNRZFiHkN+V6bQYOEKYLxRycKEO+Wh4xqR pLgZyAoZ+Y/4K9k9UQsWQc3YvIB5ufpdabFbRQjv2AMfYhFEPv+ci+sSSSyRQUgIpf HXZR38EoPD8AiB0Ow9PN/St5AAldOUGrGKxtbtzKgSG23r78FnTGU9kx0cmYvKoCy/ PFoQBc7g2sN1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 20B21694D3 for ; Sun, 18 Jan 2026 23:16: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 ZC4WZ0_fUyIA for ; Sun, 18 Jan 2026 23:16:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803376; bh=HInUyPZZXrzCVYw18DFJmWfFByqxogZ+yFcXbQop4d0=; 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=ClPd0Nnf4mcH07Q1uq6dimvEbOrM5AkpW4JkuTQYK4/zGzpXDoQV77OIGkAK21xFR 2RsCGOTa86Xupzl9cl+472r6uuin4a19HqhhmY1lgiqQ14gEs7nkUtNkppluUvAXpW qaXkkftJZy2GzMyPcdMXmXgHUY0+RbrEUNRZFiHkN+V6bQYOEKYLxRycKEO+Wh4xqR pLgZyAoZ+Y/4K9k9UQsWQc3YvIB5ufpdabFbRQjv2AMfYhFEPv+ci+sSSSyRQUgIpf HXZR38EoPD8AiB0Ow9PN/St5AAldOUGrGKxtbtzKgSG23r78FnTGU9kx0cmYvKoCy/ PFoQBc7g2sN1g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0183F6938F for ; Sun, 18 Jan 2026 23:16:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803373; bh=59hFN0o9Y1+raTNSFY3xP3ZuohSMk4+YRPC8quStLqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KiVLXQeUxGHljOZLzl+fNgHgb292TiyTY9Lp35U29ackFCi/WFtotibfD1HGQCh5k uY4ErCpnVEHXkneWAA2tdaucHMdfk1BhO9FIyft7jvCg+WTk8JlGvI+48PjOSj4VdB faiajyGnrKi8Khb0BKpYZvwXGKDIasfoT8VNVKl0EyHMdivp+1NvSqTIXoxZnVoUrM Li7a9z+esoFCHlk/UxHDAEfqooCbHkkbv6UghDMwbwjByBEdYdRU0bQQeqIELy9Tqk +QOgqs425LdsXyRqVjMjVPjfv7Oolc8I0p2KboGZn80QXPoOaghCitoW8uR1QHP6cD /L9xwDzhx5wWQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AE91D6938F; Sun, 18 Jan 2026 23:16: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 phEWBxoqwe0o; Sun, 18 Jan 2026 23:16:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803369; bh=G54qqsU04Q3BRTxidla5w7PvC7LHi+xhgu5FkvXGE9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bl25DmgoGUcvSS6osgEGKWAhdOh+iMemxa0mNyS/ggqSoA0IpiECPJBs4u6MyZO0h zM+GBa2vmSasx3i03+tx78JxU1kixaDa7EeUjtxYdZkeTqFvBjdqKmC0bIbHActI4d 0J1PfkUEiBKPtKijB+Qt/mhIuKHTuTbS5q/eX9ynVfW4mn13dodLSPhply8+MxQnf4 bxVqpLpWxmd6JZw68sDmifWaozcz67NLAdPh/k1rFxDviz8myXZp8+FIlHzm3mfTFC 2KCP1so932/0cuEtBCCiytB5Rqf/28Ms7UgbpZ9DkmzJ4O46hCTpK1I9iAmEf2SFZt pv31fj8vCtLfA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 571A2693AE; Sun, 18 Jan 2026 23:16:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:04 -0700 Message-ID: <20260119061529.3383191-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: J3S3SKDRVGKDONCO5TSILXQJ6RJL547Q X-Message-ID-Hash: J3S3SKDRVGKDONCO5TSILXQJ6RJL547Q 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/23] linux: Add namei.h with pathname lookup flags List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create linux/namei.h with LOOKUP_* flags for pathname resolution operations used by filesystem code. Update ext4_uboot.h to use linux/namei.h instead of duplicating the LOOKUP_FOLLOW definition. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ++-- include/linux/namei.h | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 include/linux/namei.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 35d1c8125df..0b1778ad0a6 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1254,8 +1254,8 @@ void ext4_unregister_li_request(struct super_block *sb); /* Timer and timing stubs are in linux/jiffies.h */ -/* Path lookup flags */ -#define LOOKUP_FOLLOW 0x0001 +/* Path lookup flags - use linux/namei.h */ +#include /* I/O priority classes */ #define IOPRIO_CLASS_BE 2 diff --git a/include/linux/namei.h b/include/linux/namei.h new file mode 100644 index 00000000000..7b66fb242d6 --- /dev/null +++ b/include/linux/namei.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Pathname lookup definitions for U-Boot + * + * Based on Linux namei.h - pathname resolution flags. + */ +#ifndef _LINUX_NAMEI_H +#define _LINUX_NAMEI_H + +/* Pathname lookup flags */ +#define LOOKUP_FOLLOW 0x0001 /* Follow links at end */ +#define LOOKUP_DIRECTORY 0x0002 /* Require a directory */ +#define LOOKUP_AUTOMOUNT 0x0004 /* Force terminal automount */ +#define LOOKUP_EMPTY 0x0008 /* Accept empty path */ +#define LOOKUP_DOWN 0x0020 /* Follow mounts at start */ +#define LOOKUP_MOUNTPOINT 0x0040 /* Follow mounts at end */ +#define LOOKUP_REVAL 0x0080 /* Revalidate cache */ +#define LOOKUP_RCU 0x0100 /* RCU mode */ +#define LOOKUP_CACHED 0x0200 /* Cached lookup only */ +#define LOOKUP_PARENT 0x0400 /* Looking up parent */ +#define LOOKUP_OPEN 0x10000 /* Opening file */ +#define LOOKUP_CREATE 0x20000 /* Creating file */ +#define LOOKUP_EXCL 0x40000 /* Exclusive create */ +#define LOOKUP_RENAME_TARGET 0x80000 /* Rename target */ + +#endif /* _LINUX_NAMEI_H */ From patchwork Mon Jan 19 06:15: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: 1614 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=1768803380; bh=wnjbwPBXM/5sBrTsYjGCH86UjXDa9uCZlqVAAk5k7vg=; 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=slECpbbvdRABX5lQ8UyGRf+RLBUULqvfiEdLk/aSzFt2GD+95/XYUeXCH3KC/KTTE tqTO76wvhXyD1q4fIi9C+JdIJhZ7Qr7XTyi8Cnss7Mc10qUSjgbFvfie07R2B6M60U 7VxdYBCUnPmZCD4ozy9/EXJKzYFSCuqcPwwu+1i3DP/BzwI1lI9xZea7qD8oZy8rq+ xsGflysPzsOY9wXkzWoiJTg+K1at9SVn2EKeXnrTOy4l8ScyT1RQUXIY6ftqsTZxX6 Ffn0DOkV7XVKdIR87pqe+0aJeRXZHoLfYpcrQT316OcA2tNQv20hBhzESJF8B70K4l YmaqbybIDP5cw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F0254694D3 for ; Sun, 18 Jan 2026 23:16: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 sL7uRZm2_Cwe for ; Sun, 18 Jan 2026 23:16:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803380; bh=wnjbwPBXM/5sBrTsYjGCH86UjXDa9uCZlqVAAk5k7vg=; 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=slECpbbvdRABX5lQ8UyGRf+RLBUULqvfiEdLk/aSzFt2GD+95/XYUeXCH3KC/KTTE tqTO76wvhXyD1q4fIi9C+JdIJhZ7Qr7XTyi8Cnss7Mc10qUSjgbFvfie07R2B6M60U 7VxdYBCUnPmZCD4ozy9/EXJKzYFSCuqcPwwu+1i3DP/BzwI1lI9xZea7qD8oZy8rq+ xsGflysPzsOY9wXkzWoiJTg+K1at9SVn2EKeXnrTOy4l8ScyT1RQUXIY6ftqsTZxX6 Ffn0DOkV7XVKdIR87pqe+0aJeRXZHoLfYpcrQT316OcA2tNQv20hBhzESJF8B70K4l YmaqbybIDP5cw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D7567694C7 for ; Sun, 18 Jan 2026 23:16:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803378; bh=3NsbWntPdnkDy5W7/tV8xyH2QOKS8UF8lAQaz/02sDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eDNWw6vMbdny8Fuzq1SX/6HwbNAXROA6StZnNMM2TpmQ1kpdRZZjXWkLX3S/XtzFG Bzi+xjxkoLu/XFMFyL0FeypN0oIrkalbW1v6gtGbDlKKnkU545ZeZfHlbwZwu/HtX3 PbIN9btVyqvOfG0zg+RvRDPbraCSFQyo2BwvT0I+SNFGhHPLY95BdA0K9Y8RqXlzQS zbT7hnPpxw4WBl8Q0NSZ0ow8MkEpQ22XhuNteD0clT+l6LJSU7MPp1NJpABa0LzwIf ZGYJMZlpjdmdDPWgp2JkBACGiltGtrl5zR64euOUxYj8tBLzNXEeaQqrMS42VFeZY+ hqYMlDuVQJ03w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 540E8694CE; Sun, 18 Jan 2026 23:16: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 oqkejP9x3xeB; Sun, 18 Jan 2026 23:16:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803374; bh=SYY5HsEIDt24tT6xJEwFiWDn03i9I+uaaOujemOTOoY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RqX5gWg8QcIaklwgnv/UEzSPNnTyge6FyBpLdvc7YQyQJNNv2itq+GZdJAh8+akPB UOPZJoJbDDTLuDVW5LQfpBfDrJTQYdgSYqXqhiX7k9hr40pJfTmI4cI/dxnfDpW1nG 4TQVm5BChxWgTxUupNNDcLYnADcvr1+p/OkaJxga64Qihdtw/Jn1dmmRjKIO+2IcNj zI/VMFoCy3LWPy3VraJcEeCiu/uSyi5sIp1VdFxJBdxcTdRdMrrjic8cVovproQTkk z5vfivCvazBLslpxlzUolMwh96tR39eda/QngYm3TYOMGvyFoFsYy7KKpPgZJYLhJ0 rezE7YsEmHU5Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EE33B693AE; Sun, 18 Jan 2026 23:16:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:05 -0700 Message-ID: <20260119061529.3383191-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MAT73LWDSLSAX7M3S5HL2RKB44OLICBR X-Message-ID-Hash: MAT73LWDSLSAX7M3S5HL2RKB44OLICBR 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/23] linux: Add fsverity.h with fs-verity stubs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create linux/fsverity.h with fs-verity operation stubs including IS_VERITY(), fsverity_file_open(), fsverity_prepare_setattr(), fsverity_active(), fsverity_cleanup_inode(), fsverity_verify_bio(), fsverity_enqueue_verify_work(), and fsverity_verify_folio(). U-Boot does not support fs-verity, so these are all no-ops or return constant values indicating no verification. Update ext4_uboot.h to use linux/fsverity.h instead of duplicating these definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 16 +++---- include/linux/fsverity.h | 97 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 11 deletions(-) create mode 100644 include/linux/fsverity.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 0b1778ad0a6..dc8c9a97877 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -920,7 +920,8 @@ void mapping_clear_folio_cache(struct address_space *mapping); #include /* fscrypt_file_open is in ext4_fscrypt.h */ -#define fsverity_file_open(i, f) ({ (void)(i); (void)(f); 0; }) +/* fsverity_file_open is in linux/fsverity.h */ +#include /* Quota file open - stub */ #define dquot_file_open(i, f) ({ (void)(i); (void)(f); 0; }) @@ -963,9 +964,7 @@ void mapping_clear_folio_cache(struct address_space *mapping); /* 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; }) -#define fsverity_active(i) (0) +/* fsverity stubs are in linux/fsverity.h */ /* Inode time setters - needed for ext4.h */ static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode, @@ -1351,8 +1350,7 @@ int inode_generic_drop(struct inode *inode); #define invalidate_inode_buffers(i) do { } while (0) #define clear_inode(i) do { } while (0) -/* fsverity stubs (fscrypt macros are in ext4_fscrypt.h) */ -#define fsverity_cleanup_inode(i) do { } while (0) +/* fsverity_cleanup_inode is in linux/fsverity.h */ /* NFS export helpers are now in linux/exportfs.h */ @@ -1610,11 +1608,7 @@ bool __folio_start_writeback(struct folio *folio, bool keep_write); /* fscrypt readpage stubs are in ext4_fscrypt.h */ -/* fsverity stubs */ -#define fsverity_verify_bio(bio) do { (void)(bio); } while (0) -#define fsverity_enqueue_verify_work(work) do { (void)(work); } while (0) -#define fsverity_verify_folio(f) ({ (void)(f); 1; }) -#define IS_VERITY(inode) (0) +/* fsverity stubs are in linux/fsverity.h */ /* readahead operations are in linux/pagemap.h */ diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h new file mode 100644 index 00000000000..738bea02d3e --- /dev/null +++ b/include/linux/fsverity.h @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * fs-verity definitions for U-Boot + * + * Based on Linux fsverity.h - fs-verity verification. + * U-Boot stub - fs-verity not supported. + */ +#ifndef _LINUX_FSVERITY_H +#define _LINUX_FSVERITY_H + +/* Forward declarations */ +struct bio; +struct dentry; +struct file; +struct folio; +struct iattr; +struct inode; +struct work_struct; + +/** + * IS_VERITY() - check if inode has fs-verity enabled + * @inode: inode to check + * + * U-Boot stub - always returns false. + */ +#define IS_VERITY(inode) (0) + +/** + * fsverity_file_open() - check verity on file open + * @inode: inode being opened + * @file: file being opened + * + * U-Boot stub - always succeeds. + * + * Return: 0 + */ +#define fsverity_file_open(inode, file) \ + ({ (void)(inode); (void)(file); 0; }) + +/** + * fsverity_prepare_setattr() - prepare for attribute change + * @dentry: dentry being modified + * @attr: new attributes + * + * U-Boot stub - always succeeds. + * + * Return: 0 + */ +#define fsverity_prepare_setattr(dentry, attr) \ + ({ (void)(dentry); (void)(attr); 0; }) + +/** + * fsverity_active() - check if verity is active on inode + * @inode: inode to check + * + * U-Boot stub - always returns false. + * + * Return: false + */ +#define fsverity_active(inode) ({ (void)(inode); 0; }) + +/** + * fsverity_cleanup_inode() - cleanup verity data on inode + * @inode: inode to clean up + * + * U-Boot stub - no-op. + */ +#define fsverity_cleanup_inode(inode) do { (void)(inode); } while (0) + +/** + * fsverity_verify_bio() - verify bio data + * @bio: bio to verify + * + * U-Boot stub - no-op. + */ +#define fsverity_verify_bio(bio) do { (void)(bio); } while (0) + +/** + * fsverity_enqueue_verify_work() - enqueue verification work + * @work: work item + * + * U-Boot stub - no-op. + */ +#define fsverity_enqueue_verify_work(work) \ + do { (void)(work); } while (0) + +/** + * fsverity_verify_folio() - verify folio data + * @folio: folio to verify + * + * U-Boot stub - always succeeds. + * + * Return: true (verified) + */ +#define fsverity_verify_folio(folio) ({ (void)(folio); true; }) + +#endif /* _LINUX_FSVERITY_H */ From patchwork Mon Jan 19 06:15: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: 1615 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=1768803386; bh=Mic27KilWgc8xUHQaIEJq5EHmfHR0FH3w39ryte6fKU=; 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=kLD/SzJvlcxgbprI8s6o6P77M1FmV2bAVnhdfz+SN8dXTCtYq5swb79MP/1W3W1WU oYqONET4aKSX7vDDUziTmrGQsSI5U44Sp51SNsCAPBz6UmtNT8/KADn1MyDp4ewoE7 tfJItOc98lnyu2rkjd+DHMG0MyBRQ2qTrJiYkN4tmO/wYq40aJ1GzxJFPb+3yDLmZa psoYoJ7G8KpP9umV7NvBrdjXcx39FdgrkuvfaPIZ+9nqOXfZEpZ/uD71YuTdZQsnxC 1QEK3Xil71a4DpbRHGKlYl/Wk0aaFfrR8lwyBLEkFcU7GcgJPyO2BHl2mniB2I1xRF gdZLC9yJc2GtA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1FAD6694D3 for ; Sun, 18 Jan 2026 23:16: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 lFM4F2_2uoQX for ; Sun, 18 Jan 2026 23:16:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803386; bh=Mic27KilWgc8xUHQaIEJq5EHmfHR0FH3w39ryte6fKU=; 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=kLD/SzJvlcxgbprI8s6o6P77M1FmV2bAVnhdfz+SN8dXTCtYq5swb79MP/1W3W1WU oYqONET4aKSX7vDDUziTmrGQsSI5U44Sp51SNsCAPBz6UmtNT8/KADn1MyDp4ewoE7 tfJItOc98lnyu2rkjd+DHMG0MyBRQ2qTrJiYkN4tmO/wYq40aJ1GzxJFPb+3yDLmZa psoYoJ7G8KpP9umV7NvBrdjXcx39FdgrkuvfaPIZ+9nqOXfZEpZ/uD71YuTdZQsnxC 1QEK3Xil71a4DpbRHGKlYl/Wk0aaFfrR8lwyBLEkFcU7GcgJPyO2BHl2mniB2I1xRF gdZLC9yJc2GtA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0DC30694C7 for ; Sun, 18 Jan 2026 23:16:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803383; bh=O1Wu+zICDVqp+9npmdu0HSamute3K2Era+RWDJCKMOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c/uklxMz/cVWD5cRukvZZ/7PdKhSQY2zx74Nc5eCRV4O+KoKj/LuBexLclKButMBw Ib9Bx44ufRHwAB5RsoRkh2c8pZXV/05YL1rNXLjcO7juztLj9g1OJDu+/31yp+Ay3K u5pNa0c5QVikSAUGLO9QeT1px3+zrtJio4scZpbsLb09q8tTlRcMArd60y2zL/nvb2 s5l7ohL3ZaFzGMUsSMP4DS1a1Ahas8bEnuKEisKRdatB0IONDZbLLB/vfcr+kxOamm VahkyE74c4m4n0RTiejsYz7u0J6d/WuYbrRjjdQFnFGM4seJmfrWgko/M8cWgvpm1o nvkBllanWmvZg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 112C6694C0; Sun, 18 Jan 2026 23:16: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 10026) with ESMTP id V_lN2Vrf0IL8; Sun, 18 Jan 2026 23:16:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803378; bh=x/8M1NJlwPu4F/3qLqCfUUNiMDoX0GeWVYuoDHz+JP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m4vAHg2nDHACdkfsZtXRkUBcpPHX9emoSUYox/7C/Px4QbGEkiVwk2nZbqcu5LogI 6DDQKIOHYeV/uQCbrnaC/hN2CavyRbwyf1Avxt8sfWRXu7MvTEeTtEGx145YaVFP+z EbKsSMa0gfwCR8PwuWnVZOXrltx7XFYBiUsY1jGbkfGmLF1CrbsPeWJ/JfEJLPdtqm /GTiwwDj2/GPh7HBEsqxQgMVF8v9YMHXhg69CBXz+GcdYHcwCKtGVvXDIzU7/ao/DI sHHvOS+Dar6jXqH6wjdXtTt6sHp1eYtaBr//2ADXQZ1tyqT1ALCqBLMeOaIHtHP5Jb tB1oBKDiArtgA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 98246693AE; Sun, 18 Jan 2026 23:16:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:06 -0700 Message-ID: <20260119061529.3383191-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KSZRQXFMGDDMO2U2RNDR5GFOFH5XGOAM X-Message-ID-Hash: KSZRQXFMGDDMO2U2RNDR5GFOFH5XGOAM 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/23] linux: quotaops: Add more quota operation 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 Extend linux/quotaops.h with additional quota stubs needed by ext4l: - dquot_alloc_block_nofail, dquot_alloc_block, dquot_free_block - dquot_claim_block, dquot_reclaim_block, dquot_reserve_block - dquot_release_reservation_block, dquot_initialize_needed - dquot_alloc_space_nodirty, dquot_free_space_nodirty - is_quota_modification, dquot_writeback_dquots - sb_any_quota_suspended The block allocation macros update inode->i_blocks to track allocated blocks without actual quota enforcement. Update ext4_uboot.h to use linux/quotaops.h and remove the function implementations from stub.c since they are now macros. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 35 +++++-------------------- fs/ext4l/stub.c | 30 +-------------------- include/linux/quotaops.h | 56 +++++++++++++++++++++++++++++++++------- 3 files changed, 54 insertions(+), 67 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index dc8c9a97877..83dcf772c45 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -239,13 +239,8 @@ struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); /* Group permission - stub */ #define in_group_p(gid) (0) -/* 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) +/* Quota operations - use linux/quotaops.h */ +#include /* icount - inode reference count */ #define icount_read(inode) (1) @@ -818,8 +813,7 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) /* in_range - use linux/minmax.h */ #include -/* Quota stub */ -#define dquot_reclaim_block(i, n) do { } while (0) +/* dquot_reclaim_block is in linux/quotaops.h */ /* fiemap stubs are now in linux/fiemap.h */ @@ -923,8 +917,7 @@ void mapping_clear_folio_cache(struct address_space *mapping); /* fsverity_file_open is in linux/fsverity.h */ #include -/* Quota file open - stub */ -#define dquot_file_open(i, f) ({ (void)(i); (void)(f); 0; }) +/* dquot_file_open is in linux/quotaops.h */ /* Inode I/O list management */ #define inode_io_list_del(inode) do { } while (0) @@ -934,13 +927,7 @@ void mapping_clear_folio_cache(struct address_space *mapping); /* Folio operations and writeback stubs are in linux/pagemap.h */ #define folio_batch_release(fb) do { } while (0) -/* Quota stubs - additional */ -#define dquot_claim_block(i, n) ({ (void)(i); (void)(n); 0; }) -#define dquot_reserve_block(i, n) ({ (void)(i); (void)(n); 0; }) -#define dquot_release_reservation_block(i, n) do { } while (0) -#define dquot_initialize_needed(i) (0) -#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; }) +/* Quota stubs are in linux/quotaops.h */ /* percpu_counter_sub is in linux/percpu_counter.h */ @@ -1455,12 +1442,7 @@ 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 - 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); -void dquot_free_block(struct inode *inode, loff_t nr); +/* Quota operations are in linux/quotaops.h */ /* Block device file operations - stubs */ #define set_blocksize(f, size) ({ (void)(f); (void)(size); 0; }) @@ -1468,10 +1450,7 @@ struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned /* 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) -#define dquot_resume(sb, type) do { (void)(sb); (void)(type); } while (0) -#define sb_any_quota_suspended(sb) ({ (void)(sb); 0; }) +/* Quota stubs for super.c are in linux/quotaops.h */ /* * Stubs for mballoc.c diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index e223ec21936..bdb8b8bb675 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -620,35 +620,7 @@ long ext4_ioctl(struct file *file, unsigned int cmd, unsigned long arg) /* nop_mnt_idmap - no-op mount ID map for xattr.c */ struct mnt_idmap nop_mnt_idmap; -/* Quota stubs for xattr.c */ -int dquot_alloc_space_nodirty(struct inode *inode, loff_t size) -{ - return 0; -} - -void dquot_free_space_nodirty(struct inode *inode, loff_t size) -{ -} - -int dquot_alloc_block(struct inode *inode, loff_t nr) -{ - /* - * Update i_blocks to reflect the allocated blocks. - * i_blocks is in 512-byte units, so convert from fs blocks. - */ - inode->i_blocks += nr << (inode->i_blkbits - 9); - - return 0; -} - -void dquot_free_block(struct inode *inode, loff_t nr) -{ - /* - * Update i_blocks to reflect the freed blocks. - * i_blocks is in 512-byte units, so convert from fs blocks. - */ - inode->i_blocks -= nr << (inode->i_blkbits - 9); -} +/* Quota stubs are now macros in linux/quotaops.h */ /* * JBD2 stubs - temporary stubs until other jbd2 files are added diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 04988ace843..b32e7b7ab70 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -6,27 +6,62 @@ * Author: Marco van Wieringen * * Stub definitions for quota operations. - * U-Boot doesn't support disk quotas. + * U-Boot does not support disk quotas. */ #ifndef _LINUX_QUOTAOPS_H #define _LINUX_QUOTAOPS_H +#include + struct inode; struct dentry; struct kqid; +struct mnt_idmap; +struct iattr; +struct super_block; + +/* Quota initialisation and cleanup */ +#define dquot_initialize(inode) ({ (void)(inode); 0; }) +#define dquot_initialize_needed(inode) (0) +#define dquot_drop(inode) do { (void)(inode); } while (0) + +/* Inode quota operations */ +#define dquot_alloc_inode(inode) ({ (void)(inode); 0; }) +#define dquot_free_inode(inode) do { (void)(inode); } while (0) -#define dquot_initialize(inode) 0 -#define dquot_drop(inode) do { } while (0) -#define dquot_alloc_inode(inode) 0 -#define dquot_free_inode(inode) do { } while (0) -#define dquot_transfer(inode, attr) 0 +/* Block quota operations */ +#define dquot_alloc_block(inode, nr) \ + ({ (inode)->i_blocks += (nr) << ((inode)->i_blkbits - 9); 0; }) +#define dquot_alloc_block_nofail(inode, nr) \ + ({ (inode)->i_blocks += (nr) << ((inode)->i_blkbits - 9); 0; }) +#define dquot_free_block(inode, nr) \ + do { (inode)->i_blocks -= (nr) << ((inode)->i_blkbits - 9); } while (0) +#define dquot_claim_block(inode, nr) ({ (void)(inode); (void)(nr); 0; }) +#define dquot_reclaim_block(inode, nr) do { } while (0) +#define dquot_reserve_block(inode, nr) ({ (void)(inode); (void)(nr); 0; }) +#define dquot_release_reservation_block(inode, nr) \ + do { (void)(inode); (void)(nr); } while (0) + +/* Space quota operations */ +#define dquot_alloc_space_nodirty(inode, size) ({ (void)(inode); (void)(size); 0; }) +#define dquot_free_space_nodirty(inode, size) do { (void)(inode); (void)(size); } while (0) #define dquot_claim_space_nodirty(inode, nr) 0 #define dquot_reclaim_space_nodirty(inode, nr) do { } while (0) -#define dquot_disable(sb, type, flags) 0 -#define dquot_suspend(sb, type) 0 -#define dquot_resume(sb, type) 0 -#define dquot_file_open(inode, file) 0 +/* Transfer and modification checks */ +#define dquot_transfer(idmap, inode, attr) \ + ({ (void)(idmap); (void)(inode); (void)(attr); 0; }) +#define is_quota_modification(idmap, inode, attr) \ + ({ (void)(idmap); (void)(inode); (void)(attr); 0; }) + +/* Quota control */ +#define dquot_disable(sb, type, flags) 0 +#define dquot_suspend(sb, type) ({ (void)(sb); (void)(type); 0; }) +#define dquot_resume(sb, type) do { (void)(sb); (void)(type); } while (0) +#define dquot_writeback_dquots(sb, type) do { (void)(sb); (void)(type); } while (0) +#define dquot_file_open(inode, file) ({ (void)(inode); (void)(file); 0; }) + +/* Quota status queries */ #define sb_has_quota_usage_enabled(sb, type) 0 #define sb_has_quota_limits_enabled(sb, type) 0 #define sb_has_quota_suspended(sb, type) 0 @@ -34,5 +69,6 @@ struct kqid; #define sb_has_quota_active(sb, type) 0 #define sb_any_quota_loaded(sb) 0 #define sb_any_quota_active(sb) 0 +#define sb_any_quota_suspended(sb) ({ (void)(sb); 0; }) #endif /* _LINUX_QUOTAOPS_H */ From patchwork Mon Jan 19 06:15: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: 1616 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=1768803390; bh=Zu6yAPrPDxm+Nywy8AHPcWuip2LJvr7NHZVp7qjhR5g=; 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=HTkbfokc8nR4MbNSoaV6RTW9ZGh7t/3D6iZtDaHEXcRaV6m0xrogPDZCMTsZPWW++ o4QBUu2CL5OIvArldp18Q0EyyE39b2DhuDLevwF6LVHwYN+RP70hnZ/z1h0ALdxVl5 LgJtUQxghg02oY6WEU87vDJmmhPRoAiLkPc2LMyFJgKXZq7PEsHo7IRmsWLSyqbwNy cBAtlMmY+5WQhlSa4eP5tdg5Zb4sua0kemDdWAIyuNvFjaUTmd+lyjDoo57+8nComm s8SusHah60FyIQfrEPcqEDnZrNpQCoNlkrU+8duEIhXQU3RwKWx1wZRBj7BSEAfd63 6QZv4oWTXvJEA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A2D24694D3 for ; Sun, 18 Jan 2026 23:16:30 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id OgoKBE8TRkIK for ; Sun, 18 Jan 2026 23:16:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803390; bh=Zu6yAPrPDxm+Nywy8AHPcWuip2LJvr7NHZVp7qjhR5g=; 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=HTkbfokc8nR4MbNSoaV6RTW9ZGh7t/3D6iZtDaHEXcRaV6m0xrogPDZCMTsZPWW++ o4QBUu2CL5OIvArldp18Q0EyyE39b2DhuDLevwF6LVHwYN+RP70hnZ/z1h0ALdxVl5 LgJtUQxghg02oY6WEU87vDJmmhPRoAiLkPc2LMyFJgKXZq7PEsHo7IRmsWLSyqbwNy cBAtlMmY+5WQhlSa4eP5tdg5Zb4sua0kemDdWAIyuNvFjaUTmd+lyjDoo57+8nComm s8SusHah60FyIQfrEPcqEDnZrNpQCoNlkrU+8duEIhXQU3RwKWx1wZRBj7BSEAfd63 6QZv4oWTXvJEA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 90D05694C7 for ; Sun, 18 Jan 2026 23:16:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803388; bh=X7r/tZHNNuVMKUG5zG+sfBle+GwUCEPXijAuBkt0w+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PPASOKcXhrukq986LKUWw613QxRF+gbPLj9NUSwibP/BM+5BcGHs3saR6DLJUx/Wh 8G6NpzR5kMOaEiY+z2T12sZ9t66h0FbxHYgxXL7nul8hie+nCIRcIgGgFdZSiizAOe RjITzL1bFOO9cFdS9IE3hMSLWlAQitbDA1VDd3NUhWlhpifUn1XMyz0hsfLAxs4QUV 3Z9onJk+csMxZjAM4fPYOzCp4J087ikK+K4cR5MsA/WTlSR8mBUTWDaGWv2IYw6PkY yZ6/yxsHGHu+FZrgeUF5IQK8R1cob0KbPRaItwQ1AC7C9EbbvzvSCrfJ1g9eakFLpV nBvWN8fF4PnLQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 91773694C7; Sun, 18 Jan 2026 23:16:28 -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 jSyCUzds_66a; Sun, 18 Jan 2026 23:16:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803383; bh=1Xg50rSD3uB/VdrdJ/eednEThNWhytnoh9EYesus24w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r4mpQNCVbuDyjEJQSwyV+bvGtFIyhFEp8S03p9L9Zxq5gxZmzq93EZFqnRuj/vXVA yYi3u5z9jwey8Bs6E794HTsV3djUpViDm0k/hRcjDYPQHOnGdLLEam6auMsVa1gcMB vdARVURqZpzeDK31Hr3e7h8Rzp73K4GJr+Vs8UKSy0LgydiQNyS20t6Akr+L3zSu7b hOZOHk27asc7TUDwxaYJF6z46EH3MNVca7aPRf1YXYWBKh7T49RfgceKxVKoedxdbM dCtHpIwWdOP3oomnAKRxWproxPwoIu0oRwVxPBhsK+qES6uVRTRKRXE/4zygXNbWuF 0BRt7rCblkjFg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 54E98693AE; Sun, 18 Jan 2026 23:16:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:07 -0700 Message-ID: <20260119061529.3383191-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YSKV6LGGRYPHJJBRP7LPRGKJOTXHBBKZ X-Message-ID-Hash: YSKV6LGGRYPHJJBRP7LPRGKJOTXHBBKZ 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/23] linux: Add ioprio.h with I/O priority 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 Create linux/ioprio.h with I/O priority class definitions and helper macros including IOPRIO_CLASS_*, IOPRIO_PRIO_VALUE(), IOPRIO_PRIO_CLASS(), get_current_ioprio(), and set_task_ioprio(). Update ext4_uboot.h to use linux/ioprio.h and remove the function implementations from stub.c since they are now macros. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 13 ++++----- fs/ext4l/stub.c | 10 +------ include/linux/ioprio.h | 64 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 include/linux/ioprio.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 83dcf772c45..aae248a6930 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1243,8 +1243,8 @@ void ext4_unregister_li_request(struct super_block *sb); /* Path lookup flags - use linux/namei.h */ #include -/* I/O priority classes */ -#define IOPRIO_CLASS_BE 2 +/* I/O priority classes - use linux/ioprio.h */ +#include /* SB_INLINECRYPT, SB_SILENT, SB_POSIXACL are in linux/fs.h */ #define SB_I_CGROUPWB 0 /* Not supported in U-Boot */ @@ -1343,8 +1343,7 @@ int inode_generic_drop(struct inode *inode); /* Path operations - path_put, d_path are in linux/path.h */ -/* I/O priority - declaration for stub.c */ -int IOPRIO_PRIO_VALUE(int class, int data); +/* I/O priority stubs are in linux/ioprio.h */ /* kmemdup_nul is in linux/slab.h */ /* fscrypt declarations are in ext4_fscrypt.h */ @@ -1393,8 +1392,7 @@ unsigned int bdev_max_discard_sectors(struct block_device *bdev); /* bgl_lock_init is now in linux/blockgroup_lock.h */ -/* Task I/O priority - declaration for stub.c */ -void set_task_ioprio(void *task, int ioprio); +/* set_task_ioprio is in linux/ioprio.h */ /* Superblock identity functions */ static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, @@ -1617,8 +1615,7 @@ bool __folio_start_writeback(struct folio *folio, bool keep_write); /* d_alloc, d_drop are now in linux/dcache.h */ -/* get_current_ioprio - I/O priority (not used in U-Boot) */ -#define get_current_ioprio() (0) +/* get_current_ioprio is in linux/ioprio.h */ /* JBD2 checkpoint.c stubs */ #define mutex_lock_io(m) mutex_lock(m) diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index bdb8b8bb675..1b9c72a6cc2 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -400,15 +400,7 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func) return 1; } -/* I/O priority */ -int IOPRIO_PRIO_VALUE(int class, int data) -{ - return (class << 13) | data; -} - -void set_task_ioprio(void *task, int ioprio) -{ -} +/* I/O priority stubs are now in linux/ioprio.h */ /* ext4_fc_init is now in fast_commit.c */ diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h new file mode 100644 index 00000000000..2cec5cac818 --- /dev/null +++ b/include/linux/ioprio.h @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * I/O priority definitions for U-Boot + * + * Based on Linux ioprio.h - I/O scheduling priority. + * U-Boot stub - I/O priority not supported. + */ +#ifndef IOPRIO_H +#define IOPRIO_H + +/* I/O priority classes */ +#define IOPRIO_CLASS_NONE 0 +#define IOPRIO_CLASS_RT 1 +#define IOPRIO_CLASS_BE 2 +#define IOPRIO_CLASS_IDLE 3 + +/* I/O priority levels (0-7, lower is higher priority) */ +#define IOPRIO_NR_LEVELS 8 +#define IOPRIO_BE_NR IOPRIO_NR_LEVELS + +/** + * IOPRIO_PRIO_VALUE() - create I/O priority value from class and level + * @class: I/O priority class + * @data: priority level within class + * + * Return: encoded priority value + */ +#define IOPRIO_PRIO_VALUE(class, data) (((class) << 13) | (data)) + +/** + * IOPRIO_PRIO_CLASS() - extract class from priority value + * @ioprio: encoded priority + * + * Return: I/O priority class + */ +#define IOPRIO_PRIO_CLASS(ioprio) (((ioprio) >> 13) & 0x3) + +/** + * IOPRIO_PRIO_DATA() - extract data/level from priority value + * @ioprio: encoded priority + * + * Return: priority level + */ +#define IOPRIO_PRIO_DATA(ioprio) ((ioprio) & 0x1fff) + +/** + * get_current_ioprio() - get I/O priority of current task + * + * U-Boot stub - always returns 0. + * + * Return: I/O priority value + */ +#define get_current_ioprio() (0) + +/** + * set_task_ioprio() - set I/O priority of a task + * @task: task to modify (ignored) + * @ioprio: priority to set (ignored) + * + * U-Boot stub - no-op. + */ +#define set_task_ioprio(task, ioprio) do { (void)(task); (void)(ioprio); } while (0) + +#endif /* IOPRIO_H */ From patchwork Mon Jan 19 06:15: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: 1617 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=1768803394; bh=MsKl1hXQFNGH6dcUNeAA6gdYWq5diK01atbBumljVg0=; 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=tCrZXEdVn6JBcyOeHynkthBi2u/dznVJnP8an3kUG6BSCT9JjTXerfgTQv6viy4sC o3Q3EhvKS3rp8SrE/et7oei/rkkvsAlRBREs70T9zGFUq/3hXnWYWhAJc+gx3UwuGZ ZKMGzNNfqUcf6C+FTJxC1vu531DdQO7wuWZygh9e9lG0fGP2dZYhNZGxqzAcuOskjQ yWpQSZjeFisSAdW/s4ZXs0EcWpkJy/3u7e61D2DdDDGLby5nWqKXXkjI8HopMAKAna /BbpdpXShxZYD7JKQp71HKGdiI7la/uxfQvQHrtWfOUAmBp4TxCId8ez26gF4vxt+0 5pCv+p2aIY08A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 35001694D3 for ; Sun, 18 Jan 2026 23:16:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id iheU7McXa_H1 for ; Sun, 18 Jan 2026 23:16:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803394; bh=MsKl1hXQFNGH6dcUNeAA6gdYWq5diK01atbBumljVg0=; 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=tCrZXEdVn6JBcyOeHynkthBi2u/dznVJnP8an3kUG6BSCT9JjTXerfgTQv6viy4sC o3Q3EhvKS3rp8SrE/et7oei/rkkvsAlRBREs70T9zGFUq/3hXnWYWhAJc+gx3UwuGZ ZKMGzNNfqUcf6C+FTJxC1vu531DdQO7wuWZygh9e9lG0fGP2dZYhNZGxqzAcuOskjQ yWpQSZjeFisSAdW/s4ZXs0EcWpkJy/3u7e61D2DdDDGLby5nWqKXXkjI8HopMAKAna /BbpdpXShxZYD7JKQp71HKGdiI7la/uxfQvQHrtWfOUAmBp4TxCId8ez26gF4vxt+0 5pCv+p2aIY08A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 242CC694C0 for ; Sun, 18 Jan 2026 23:16:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803393; bh=Hajwb8UGn2sWuC+Wo+UqDmk8pHTpBVBxdjQyr56ShMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VOqP5G+uFlb1RCK0I8VB3pvNSllu5fsyxtGax1nwMeFp3cCAcP2XIm7xCTPGAku9M tpGo/Kp0VK8BgbI8+yF2x0nhjJdnl1GKjdDFSWqz5T/DM1UVxxJs2o1PkZSQiRdT3o Qyw2FyjrK0At+pnDSaz5zcGvHyhZDg+7QBcL1mqTyBS5HPY3YCqd20pfcq0ok4Tezg mAuz+X4yVKHMlvupstifK72atwnj7+Ik+q4kkYsTcHz10WawV/yMSZSIWsCeA9mqwB EyIo87CM186jcJmyhWjZSq32TgXhD9kIC80wZHEffg5yxdfWsbfVuMkn6PwJwIT/sL cYxFNu6NDES0w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 15EFE693AE; Sun, 18 Jan 2026 23:16: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 kE6Gm0ZKzoXs; Sun, 18 Jan 2026 23:16:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803388; bh=5TBcRqJ7WQKu28mnALMfM7NIct+1QrMWViIUeTEtvNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KdWwP4jFLSEw0yx9bc/no42SHA9yw+k+zVGF6yCPDWk90DCDEKwF7DVitT5azjMgq y5SCaquo25tRBchTxEwta8E4B7QlcsAlzqXDYCIok3qCVCjolJVlf1CZ1xR4Sc0FJG eGDv+wbn2PewZCfvzCVnzD87yknUCfBG8TDhqQovMEmK2HKFev9wBz/UQCLDyqiVZv XEshhwy6ShvkvyioLnv/Xm78zKUXBLk/Wl+cDRGJNEfcEvDzzxd/7exBJveSngmmP3 z6tOueR2+3LQcgXwUGdr6CrewMtix8TgrVnIwYKfgVIBsja18twUqpKKu4D0k/1X1B yLa2Qs3+llGNA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 17921694C0; Sun, 18 Jan 2026 23:16:28 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:08 -0700 Message-ID: <20260119061529.3383191-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LQU2OHTLN643WQP7UWG66ZIXXEKWHAGS X-Message-ID-Hash: LQU2OHTLN643WQP7UWG66ZIXXEKWHAGS 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/23] ext4l: Move rwsem_is_locked to linux/rwsem.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 rwsem_is_locked() stub macro to linux/rwsem.h where it belongs with other rwsem operations. This reduces duplication in ext4_uboot.h and places the definition with related rwsem functions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 +-- include/linux/rwsem.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index aae248a6930..58479ccb2fe 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -758,8 +758,7 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) /* extents.c stubs */ -/* rwsem is_locked stub */ -#define rwsem_is_locked(sem) (1) +/* rwsem_is_locked is in linux/rwsem.h */ /* Buffer operations */ #define sb_getblk_gfp(sb, blk, gfp) sb_getblk((sb), (blk)) diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index ea70829d135..7beaf5062ed 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -24,5 +24,6 @@ struct rw_semaphore { #define down_write_trylock(sem) 1 #define up_write(sem) do { } while (0) #define downgrade_write(sem) do { } while (0) +#define rwsem_is_locked(sem) (1) #endif /* _LINUX_RWSEM_H */ From patchwork Mon Jan 19 06:15: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: 1618 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=1768803399; bh=8TK1XugpPlhdZE79MQE+xO8zZTJ8wNZg1ezuXzsF1Ro=; 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=B2dUStxcmFOILKdkBcLzOGZtF2N31QNC7zmEfrOF7UDMwUwim7Rm7vSRMiRi7RO9p wfOr4XXiCCeYMXewPL1KJxgslWZo2qB1UHGZPmcgW9UVCcg9WM5jG9FfbT0JoUIjbH CidwHN2eBj6ek7McFugTBeh0LVZ7hYJverTZ6f6c20a2zhCIsUd+7yKKwTK9tHZnCk e7RR5Buefu2VHK6sX/e+yYnsKg3rEQmup4XlRjFrRHzh+9lD5oasKljXapIz74VMoI VqO8suN43hIjHUwcFZJq23hhVK8QSTtoCuwlCLAWqdXIjGyiBPwFero3ptyVnIyIH7 jyt2qqt3az8ZA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0FA25693AE for ; Sun, 18 Jan 2026 23:16:39 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id PJ1gGUlDYFz6 for ; Sun, 18 Jan 2026 23:16:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803398; bh=8TK1XugpPlhdZE79MQE+xO8zZTJ8wNZg1ezuXzsF1Ro=; 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=jyUHLuT4mju0vNgJB1MhPEqULl/ui5pJfEWtdHhUFpfJgrpH6BMb7EA1uOdrotI8z hOPsFXsrn+bTT9DeA2+ELm8YKjRYHW2fbVLG+EFHvW8LBW3OutOxWzhr0z2kibb0Bu IPK4KfQHGJqfRS8sjRpphQGEZd12i/OWQBn0CMb2Y7txmdGZhxKdf7O2lJGTtVrkXM 907fjI8pVzE2xpeGsn8fba9/CtPSstPGLRzahQUOzVKGntn0v19GiEih4N2ZSrxw7i PSDZtqL1a7I9dPH0yqVtnEwjaO1WgUKYaNjfp374c+cJmNrg82ql19CAJ96SNPfw7k vhtv2gXFdv18Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EEAF3694C7 for ; Sun, 18 Jan 2026 23:16:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803397; bh=dNSTe2oSdaaM98wiC34MMFhewrzd5kLh8JRPeQN7ses=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dkv6bIRqKnZZRvpGBmevmkSuNYeMuRtCvDlQJfNvuqwLD49wsUeJAna4NQidkGUrX hLRxzrRWxrFg5yABHhsspfa7e9zCmQtZIYv6Oi36R9O+TAzRek8hMg+CGt7wDgcPdN Jm+kJqHlJvu5A1Mr2CPWtr7L8x3KYlvKyV8NX2ojmixxJZb/tObnszsY7uKEQAzLkV HIRk1/O1IfZBc+YvhAXBEuGvqrXAqZGQA8VRpODVfkyMlfBXc2RMnh4aPuKp1LVEQa Xl32eSObiVomJPsc26EVkR2eBqOn652ZstW1cpfCxjMyt8Uak7n4oURa75ISRBgl3F ouUqLmqPy2rrA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 03878693AE; Sun, 18 Jan 2026 23:16:37 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id h7QhrZgRFmN1; Sun, 18 Jan 2026 23:16:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803392; bh=V2eitG0mOh67m/PEw5NL4TyA35Ui+519LJ0xv7TeShE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t3Vb9PeQFBwMU+g8Dh1BVlofvr6TDcUYQ010oqmGtBbZzPEAsl+rZoCwTpHxMTgdG 88qHMfG1u5Issy47SmE/E+NDjl5EF0mldU9nQ++BRvrCHL/xxyTAYMFSfPgkud/Skm k+Jo1jEJDNBz3oqmGnDbQT0m1NNUzRbb8dgmwvMZJFumX6mgS8DRvjoCsOyaE0yFQJ 6WZ4+GZOb1MrFWBPhRGfbh/uYBTuAvdoxmDQAeLWONKZu3n6Zh8AAMJ7Iz0Sb4cWcG 1VbbdX73SpkCEji37K2pVwJl4bqQaXjPu5rHNCPg2l6EH5P7JEtiL3d2L0pj8jlzQO mrv/eEqLuTsbw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AB1EE694C7; Sun, 18 Jan 2026 23:16:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:09 -0700 Message-ID: <20260119061529.3383191-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: INT6SKUKQKSTBLGHHRO53XXJQQ64OCVP X-Message-ID-Hash: INT6SKUKQKSTBLGHHRO53XXJQQ64OCVP 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/23] ext4l: Add linux/hrtimer.h with timer 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 include/linux/hrtimer.h with high-resolution timer definitions. This includes the hrtimer_mode enum values and schedule_hrtimeout() stub, matching Linux kernel organisation. These are stubs since U-Boot does not support high-resolution timers. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 ++--- include/linux/hrtimer.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 include/linux/hrtimer.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 58479ccb2fe..89d1296c18b 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -839,9 +839,8 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) /* ktime functions - use linux/ktime.h */ #include -/* hrtimer stubs */ -#define HRTIMER_MODE_ABS 0 -#define schedule_hrtimeout(exp, mode) ({ (void)(exp); (void)(mode); 0; }) +/* hrtimer - use linux/hrtimer.h */ +#include /* write lock variants */ #define write_trylock(lock) ({ (void)(lock); 1; }) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h new file mode 100644 index 00000000000..98178498b2d --- /dev/null +++ b/include/linux/hrtimer.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * High-resolution timer definitions for U-Boot + * + * Based on Linux hrtimer.h - high resolution timers. + * U-Boot stub - high-resolution timers not supported. + */ +#ifndef _LINUX_HRTIMER_H +#define _LINUX_HRTIMER_H + +/* High-resolution timer modes */ +enum hrtimer_mode { + HRTIMER_MODE_ABS = 0x00, + HRTIMER_MODE_REL = 0x01, + HRTIMER_MODE_PINNED = 0x02, + HRTIMER_MODE_SOFT = 0x04, + HRTIMER_MODE_HARD = 0x08, + + HRTIMER_MODE_ABS_PINNED = HRTIMER_MODE_ABS | HRTIMER_MODE_PINNED, + HRTIMER_MODE_REL_PINNED = HRTIMER_MODE_REL | HRTIMER_MODE_PINNED, + HRTIMER_MODE_ABS_SOFT = HRTIMER_MODE_ABS | HRTIMER_MODE_SOFT, + HRTIMER_MODE_REL_SOFT = HRTIMER_MODE_REL | HRTIMER_MODE_SOFT, + HRTIMER_MODE_ABS_HARD = HRTIMER_MODE_ABS | HRTIMER_MODE_HARD, + HRTIMER_MODE_REL_HARD = HRTIMER_MODE_REL | HRTIMER_MODE_HARD, +}; + +/** + * schedule_hrtimeout() - sleep until timeout with high-resolution timer + * @expires: timeout value (ktime_t) + * @mode: timer mode + * + * U-Boot stub - returns immediately. + * + * Return: 0 + */ +#define schedule_hrtimeout(expires, mode) \ + ({ (void)(expires); (void)(mode); 0; }) + +#endif /* _LINUX_HRTIMER_H */ From patchwork Mon Jan 19 06:15: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: 1619 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=1768803402; bh=DDtRu1L0LUdQjzMS09SESzvc4p7EN7BSGNOLzT6jQWA=; 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=HaFW/f+N+xH2TeRV1zr/nnmb3R9IqRi1QfTQUrqSpbcXnxjIV6Ks8OlzOjJljCgyJ HJyvmPXmmcwfccES3xPW66TOofNK3GJpyXaBk6lpLuZeh3YNX03lQUceODGPqHX8wO c4zQHlJEch5buvP/hzB6wz6vSIng95y/LkuOlLvg9CDNwDNf1ynUetdB5m28Ub3dlG pGmHpHnPKqL0c4vmHgZiUvY60wDFdRplHjMjajKaq6mVikM9V4wSj/gLu73HEwxx4V ZFe+RAmHxUqs/3iGwQKNAduvJhdVZ9jpLW5AzvW+pnYOWAR1nbXm/u6IpFr698XHtU BOWoRjmdOePUg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BC627694DD for ; Sun, 18 Jan 2026 23:16:42 -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 rZRR1cCEB1V3 for ; Sun, 18 Jan 2026 23:16:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803402; bh=DDtRu1L0LUdQjzMS09SESzvc4p7EN7BSGNOLzT6jQWA=; 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=HaFW/f+N+xH2TeRV1zr/nnmb3R9IqRi1QfTQUrqSpbcXnxjIV6Ks8OlzOjJljCgyJ HJyvmPXmmcwfccES3xPW66TOofNK3GJpyXaBk6lpLuZeh3YNX03lQUceODGPqHX8wO c4zQHlJEch5buvP/hzB6wz6vSIng95y/LkuOlLvg9CDNwDNf1ynUetdB5m28Ub3dlG pGmHpHnPKqL0c4vmHgZiUvY60wDFdRplHjMjajKaq6mVikM9V4wSj/gLu73HEwxx4V ZFe+RAmHxUqs/3iGwQKNAduvJhdVZ9jpLW5AzvW+pnYOWAR1nbXm/u6IpFr698XHtU BOWoRjmdOePUg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A50C8694C7 for ; Sun, 18 Jan 2026 23:16:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803401; bh=bztVO61Vst/RArDSxegAoq8SUlpTbBfvPF8aeuSGmP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQdKgj1Dxuop/4ywqR2+VgzmG4ZK8ApumYK67ACi1ylMWfMjq8G0CCAio6KpRxjBY zrU0Rc/mtcTHOG+opn2eavoTq22XqjOdjRCK+zzbWAY5+BRQA81TCKr/u0zxcFEkcy yA6y9RTISKQZcuTkV7KWACA/shmX413dchRbyr/aLiRvXK1yIlkcWAxjUWswtGXU4x 7eWj+8eiGaV8x5qxfc+IzGumdnfBDWZhO2smW0Toy6iOgO8LT6fjcUDGF9Dx/IZ+dk wGIm6ahgG7F8DxgUzP9zgOabT91XPtWwbvNE0rAaDgoixO6POqRvglO7Q8Bn2KJSGt N96xaWnfu49Ow== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AC746693AE; Sun, 18 Jan 2026 23:16:41 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id F4wMvjIULN2l; Sun, 18 Jan 2026 23:16:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803397; bh=N7TVNhaFY2L2wfuWnfzgasXZLGTWsCGFeq6/zbh2yQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ADYCaxP7oBv0WhL/a+StyX75xt08+wyi/XlADrnFopmcdIAcG/4PfUW2Bq0n0WNmo ncwI9Lfy2C6NOcAIvL612x0VrTbX74EeBoVGCq0icHlBU1CR2dy7jK5lsC6Q18IQ9Y wrl20n7vEY6oFxLSLxzUP0I/9sEI6IkzTswlk/Tybhd+dKbSIiCADjoKBE/XbPNf++ K6Lh8qViGg65F4GP3QybXPmNVIQWJNajC9ZMEmc8OMOrp8SIUgQSghCcYOedKBML5h b1Yxx9rOSCoTnslbzo6blohPqiK474MmzAOlvt6VTZe2t9dv2q61vepaYpaecTJPyo hKGmvUCmYFqNg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 47F41694C0; Sun, 18 Jan 2026 23:16:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:10 -0700 Message-ID: <20260119061529.3383191-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NI4CGHKSQYRHDQD7F7QH5M2T6ZE35X5M X-Message-ID-Hash: NI4CGHKSQYRHDQD7F7QH5M2T6ZE35X5M 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/23] ext4l: Move STATX_* and struct kstat to linux/stat.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 STATX_* flags and struct kstat definition to include/linux/stat.h where they belong alongside the struct stat definitions, matching Linux kernel organisation. This reduces ext4_uboot.h by 40 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 41 +----------------------------------- include/linux/stat.h | 48 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 89d1296c18b..d017d86247b 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -491,48 +491,9 @@ static inline int bdev_read_only(struct block_device *bdev) /* SB_LAZYTIME is in linux/fs.h */ /* ATTR_* iattr valid flags are in linux/fs.h */ - -/* STATX flags and attributes */ -#define STATX_BTIME 0x00000800U -#define STATX_DIOALIGN 0x00002000U -#define STATX_WRITE_ATOMIC 0x00004000U -#define STATX_ATTR_COMPRESSED 0x00000004 -#define STATX_ATTR_IMMUTABLE 0x00000010 -#define STATX_ATTR_APPEND 0x00000020 -#define STATX_ATTR_NODUMP 0x00000040 -#define STATX_ATTR_ENCRYPTED 0x00000800 -#define STATX_ATTR_VERITY 0x00100000 - +/* STATX_* flags and struct kstat are in linux/stat.h */ /* VM fault return values are in linux/mm_types.h */ - /* struct path is defined in linux/fs.h */ - -/* struct kstat - stat buffer */ -struct kstat { - u64 ino; - dev_t dev; - umode_t mode; - unsigned int nlink; - uid_t uid; - gid_t gid; - dev_t rdev; - loff_t size; - struct timespec64 atime; - struct timespec64 mtime; - struct timespec64 ctime; - struct timespec64 btime; - u64 blocks; - u32 blksize; - u64 attributes; - u64 attributes_mask; - u32 result_mask; - u32 dio_mem_align; - u32 dio_offset_align; - u32 atomic_write_unit_min; - u32 atomic_write_unit_max; - u32 atomic_write_segments_max; -}; - /* VM structs (vm_area_struct, page, vm_fault, vm_operations_struct) are in linux/mm_types.h */ /* Forward declaration for swap */ diff --git a/include/linux/stat.h b/include/linux/stat.h index b65bff7e97d..9a5babbc5be 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -180,4 +180,52 @@ struct stat { } #endif +/* + * STATX flags and attributes + */ +#define STATX_BTIME 0x00000800U /* Want/got btime */ +#define STATX_DIOALIGN 0x00002000U /* Want/got dio alignment */ +#define STATX_WRITE_ATOMIC 0x00004000U /* Want/got atomic writes */ + +/* File attributes for STATX */ +#define STATX_ATTR_COMPRESSED 0x00000004 /* Compressed file */ +#define STATX_ATTR_IMMUTABLE 0x00000010 /* Immutable file */ +#define STATX_ATTR_APPEND 0x00000020 /* Append-only file */ +#define STATX_ATTR_NODUMP 0x00000040 /* No dump file */ +#define STATX_ATTR_ENCRYPTED 0x00000800 /* Encrypted file */ +#define STATX_ATTR_VERITY 0x00100000 /* Verity protected file */ + +#include + +/** + * struct kstat - stat buffer for VFS + * + * Extended stat buffer used internally by the VFS. Contains all information + * returned by statx() system call. + */ +struct kstat { + u64 ino; + dev_t dev; + umode_t mode; + unsigned int nlink; + uid_t uid; + gid_t gid; + dev_t rdev; + loff_t size; + struct timespec64 atime; + struct timespec64 mtime; + struct timespec64 ctime; + struct timespec64 btime; /* Birth/creation time */ + u64 blocks; + u32 blksize; + u64 attributes; + u64 attributes_mask; + u32 result_mask; + u32 dio_mem_align; + u32 dio_offset_align; + u32 atomic_write_unit_min; + u32 atomic_write_unit_max; + u32 atomic_write_segments_max; +}; + #endif From patchwork Mon Jan 19 06:15: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: 1620 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=1768803407; bh=U1Ma085zaDdfgGAHGDWVV4yQqJg5J48J+L724rPMBDQ=; 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=e7uN0MLFghEmzPVYtVUhXQ0kfzKEvE4xGpp5yTcafSNfbg0oElRq9AU0kdYW0y9dO Atqbe9vVLGnEKfn4Thw3n1PyK0M7mW18X1yiLQf4rr594FzCLuJ5a5HAlRh09rufrg qbawK9JeupuPmBbOowuv4SsmzP/DS3E3rH+IN+T+V6cOJYHKZ3FdaPrVVUc3sd7Ltb DXtYnYX3E+CY6nY1VMlFUIZ+kKK0eA2sZN2A/bCuspRAnprxMXYIEiLDf51i7JXWfM chSnuXuxFlXVYbJkAtO/g51zWZPV6FMIgebNM4aKQvu3U3Xgu3m8Ya+n38QkoYvF2q mCDv6Nc0xVUIw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A22B5694DD for ; Sun, 18 Jan 2026 23:16: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 OtaWgaGv01dz for ; Sun, 18 Jan 2026 23:16:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803407; bh=U1Ma085zaDdfgGAHGDWVV4yQqJg5J48J+L724rPMBDQ=; 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=e7uN0MLFghEmzPVYtVUhXQ0kfzKEvE4xGpp5yTcafSNfbg0oElRq9AU0kdYW0y9dO Atqbe9vVLGnEKfn4Thw3n1PyK0M7mW18X1yiLQf4rr594FzCLuJ5a5HAlRh09rufrg qbawK9JeupuPmBbOowuv4SsmzP/DS3E3rH+IN+T+V6cOJYHKZ3FdaPrVVUc3sd7Ltb DXtYnYX3E+CY6nY1VMlFUIZ+kKK0eA2sZN2A/bCuspRAnprxMXYIEiLDf51i7JXWfM chSnuXuxFlXVYbJkAtO/g51zWZPV6FMIgebNM4aKQvu3U3Xgu3m8Ya+n38QkoYvF2q mCDv6Nc0xVUIw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8F679694CE for ; Sun, 18 Jan 2026 23:16:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803406; bh=Kj0u102o8GAotek+YQOBXaNgQ27bV7NEf1cWn3gejas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YunGCHwA/J84Ucr6yWHlfoFCfCQiChTm54OYLbPq1vu6u5fCFCXV1QqKBVplQv9q1 H50PjLM5IJOMFCQRyFhgg6+lkN/zyTZXQcHdALImbjLvbE+ame5c/+02qKqpIfmN1q X5k6dU67A4VVo5PC9NPSH1gmLg+ciCeGqGLfMBD67Cj1zNbbKbsAW2EA72sh7pW0uS rZNGWO0hxX05Mb7W9KbP/47onxb5KYypMiSHZaYkWcMHihEV7bu06QOqvPtxmqCALr Ff6qemzKFAAIrJjMNmdKhOw4yRHMN+7uGlt4YmG+F5R/ArhPqWfpkyNwQO3cx45GFM eGElGy0fYm/uQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 32F94693AE; Sun, 18 Jan 2026 23:16:46 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id uBXq4kh4wAl2; Sun, 18 Jan 2026 23:16:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803402; bh=Sy9epVVDC8QY1aXhz0ZR7n+x1qwtnz88d7Wb3P1yOmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qk3P6BdBecXCtGFgU0ljyKN15FBgEbSTRzcDPOXSDWjmlzClP0OFQijv3t3EOHYpS fG0QdRcgX398gd8f2VlC8HKwMC4LnG1R64ml/olAo03ikOjJzmCvcKP9HEFR97jopP 3g/BK0Fsq8IjQvDrBjjkFUir/j9lpeAFrCMH4hht3tN+Alf/4TtzwY+G5zZ4zqXNdh 3T4luzcItBal6AmHIU84YH0nbFRl/RNy0lO5iIwlYI/YTbzDJ76CyCIN8DB5w9lsVf jioBfifqx/9Ohw62oMNYA9hIeRK+8uidReyGFcGC2JxD1sGCt8SUlpzbpYqeX3eydA ZCjJLmUZLvnfA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DC817694C0; Sun, 18 Jan 2026 23:16:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:11 -0700 Message-ID: <20260119061529.3383191-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RN4HQE33KQPF6BMW52MN32QB3RU4PO2F X-Message-ID-Hash: RN4HQE33KQPF6BMW52MN32QB3RU4PO2F 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/23] ext4l: Move REQ_OP and SLAB flags to proper headers List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move block I/O request operation codes and flags (REQ_OP_READ, REQ_OP_WRITE, REQ_OP_MASK, REQ_SYNC, REQ_FUA) to include/linux/blk_types.h where they belong with other block layer types. Move slab cache creation flags (SLAB_RECLAIM_ACCOUNT, SLAB_ACCOUNT) to include/linux/slab.h with other slab definitions. This matches Linux kernel header organisation and reduces duplication in ext4_uboot.h Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 14 +++----------- include/linux/blk_types.h | 9 +++++++++ include/linux/slab.h | 4 ++++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index d017d86247b..1622fec4e64 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1106,8 +1106,8 @@ static inline void end_buffer_read_sync(struct buffer_head *bh, int uptodate) clear_buffer_uptodate(bh); unlock_buffer(bh); } -#define REQ_OP_READ 0 +/* REQ_OP_READ is in linux/blk_types.h */ /* SB_ACTIVE is in linux/fs.h */ /* Part stat - not used in U-Boot. Note: sectors[X] is passed as second arg */ @@ -1127,9 +1127,7 @@ static u64 __attribute__((unused)) __ext4_sectors[2]; #define DUMP_PREFIX_ADDRESS 0 #define print_hex_dump(l, p, pt, rg, gc, b, len, a) do { } while (0) -/* Slab flags */ -#define SLAB_RECLAIM_ACCOUNT 0 -#define SLAB_ACCOUNT 0 +/* SLAB_RECLAIM_ACCOUNT, SLAB_ACCOUNT are in linux/slab.h */ /* Forward declarations for super_operations and export_operations */ struct kstatfs; @@ -1214,13 +1212,7 @@ void ext4_unregister_li_request(struct super_block *sb); #define BLK_OPEN_WRITE (1 << 1) #define BLK_OPEN_RESTRICT_WRITES (1 << 2) -/* Request operation (bits 0-7) and flags (bits 8+) */ -#define REQ_OP_WRITE 1 -#define REQ_OP_MASK 0xff - -/* ensure these values are outside the operations mask */ -#define REQ_SYNC (1 << 8) -#define REQ_FUA (1 << 9) +/* REQ_OP_*, REQ_SYNC, REQ_FUA are in linux/blk_types.h */ /* blk_holder_ops for block device */ struct blk_holder_ops { diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index aa7ea50d233..9d770f4bd6e 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -15,4 +15,13 @@ /* Block I/O operation flags */ typedef __u32 __bitwise blk_opf_t; +/* Block operation codes (bits 0-7) */ +#define REQ_OP_READ 0 +#define REQ_OP_WRITE 1 +#define REQ_OP_MASK 0xff + +/* Block request flags (bits 8+) */ +#define REQ_SYNC (1 << 8) /* Synchronous I/O */ +#define REQ_FUA (1 << 9) /* Forced unit access */ + #endif /* _LINUX_BLK_TYPES_H */ diff --git a/include/linux/slab.h b/include/linux/slab.h index 4f413f93fa3..1b212ca0e4a 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -46,6 +46,10 @@ #define GFP_NOIO ((gfp_t)0) #endif +/* Slab cache creation flags */ +#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Track pages reclaimed */ +#define SLAB_ACCOUNT 0x00000000UL /* Account to memcg (no-op) */ + void *kmalloc(size_t size, gfp_t flags); static inline void *kzalloc(size_t size, gfp_t flags) From patchwork Mon Jan 19 06:15: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: 1621 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=1768803412; bh=0pyZ+tjdSRZNd4Ypn7rH1XZGm0DpLQ+vaeNsY9NS4VQ=; 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=WWsgMZW8GS9+6byimk/o/yStwbPsnTqbKCYEia8i8bfV03uDjiYNhmDnmkrJwEmBy F6s8zh3JWGaTz5e/E+3CuXAFm6hrN5Ji4+BAclX51A2mvaPqbKJs/Y9LSjkcEUnloJ Y0CK4oV1dpoyylJMwDy7swJU1BgKKWp/PpnmzXovL9F7XaZHgk2MhQeyNgvZW+CgOO qB4nyZxBbJ9CYwQ1jIPVVhVa6HFYU5n2xWgt6cw7wdRa397YwMbmxkcxtUUoyxGQvQ JihG6KVSNskNWT54AVnq+QdS0CS345w5mAfYOAXcfXdY7VVYsknnDHpFaFdTnCGTO0 tx7yI3leFPQLw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 178ED694DD for ; Sun, 18 Jan 2026 23:16: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 9Nl8J-E5TQbo for ; Sun, 18 Jan 2026 23:16:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803412; bh=0pyZ+tjdSRZNd4Ypn7rH1XZGm0DpLQ+vaeNsY9NS4VQ=; 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=WWsgMZW8GS9+6byimk/o/yStwbPsnTqbKCYEia8i8bfV03uDjiYNhmDnmkrJwEmBy F6s8zh3JWGaTz5e/E+3CuXAFm6hrN5Ji4+BAclX51A2mvaPqbKJs/Y9LSjkcEUnloJ Y0CK4oV1dpoyylJMwDy7swJU1BgKKWp/PpnmzXovL9F7XaZHgk2MhQeyNgvZW+CgOO qB4nyZxBbJ9CYwQ1jIPVVhVa6HFYU5n2xWgt6cw7wdRa397YwMbmxkcxtUUoyxGQvQ JihG6KVSNskNWT54AVnq+QdS0CS345w5mAfYOAXcfXdY7VVYsknnDHpFaFdTnCGTO0 tx7yI3leFPQLw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 05048694CE for ; Sun, 18 Jan 2026 23:16:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803410; bh=Xgv10KWxxjqTwF8hAOeTLJtGHIRDdbYhlLfrq+aGFAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N2szK/7JPpQ5SQ0R0XRvyClRivYFGICSNgHaY2WPtnATvHEuyvXux+SUMd3N4H/Rf MkghQtde6NigkwuEkSUgwZ5B2FaiOUpyKgO6ZlgwwEk/PjuwZnun5MFbdY3HGKP7tN kuxQ1SlnHZDnX6LVRj04rn2gyDpDPgAfDuAB9k5UN48fphnqs0wL1LZB8ncFNdIcSh x4CodYnMlAeVSpEmWFwiuNyMpWh1rPzPEoJpwwUM+zkQqwUL8rjLYn1UjvfvRQDjdJ zlaVNNK0MOyzNsgqoS4ogZTITcismEG14+y20xikqGgIC2LJpyjRy7IxWi2dEMHkAN 3byjotWszHXug== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BBD4D693AE; Sun, 18 Jan 2026 23:16: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 K7hFTD2tKbAC; Sun, 18 Jan 2026 23:16:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803406; bh=ldLDU12HJVlW4u5QoIDxIQ16HBffXuArpKZ5q39ACvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZzrtvSlP6HUSVchhTd5ACqXRKJJTEtIliebB6FC4Fsqy8/yxnp73XqoBDh+NQ7t5 FuqK25HLzQNBZKdiPvRvzHSPH8vOb7dvYavY5gUHgIEhEPUnhFPoxwX1981KBnYhNe ysTfBNY/l4EVz8HA2d6kHyu/UrYV939ZNtbrfOLGMACcAvHZVuGZDdyCrIsCi9bTFb /N/qJPMapQtc9M7Oqa+mZTw2RSkIKeAbC7b5E/2xVI2AvsG5awkd0lTNxVVmTh82bm qa6y8RcuNCIcEVDjMRuxp8svjwpBqUB4cBzB5rSOGvE8qiSIqY3jk3QC+s23SElORf b0FIYrFdtAUYg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 77345694C0; Sun, 18 Jan 2026 23:16:46 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:12 -0700 Message-ID: <20260119061529.3383191-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AIQJKDJVOMVEIVPFSJQGSKHRMJASLN3H X-Message-ID-Hash: AIQJKDJVOMVEIVPFSJQGSKHRMJASLN3H 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/23] ext4l: Move REQ_IDLE and REQ_PREFLUSH to blk_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 the remaining block I/O request flags (REQ_IDLE, REQ_PREFLUSH) to include/linux/blk_types.h with other request flags. This consolidates all REQ_* flags in one location, matching Linux kernel organisation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 +----- include/linux/blk_types.h | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 1622fec4e64..03534115e71 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1557,11 +1557,7 @@ bool __folio_start_writeback(struct folio *folio, bool keep_write); /* Dentry name snapshot operations are now in linux/dcache.h */ /* lockdep_assert_not_held is in linux/lockdep.h */ - -/* Request flags for block I/O */ -#define REQ_IDLE 0 -#define REQ_PREFLUSH 0 - +/* REQ_IDLE, REQ_PREFLUSH are in linux/blk_types.h */ /* wake_up_bit is now in linux/wait_bit.h */ /* d_alloc, d_drop are now in linux/dcache.h */ diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 9d770f4bd6e..ccbee4b9876 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -23,5 +23,7 @@ typedef __u32 __bitwise blk_opf_t; /* Block request flags (bits 8+) */ #define REQ_SYNC (1 << 8) /* Synchronous I/O */ #define REQ_FUA (1 << 9) /* Forced unit access */ +#define REQ_PREFLUSH (1 << 10) /* Request cache flush */ +#define REQ_IDLE (1 << 11) /* Anticipate more I/O */ #endif /* _LINUX_BLK_TYPES_H */ From patchwork Mon Jan 19 06:15: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: 1622 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=1768803417; bh=OoLjdiQaIfdJAfXxWr7xNjOY+NySXjZmUbRVa54uABQ=; 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=Kgpb0Qh3KwOdGRMa1SB8p8vnaxY8mUU6wAD67jM5MOrdzonXMHiaOUSf3JE3p/6uo MDFqqsBbWkRkeSQpoBy4lYz8NIdB6ZKEURZGh9wz5FD/gKFED0ad3gSN5zwU2Io8hg fU3KTt5k18/S+ahjnWzAhnVALOwqmO6K4k4gKeCzSkl4uI06+pWXPu8jIoCf5v1S91 n4xW/6l1G+kLAI0IjDYP0mKlLgai5dDep+RQbKU5QmJoI/0ITww5ulwSxf1Vb0sHMm Spr4JXv2xuDy74oY9e/IVWIdpWrPkCClyYcQW1FksHiCdHmQO4spM5cYfRj+QdEQgx vXfsyarBW4zSg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 86676694DD for ; Sun, 18 Jan 2026 23:16: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 UCT0BUAIsHh0 for ; Sun, 18 Jan 2026 23:16:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803417; bh=OoLjdiQaIfdJAfXxWr7xNjOY+NySXjZmUbRVa54uABQ=; 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=Kgpb0Qh3KwOdGRMa1SB8p8vnaxY8mUU6wAD67jM5MOrdzonXMHiaOUSf3JE3p/6uo MDFqqsBbWkRkeSQpoBy4lYz8NIdB6ZKEURZGh9wz5FD/gKFED0ad3gSN5zwU2Io8hg fU3KTt5k18/S+ahjnWzAhnVALOwqmO6K4k4gKeCzSkl4uI06+pWXPu8jIoCf5v1S91 n4xW/6l1G+kLAI0IjDYP0mKlLgai5dDep+RQbKU5QmJoI/0ITww5ulwSxf1Vb0sHMm Spr4JXv2xuDy74oY9e/IVWIdpWrPkCClyYcQW1FksHiCdHmQO4spM5cYfRj+QdEQgx vXfsyarBW4zSg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 756B6694CE for ; Sun, 18 Jan 2026 23:16:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803415; bh=LFaFpTMzxxaa5SCtfSWMLtER8poHSiCEihvnHLfgz5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hqYUpAUKzX6oqPBp4KuxEiXGe9plsl/pB66YwE6zPdu1e3I0Lg4Pap+5VdN4X/owT FdOBFy/aUN3seuffhidtvNSW4XOOhycT7Ex3XMOY+962otGe6/peqvyrrg3XNUZ1I4 eWeqB+QA2nRQX1+Y0UMZZufKRN6splquUq7l19BDdVko+yL4URS0+jILcWMVcztm3i Xk3fOWU6zQQUAekA9v01EBFLrUxknjnPxaSWOYdLhI3vyom74UwwJmJAyC4b1z17Y9 NLf5y4tB8oSHEVE5ZGstYZa5LdfzNT7y5+AQIPnVE8mDkdBbTsXOS9730WOz5CBG99 SAvIPvnxF6Yuw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 58AFA693AE; Sun, 18 Jan 2026 23:16: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 JbhcgAXspsGX; Sun, 18 Jan 2026 23:16:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803411; bh=rl8kOgzBsQpykJGSnET6xIAljjBLh0T5CGgKLI6IS8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y1hQTDkglB1qDJCf9/kHYlXK20v0jX/ovA9AaRxyRkTLoCXFvBNufgtJxzsIfguSY pNPABCU1l95v6qCS/ankTlrf0XBePwTbmXYDJmJJzJLfH59OIy48GabMoMfcSbb2mN NteJDDhUmqO7kTZNoTOhe08T3sm3tr8koqFk1ByU8Ae5n11k1ugwCIto1Q4+GqktZd +g0qd5hRfizneWeOq5uG51VkonxEHEEMRb+1ZR838Ub/H8BxKO0PgVvGKcB6YuoPY/ 5AmewsMDjmlJWPh0bUv+ubrmGZxSbLR7Bkn/CSkTMaOXr7s1aazq9eedkMV+p2scgE 5lI9xRm5rN4JQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0F163694C0; Sun, 18 Jan 2026 23:16:51 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:13 -0700 Message-ID: <20260119061529.3383191-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BH7CM2S4KCYT32WV4ZOQZD6N4PDYHKJK X-Message-ID-Hash: BH7CM2S4KCYT32WV4ZOQZD6N4PDYHKJK 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/23] ext4l: Move QFMT_VFS_* constants to quotaops.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the quota format identifiers (QFMT_VFS_OLD, QFMT_VFS_V0, QFMT_VFS_V1) to include/linux/quotaops.h with other quota definitions. This consolidates quota-related constants in one location. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 +---- include/linux/quotaops.h | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 03534115e71..d11981a858a 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1092,10 +1092,7 @@ static inline const char *simple_get_link(struct dentry *dentry, * Additional stubs for super.c */ -/* Quota format constants */ -#define QFMT_VFS_OLD 1 -#define QFMT_VFS_V0 2 -#define QFMT_VFS_V1 4 +/* QFMT_VFS_* quota format constants are in linux/quotaops.h */ /* Buffer read sync */ static inline void end_buffer_read_sync(struct buffer_head *bh, int uptodate) diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index b32e7b7ab70..b96e33887b8 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -61,6 +61,11 @@ struct super_block; #define dquot_writeback_dquots(sb, type) do { (void)(sb); (void)(type); } while (0) #define dquot_file_open(inode, file) ({ (void)(inode); (void)(file); 0; }) +/* Quota format identifiers */ +#define QFMT_VFS_OLD 1 /* Original quota format */ +#define QFMT_VFS_V0 2 /* 32-bit UID/GID quota */ +#define QFMT_VFS_V1 4 /* 32-bit UID/GID with grace period */ + /* Quota status queries */ #define sb_has_quota_usage_enabled(sb, type) 0 #define sb_has_quota_limits_enabled(sb, type) 0 From patchwork Mon Jan 19 06:15: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: 1623 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=1768803421; bh=eX0Zcz8KK2EjKZwy4nzdZ9xcw8J6Dvla3KJT5hTyyqY=; 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=k18Y6Zs9I7K4rMt/KcnQ/4gxGrc/Pn9PEG+RyNY3YUIbsc4vMApLkAaJztYK9MH0x RddhGTd7ty9LeBNSroCQb2yA79ghNjCN7yRlivfEYpMxDjF59vNbHma+cY+4xnxdqK s+0ftKSdv1taWpWVj4O9riMwu7M4B0EthJKl3ULc+XTdzLXwdo32QxEKvkGcWoyoou B+NN7Lx60bX7jaK/5wLUo/Ype9Iua39r2gMrI4u1oOFMwk5teJNLJ5ykDAxrJbvNVD Q81aljoeAIQ1nCyWRCSm7L38rSgO7RMldRMjSM0Hnjua893LbHOjs82gjokYTmbzAk KZbV+HPzh1Qfg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 09677694DD for ; Sun, 18 Jan 2026 23:17: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 d0aytzH8VL6a for ; Sun, 18 Jan 2026 23:17:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803420; bh=eX0Zcz8KK2EjKZwy4nzdZ9xcw8J6Dvla3KJT5hTyyqY=; 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=c8DH6Rrc72zbF5utW6bOLwWfKX7rLzBcljKeeUOrAp1U/8WkE6Ya0lUzGSHG0hc4Q LakyUVj7WKMOvb1hZNAmG2wqT7UIJJTmD1DjYi5H03SpR/5JUfrXDNKzrqEKZNMRE6 EVOzbdALD0uom4l1VjptnqBMlS8iJg/u/bbWIe2iB9AjXjtzbRXWtDMmmRk++wGV2Q 1kxU1348W63+kJ+sZ8rY2M0535LbHHJnr9JjVDDXm1OTjL9AeZ73ahiLhs+W+wR1Qr kvsnIQ5MvxLLgEZDnJoCup60AiZMs6d0scWavUWhswMNMifC2nQ3U7+iQ7pBInH4y1 njebKXgWy7+ag== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EBDCC694CE for ; Sun, 18 Jan 2026 23:17:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803419; bh=CvRu6PDDlIhfHvwqgus38hiaFcGYzzJ//EkNugbA5Co=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GPhP+DAiAM7LGQyTnRmy5ePhwIVWmq30dteFJiMdb0ttttjvHSSFCmFkh0jK3shC0 C4Gp1eibLBt60NAF/R6B7qhHhdNjr86xCPUUC2n2U78FggCobnVyAQ+9V84PCEmjlz THYDdc5CLVimxarOinDjfa14udzGXmoXB3OasbJrfx2426i6fq6erWqxIqZsLUgLk0 3Z+K0S8+8l8sMU8WcPKi1YlHcaeXNKPI0VvUydKvkrRSlAbEmZ1H3URxPqIreaB/cJ 0DtaJ/9o18wEhh+9j3cdX5BqNaLfhZ3Ag44WEnoC74eaYX8COtDyv1UQpobpJFoBMe WuVqO8LvEMH8Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE3DA693AE; Sun, 18 Jan 2026 23:16: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 04A2S0sT7xiC; Sun, 18 Jan 2026 23:16:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803415; bh=iwfrNEHbGHoNM2REHtQlkYXb5+HOmBBlkNjlFXxIJPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zr7DvvcJdnWqazrp45tPQZztojdIj2OSb1K2nhXf/Hn4tXbuHhkSZm9XqfMOKDeye KTiP6S6RYn+gLGFM6IduM7tAVBTN38m8tQlz9bYP4GNgOrZALv+yfzkiGat1VUaznl 0iZYCEJorjDLo59Az8AHM39KHaDuPqydGvUkHKUEUqIRCfy4i510jNPrv/YoKzBGQy WUq4yoDAyzOSeh2plru2+bAkCO6lvl8qgJkxSOU4kbtHgbXNxyQCEOdVqkthc+L84o cOqAdKy4uNeHx8UbS2TbSR8ODe2YL8UdsEFdnBssynGXIQqVJSMSFyQ7WEmduDEpHD CCfDqK8o9IVjQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9E8FA694C0; Sun, 18 Jan 2026 23:16:55 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:14 -0700 Message-ID: <20260119061529.3383191-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KP2IC7IEPAZSSGTQXA3CM77LO2LML2P5 X-Message-ID-Hash: KP2IC7IEPAZSSGTQXA3CM77LO2LML2P5 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/23] ext4l: Move REQ_META, REQ_PRIO, REQ_RAHEAD to blk_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 the remaining block I/O request flags to include/linux/blk_types.h with other request flags, matching Linux kernel organisation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 +---- include/linux/blk_types.h | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index d11981a858a..931889f6046 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -125,10 +125,7 @@ #define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= PAGE_SIZE) #define data_race(expr) (expr) -/* Block I/O request flags - stubs */ -#define REQ_META 0 -#define REQ_PRIO 0 -#define REQ_RAHEAD 0 +/* REQ_META, REQ_PRIO, REQ_RAHEAD are in linux/blk_types.h */ /* GFP flags - stubs */ #define __GFP_MOVABLE 0 diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index ccbee4b9876..a842300ae64 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -25,5 +25,8 @@ typedef __u32 __bitwise blk_opf_t; #define REQ_FUA (1 << 9) /* Forced unit access */ #define REQ_PREFLUSH (1 << 10) /* Request cache flush */ #define REQ_IDLE (1 << 11) /* Anticipate more I/O */ +#define REQ_META (1 << 12) /* Metadata I/O request */ +#define REQ_PRIO (1 << 13) /* Boost priority */ +#define REQ_RAHEAD (1 << 14) /* Read ahead */ #endif /* _LINUX_BLK_TYPES_H */ From patchwork Mon Jan 19 06:15: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: 1624 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=1768803425; bh=pr56SSfPWk/cQsFpwFgw2MJ0kHLPxkHijJOF2VJhZZY=; 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=ZqqtC7QXaOEbkwoW0TNwZVVT0D4YQiBm0dk9QRiYOK+aXxKp3Fcg3j7xABNn8PqeU Ir8g/TcZhvdsb66Tfwcr0sL+B2dACtdVj3Qyf6tBQ0dDBrPmbKm0/uv1F0scub19oJ vXHFJKUlEaSXfRvokPsj+/rduJhI2xoN1/szBfqqD7hsvb7FcqEKu0DdAEK+i4aBUr WZgecxYHGpnmx17AZyeOY1u2xsRfWnsKxlZJTy8ezur5z5Cn+vRQXYC5o298lg89Bj wuo2abl1IzMsGnFnI0GCrR6j3QHnDswKkfpQrPvb03vBRsYs6uIbS4McJTraqzTrEQ QIFSB7NQ87ptg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB63F693AE for ; Sun, 18 Jan 2026 23:17:05 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lkNfZYXq0UD9 for ; Sun, 18 Jan 2026 23:17:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803425; bh=pr56SSfPWk/cQsFpwFgw2MJ0kHLPxkHijJOF2VJhZZY=; 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=ZqqtC7QXaOEbkwoW0TNwZVVT0D4YQiBm0dk9QRiYOK+aXxKp3Fcg3j7xABNn8PqeU Ir8g/TcZhvdsb66Tfwcr0sL+B2dACtdVj3Qyf6tBQ0dDBrPmbKm0/uv1F0scub19oJ vXHFJKUlEaSXfRvokPsj+/rduJhI2xoN1/szBfqqD7hsvb7FcqEKu0DdAEK+i4aBUr WZgecxYHGpnmx17AZyeOY1u2xsRfWnsKxlZJTy8ezur5z5Cn+vRQXYC5o298lg89Bj wuo2abl1IzMsGnFnI0GCrR6j3QHnDswKkfpQrPvb03vBRsYs6uIbS4McJTraqzTrEQ QIFSB7NQ87ptg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D9A4B694CE for ; Sun, 18 Jan 2026 23:17:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803424; bh=udapbJKyUSlrtCV39I/LbNXBNjk/AnTes5zflFEa5QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eg0mLVbQa4pAhW3XbaJUCfEZuY97J3oN5UrkYxI4p91fkaU5nMJ/PDDEimh0jrVG/ vU1bZR7QzxgboAKDb4VAcp8Z21hyXeHOgNsbxgaAzxqAuwgtdFIvyh8uUODLjhAusz QXH7vgbdrrzh7j/wk7u0Qnd6vMi6n+XaGiEqzX4Usl+7ZftiqXOXz6Tjye9gTyBZtK Iw16POSHx1SoIRtNz+6jg7gnM4M+fvpsxZ6gIXOQ6Wk9DxMCSu/PbZnzZWvzYi10HH o3a1f6WAxopKnsjDIwUGhYGFpr5TgwGguzCZeYa9+3btM5GhPlInN8qIhZaZZf44wH K+yMgB5juK2Jg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 827C9693AE; Sun, 18 Jan 2026 23:17: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 E-VKOQ15C1vG; Sun, 18 Jan 2026 23:17:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803420; bh=sH/B/mnmKCkxpID+7SRSVZtskItCdG8/X+WiTJUE5QQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1RfUuQVrIPFAxswGapOwNfzFxw3mahu8t2mCQBO5pZROuZ1rAgxGOMemZ7UkEHg8 lA6JAm7opiDrfMI4G+XJ4inG0dc6LDJImF1h0+d0/5U8bpXXntGccFdidhDqExfbob wd7NefbbmkqJLxHJL9inoYatB0JdzR1b2S5ZTNwyBKN/jl/J4FQf9CJjXQXnuzHvKg wL6wbk0QfB2ZJgPfP7kqtQ2Glulh+8F7EvCCJ+3Pt5dE/7vjwIvV5AKMWfdROTNoFw RGgzVk5bBDJhLR2Kg2S/sM8fHHyKni3PugAT7LvxxVXJJRUrPVTtVLe3EWM44XfIGI AtBJkfSQjMVVA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 38F84694C0; Sun, 18 Jan 2026 23:17:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:15 -0700 Message-ID: <20260119061529.3383191-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: J2E6QO7WC2Q2UUAELJWVSDGRSXG4L2KE X-Message-ID-Hash: J2E6QO7WC2Q2UUAELJWVSDGRSXG4L2KE 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/23] ext4l: Move __GFP_MOVABLE and __GFP_FS to slab.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the memory allocation flags to include/linux/slab.h with other GFP flags, matching Linux kernel organisation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 5 +---- include/linux/slab.h | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 931889f6046..b35559b8b18 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -126,10 +126,7 @@ #define data_race(expr) (expr) /* REQ_META, REQ_PRIO, REQ_RAHEAD are in linux/blk_types.h */ - -/* GFP flags - stubs */ -#define __GFP_MOVABLE 0 -#define __GFP_FS 0 +/* __GFP_MOVABLE, __GFP_FS are in linux/slab.h */ /* Capabilities - use linux/capability.h */ #include diff --git a/include/linux/slab.h b/include/linux/slab.h index 1b212ca0e4a..fb809063593 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -42,6 +42,12 @@ #ifndef __GFP_NOFAIL #define __GFP_NOFAIL ((gfp_t)0) #endif +#ifndef __GFP_MOVABLE +#define __GFP_MOVABLE ((gfp_t)0) +#endif +#ifndef __GFP_FS +#define __GFP_FS ((gfp_t)0) +#endif #ifndef GFP_NOIO #define GFP_NOIO ((gfp_t)0) #endif From patchwork Mon Jan 19 06:15: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: 1625 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=1768803430; bh=ca5zHqTD47wayMuSMO+0jtfymYMMcdmjYbVxoFHOrWQ=; 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=tOfusgmf8jTLIrcefsbo900GVtjmHrUvZfLP2CPfuqlw/+ga8JO3mQlSEAuPY2gl6 o6H8+IZVLUYDuIKmJq9h83MFl72nDddryzlEh/vc2fxipk439posSnUMyF94v5ecO0 D17q1nNm+3iWbH7P4ntYoKTWKTilkGipCumaEtH8GQiRbBeU36gk1DY/ZUGZZNfVe3 gJHwOe5U2l26HFl0vuPBqqVqEO003pL/46FO6v3quOYIW65FQX38/feUQv+j7b72i3 NgyP78+jb+Q0shKgDpSzLILjQnlU8E0x6FdN5IDW6wRNR6cbwJhJSU5go988O6qJJT f95TLNmx7DStA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 60652694DD for ; Sun, 18 Jan 2026 23:17:10 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id YEzSdoRRCbQN for ; Sun, 18 Jan 2026 23:17:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803430; bh=ca5zHqTD47wayMuSMO+0jtfymYMMcdmjYbVxoFHOrWQ=; 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=tOfusgmf8jTLIrcefsbo900GVtjmHrUvZfLP2CPfuqlw/+ga8JO3mQlSEAuPY2gl6 o6H8+IZVLUYDuIKmJq9h83MFl72nDddryzlEh/vc2fxipk439posSnUMyF94v5ecO0 D17q1nNm+3iWbH7P4ntYoKTWKTilkGipCumaEtH8GQiRbBeU36gk1DY/ZUGZZNfVe3 gJHwOe5U2l26HFl0vuPBqqVqEO003pL/46FO6v3quOYIW65FQX38/feUQv+j7b72i3 NgyP78+jb+Q0shKgDpSzLILjQnlU8E0x6FdN5IDW6wRNR6cbwJhJSU5go988O6qJJT f95TLNmx7DStA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4ED3C694CE for ; Sun, 18 Jan 2026 23:17:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803429; bh=3zaX2uU6rEd4qJ4cIU1J3RfTQVnlNtQZbz5AYBlhnHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQe/KgCzRNEO2eamOjlcOt8y2iHiHqeGus0QvQOeq9/2e+C4H0ZTuIeAGKGAo+LRp JXvt6DLfQbN06RR6tol32y9vUzKqYYHG/oBrIwvY/WuQg6MiYJj3ohizYvwtE9mU6q Wb8hGzYRSl65qgzm/2A5mM0EWX81mM4nJfKbEYfM1OEb5DVCqwh4YjP2aFD0A9f5n5 b8G60v8ZfhEHG6y/S/5N3J3E6AkaGEr5NMdV+1b3+99Wa9WKmc8YP6s7HiuR26zR1m BDD7uRJrJvDkA3uZtv8CKm/hYeqP414SjiI6S60B1FGNOsCXv86NTAPmjanwxb3dTM QeoAjM+aorBpw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 171BF693AE; Sun, 18 Jan 2026 23:17: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 jTs74drRdaYE; Sun, 18 Jan 2026 23:17:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803425; bh=iudjQOQdbnecfTy5fM9eb++XgunwBzM2CBJg6+HNy4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KxMoXrBn6IObrHyzYfbQnNdtVhJTSrSBIF7tUzhzp+uJuN+O1/INkhUPzvf4xqDaW gW62FumJ71bTg473Y2BBEEtQBNv0WiSpYU0eQGULJSfMNqWzVla7ZBb8CbvbbZvktm u6CkMQXeevLS2nsthzxDPGl+mpauy9xj67kKb52dp5LWXjcJT+4fTxDz1U8C0QEhXR eRK2DkIYX316ku8QtLDdBU5OjvA6Gtk6YUtBp52hJbXiyYQfDvup4fAglE4/IpNmH4 GMCtZpt1xCgjWeX2XedYZ7U6ywfA3/gxhT06RNlhjvDGMd1UzwpnyJHrzlPx79d1U+ XDaeWlTgOmseA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C406D694C0; Sun, 18 Jan 2026 23:17:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:16 -0700 Message-ID: <20260119061529.3383191-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: IXEQETFGWANB4MVACNPAUEL5TR65BM6N X-Message-ID-Hash: IXEQETFGWANB4MVACNPAUEL5TR65BM6N 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/23] ext4l: Move system_state definitions to linux/kernel.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add the system_states enum and system_state macro to linux/kernel.h where it belongs in Linux kernel organisation. U-Boot is single-threaded so system_state is always SYSTEM_RUNNING Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 +----- include/linux/kernel.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index b35559b8b18..9e3d59a3174 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1108,11 +1108,7 @@ static u64 __attribute__((unused)) __ext4_sectors[2]; #define sectors __ext4_sectors #define part_stat_read(p, f) ({ (void)(p); (void)(f); 0ULL; }) -/* System state - U-Boot is always running */ -#define system_state 0 -#define SYSTEM_HALT 1 -#define SYSTEM_POWER_OFF 2 -#define SYSTEM_RESTART 3 +/* system_state, SYSTEM_HALT, etc. are in linux/kernel.h */ /* Hex dump */ #define DUMP_PREFIX_ADDRESS 0 diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 9467edd65ab..d6cd54f20b9 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -296,4 +296,21 @@ */ #define find_closest(x, a, as) __find_closest(x, a, as, <=) +/* + * System state values - stub for U-Boot. + * U-Boot is always in running state. + */ +enum system_states { + SYSTEM_BOOTING, + SYSTEM_SCHEDULING, + SYSTEM_FREEING_INITMEM, + SYSTEM_RUNNING, + SYSTEM_HALT, + SYSTEM_POWER_OFF, + SYSTEM_RESTART, + SYSTEM_SUSPEND, +}; + +#define system_state SYSTEM_RUNNING + #endif From patchwork Mon Jan 19 06:15: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: 1626 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=1768803436; bh=dnIQNveI5OPRo77uCO9Vup+cPWfomxbU0JE5815E0U0=; 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=Cfu8Xvla/MpHlmd/xlPm+MS4qONndOn+Nx6Fzmi0ps3sLNgtfVqd4vkhRXtONSk2z /4id11V1kzdfqr//9Fu8hf7trvJvuxO5Orqj5CV4ebwJZgt/0TqExxGJ1l01MZKQvf pC6HwmIjoEDg3X52GIqZWlRHRebgIQVH8AvaJOGm019kL1ga9Fth7IL0HPGaOfs8P+ E/7x8m43QekxREW6Ey29iw8JRyekaWbgzOnDakssG5MTLfhaG+frYNzh+uW5GC1bMG nWG9FKY0ltv+etriG0GbV5MKbXBOXhZbmKIIkTKKU+WDfFK00phbD8MBlmaWrhfE2C I8h2ecuI4rZOw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 41650694E1 for ; Sun, 18 Jan 2026 23:17: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 P1y91mnTwLPj for ; Sun, 18 Jan 2026 23:17:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803436; bh=dnIQNveI5OPRo77uCO9Vup+cPWfomxbU0JE5815E0U0=; 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=Cfu8Xvla/MpHlmd/xlPm+MS4qONndOn+Nx6Fzmi0ps3sLNgtfVqd4vkhRXtONSk2z /4id11V1kzdfqr//9Fu8hf7trvJvuxO5Orqj5CV4ebwJZgt/0TqExxGJ1l01MZKQvf pC6HwmIjoEDg3X52GIqZWlRHRebgIQVH8AvaJOGm019kL1ga9Fth7IL0HPGaOfs8P+ E/7x8m43QekxREW6Ey29iw8JRyekaWbgzOnDakssG5MTLfhaG+frYNzh+uW5GC1bMG nWG9FKY0ltv+etriG0GbV5MKbXBOXhZbmKIIkTKKU+WDfFK00phbD8MBlmaWrhfE2C I8h2ecuI4rZOw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2C887694CE for ; Sun, 18 Jan 2026 23:17:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803433; bh=Qum2tpiZ4v+WWIDFQjQfGhMqIatBf8WpvYd1an7rjfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YtgivFF60nhG0YA/MPcjp4NIXIZfVAtay5WXXivwlj0wo1aZarEiDCg598mlngimZ Sqhmc3IPLp/4t+F7l079hDuaPyE+4CTxCrO7b2YEyLYk1BE/Ur/azMd8VDnahTbns0 tvFcM2W/01sm3JXMENWngUAVhzRCOMgPAa65+pEKTdhqzesTjyppejE1MapE2ZPXyK qilOJ+tlFmYsq+bzmFIW0fj8D5UgWlJo763MJfqtngjdCr3LWgPUJmMHZE/BhXDSEW nF5RrkKyqconZGyeWHVqM5wqxJ3QAl7jKQjizsxsD5dcV+YVjfOZ2oEo58JDSnp8or 2yKTXkZaInNlA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9DF4F693AE; Sun, 18 Jan 2026 23:17: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 T3e2XGywSkSn; Sun, 18 Jan 2026 23:17:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803429; bh=UKw6hkMVv+ijmVjo2Xpmzj4YP7muhkEzqvsYMx6IJbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aSu5FPOAb4HXPUdmHII+0MEkBWRJizedZ2/Z/ItRR+UnD1YPDdr+aTK9XsTl5eS+S 3yGj5QbxlwrcoY4TgZltIsGF17wq9z2U2CVU9aa2pg4At2MB8/4MkkaRu98Ve7IpCb FFdp5lFgPEsyO2CKLJXIdV3HemRZf4vCKuvNYzKpLfUQrdWw9WoY/HP408Z3b4vmwT KomxkC5T9Ku5fkJa4J3/qXXs6ucjVMe8YU/A4NrekuUZvL6fnQNyrgBOKUOguRQs4j qwsreQ0BMZfyRJuTfht4bvHUEbyrqJJJSUehY2whXAQR9g9V8p3tBaGiDXp0MKINWK K5a/FN/WhU8Ig== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5BCF0694C0; Sun, 18 Jan 2026 23:17:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:17 -0700 Message-ID: <20260119061529.3383191-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: V6UKD67YKJ3LJSGRUNBMHVICV5P5FGIB X-Message-ID-Hash: V6UKD67YKJ3LJSGRUNBMHVICV5P5FGIB 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/23] ext4l: Move BLK_OPEN_* flags to linux/blkdev.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the block device open flags to include/linux/blkdev.h where they belong with other block device definitions, matching Linux kernel organisation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 +----- include/linux/blkdev.h | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 9e3d59a3174..dc6d4c3910a 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1194,11 +1194,7 @@ void ext4_unregister_li_request(struct super_block *sb); #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) -#define BLK_OPEN_WRITE (1 << 1) -#define BLK_OPEN_RESTRICT_WRITES (1 << 2) - +/* BLK_OPEN_* flags are in linux/blkdev.h */ /* REQ_OP_*, REQ_SYNC, REQ_FUA are in linux/blk_types.h */ /* blk_holder_ops for block device */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8c848139a7e..f1a4cc12d3c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -18,6 +18,13 @@ struct gendisk; /* Block size helpers */ #define bdev_logical_block_size(bdev) 512 +/* Block device open flags */ +#define BLK_OPEN_READ (1 << 0) +#define BLK_OPEN_WRITE (1 << 1) +#define BLK_OPEN_EXCL (1 << 2) +#define BLK_OPEN_NDELAY (1 << 3) +#define BLK_OPEN_RESTRICT_WRITES (1 << 4) + /** * struct blk_plug - block I/O plug * From patchwork Mon Jan 19 06:15: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: 1627 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=1768803440; bh=pNaWEQMi260WbpcJ42q8FOvLJWjj/T2873Igk6LDXiA=; 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=nbxeQIlg70/CBpD/o2RC0rr4GczBeCXOxc09wPsOSgJPGpK1K5NDXe8lUnzLRHm0V PMb+jja7U61XUs5Wk/7gUf861nJgZjwxJzDz59gs/JVMiG1ACFXPnkvYlNMtfGYoBe oITsdJmwQ066ylZ4jNHl99MECBzygUc+IUQbfRwUsufAjMbsItguMnt2ClSvn9hGba XPTZWKqFWWl9vNCUJu2rIOkWWkcv2zTY405/N4RLZB/yNO7invVRZXCMH3eBeghmtg XnxHbROwUFHLKZ6CmAD0+JdSRck6t4q8S20yc7DYaDGpusDj2zcKAGMerSd+qxVQUS tD+Y73Ers6DsA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1A7C2694E5 for ; Sun, 18 Jan 2026 23:17: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 MoTUnA6Wex6s for ; Sun, 18 Jan 2026 23:17:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803440; bh=pNaWEQMi260WbpcJ42q8FOvLJWjj/T2873Igk6LDXiA=; 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=nbxeQIlg70/CBpD/o2RC0rr4GczBeCXOxc09wPsOSgJPGpK1K5NDXe8lUnzLRHm0V PMb+jja7U61XUs5Wk/7gUf861nJgZjwxJzDz59gs/JVMiG1ACFXPnkvYlNMtfGYoBe oITsdJmwQ066ylZ4jNHl99MECBzygUc+IUQbfRwUsufAjMbsItguMnt2ClSvn9hGba XPTZWKqFWWl9vNCUJu2rIOkWWkcv2zTY405/N4RLZB/yNO7invVRZXCMH3eBeghmtg XnxHbROwUFHLKZ6CmAD0+JdSRck6t4q8S20yc7DYaDGpusDj2zcKAGMerSd+qxVQUS tD+Y73Ers6DsA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0A3C6694CE for ; Sun, 18 Jan 2026 23:17:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803438; bh=3UnkmtfDKhui0+66wj/H82XgsLgXAUem+VjrTi36eD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nYbFy06Grlev49hzagKO2DwxHhr/TWsRwA1GuZM8WueDYxdzqiSEP8vrggn0r0cZr 4Zy2ean1qX36/17GeU/t58txhI4wONCa1hagUsQUq5lBXlmf0FYwvQASVDoTiyDOY2 YDM58hlvfJxPAbk2hbfexNl3ljmPPuWCMafkel/41xYCUNFCcW1S6/zz8xmf6qMCKx vmApzj7/B7M5/y5VlsZv5TVdjD97Yhpju13Ec5K0enMwexYbRZmDrJQWIjQdhTW34e AfsIpQTUulqsBEBCgOlIQQ6kgZriEMeOxXYtB4BWYP7uzQIlN5LsR2xTt8UBYfxAkI 8G42730BE2nyw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 305D2694CE; Sun, 18 Jan 2026 23:17: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 9Ruh36csFnN8; Sun, 18 Jan 2026 23:17:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803434; bh=m1k2xgvV2MvkPppEbYinExhtmTU0MhRdWyBdpsIXaBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nf5UN6NhNDW/xp806nDCAsojgrvv9hdCLeV5Net+JXqtsV5GtzJ6YHr0gAkw3TaPd e7e8H255z92ep/ciC3c/5s72st17cpwTw3RCgtZcRAmPHaR+DgtJnnycl7pHW0nK9e WFU/YCH+/TSSrpUUgi1m1uaA/b/PGSRpQXDo9MDLYbrnKIkMsuk1ULnQkbGG5Y8wbJ ocWG9CrCtcoOtKcUwecIMDak3FhQ7AqSWEojyJRlVSx6myF4k6HI26MGf9ZfPdu/Gl /DssEVfyFhiQXmX77lJ3yadn/ibrOKEHVR6O4BuZiCXgIZXcLos7/TWB2lcv0HJaHi 2mTpXsKFHL2bw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E1F7C694C0; Sun, 18 Jan 2026 23:17:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:18 -0700 Message-ID: <20260119061529.3383191-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NI5FUOZ67DGZFNX5BAC46SI6MWLNRXQX X-Message-ID-Hash: NI5FUOZ67DGZFNX5BAC46SI6MWLNRXQX 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/23] ext4l: Move scheduler stubs to linux/sched.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 schedule_timeout_interruptible(), schedule_timeout_uninterruptible(), and need_resched() to include/linux/sched.h where they belong with other scheduler functions. These are stubs since U-Boot is single-threaded. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 ++----- include/linux/sched.h | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index dc6d4c3910a..206bf4d784f 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1294,8 +1294,7 @@ void *kvzalloc(size_t size, gfp_t flags); #define sb_start_write(sb) do { } while (0) #define sb_end_write(sb) do { } while (0) -/* Scheduler stubs */ -#define schedule_timeout_interruptible(t) ({ (void)(t); 0; }) +/* schedule_timeout_interruptible is in linux/sched.h */ /* Page allocation - declarations for stub.c */ unsigned long get_zeroed_page(gfp_t gfp); @@ -1465,9 +1464,7 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, /* raw_cpu_ptr - get pointer to per-CPU data for current CPU */ #define raw_cpu_ptr(ptr) (ptr) -/* Scheduler stubs */ -#define schedule_timeout_uninterruptible(t) do { } while (0) -#define need_resched() (0) +/* schedule_timeout_uninterruptible, need_resched are in linux/sched.h */ /* Block device operations */ #define sb_find_get_block_nonatomic(sb, block) \ diff --git a/include/linux/sched.h b/include/linux/sched.h index 04672cee991..ff36a6443c8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -41,4 +41,11 @@ extern struct task_struct *current; #define signal_pending(task) 0 #define fatal_signal_pending(task) 0 +/* Scheduler timeout stubs - return immediately in U-Boot */ +#define schedule_timeout_interruptible(timeout) ({ (void)(timeout); 0; }) +#define schedule_timeout_uninterruptible(timeout) do { (void)(timeout); } while (0) + +/* Check if rescheduling is needed - always false in single-threaded U-Boot */ +#define need_resched() (0) + #endif /* _LINUX_SCHED_H */ From patchwork Mon Jan 19 06:15: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: 1628 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=1768803444; bh=3gPdxsVfslb5FMLHZ/mZQYw8qboE4Mfioo6yvmRczFo=; 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=QKp8fsv6nR3lZ6Bc9a72bM8H0h4rf7vFuii0XS0LvaRsABj574pH0RVvElrsZNlVS undthASD1tKu7edZ1CLLewzMijylqhz3qWFD8PpI9EoZ1UXThLYdx3eaGdATCWPk8Z waEl1Bb/CMvYJ11G89O7iGXtCZUTtKTKfdKPegvafkXq5sr3eLCTWC/oMhV2Y1NjLw u8L2Ws+unxwxvT5xNF9YpgdDKB9EDmYTEnzYbqOMcJcO+h4mAsjt/lOcQd12vizxj/ O0ZauPp2A5QqS5mMFiYDyEl5aTXBG/6cYRJbF/Jjf3DdZdUtBO9Od1+L3mYm0HzRFO mTwSDa9tBij/A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C542A694E1 for ; Sun, 18 Jan 2026 23:17:24 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AxeA3xvfcp9r for ; Sun, 18 Jan 2026 23:17:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803444; bh=3gPdxsVfslb5FMLHZ/mZQYw8qboE4Mfioo6yvmRczFo=; 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=QKp8fsv6nR3lZ6Bc9a72bM8H0h4rf7vFuii0XS0LvaRsABj574pH0RVvElrsZNlVS undthASD1tKu7edZ1CLLewzMijylqhz3qWFD8PpI9EoZ1UXThLYdx3eaGdATCWPk8Z waEl1Bb/CMvYJ11G89O7iGXtCZUTtKTKfdKPegvafkXq5sr3eLCTWC/oMhV2Y1NjLw u8L2Ws+unxwxvT5xNF9YpgdDKB9EDmYTEnzYbqOMcJcO+h4mAsjt/lOcQd12vizxj/ O0ZauPp2A5QqS5mMFiYDyEl5aTXBG/6cYRJbF/Jjf3DdZdUtBO9Od1+L3mYm0HzRFO mTwSDa9tBij/A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B4772694CE for ; Sun, 18 Jan 2026 23:17:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803442; bh=RjUHX0xMyf4z/ANbJa3fA5bhEFBY+EzKVPLBp9A62QM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XV7BZ8+hfFZT2YAyL2jYn8KLPxFFzbG/nsnbJeKs4oEPM1zFPpLZJ4Vo1+Du32Kfh NHgXy+Qh9OD9UL0HgKO+jIv5qoeyxdEvnpijhe0PpUfZO+m+jXMWx6zg3rv+++kJkA VFh+bLaBYjDndE+pUWIhBpGhWrEBKBeX2H6WK61jmLOd6AkKsDp/41h/Hj3TXWOwju isvoQc4ShbYWA1pGhv3JtQ6aQLt8zSi3WTiU7pojb/EOqnVTllakGbCE3u255hoEYH qCu+heRJmNoce6GlQCR4jbqQ/uqSUiYF0KewCbx3r5UG1k2yrIlDcEWVOenBriv1pt wEYYVz6DYGYUA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BBF22694CE; Sun, 18 Jan 2026 23:17: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 sZwIEyZ_2V2I; Sun, 18 Jan 2026 23:17:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803438; bh=/Vs9KiWF3rxRAihjGW1Dt2o70sTvsYT3NeG/4oEJa/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pbga/Eq24eDaywGYVDfGrHi9o8gfw4GkZF70BvvwFxhEH86hsTlP90O3NWBqa3M27 dndpYAM66UDW3x0h99dqoaq7KugX89bdlNYN1J9pIhr+iNnEAQT6LvOLpwQjklt0fh 6P8GajJCO9MdZGh7vmetu0657I28m2jLB9YcZEJr6jw3Cs9+EPBuGYAH7FZBQjV4yH wv5jjDS5+pf2pwYPBDxKBiREzRDeN/wbyqNgg0ERO+MQJbJXjbFs/q6s7a2FIB5Icm M6tQb+/F/mV20gkddAPjtazdixVhK3oqZ/HCmyb0ZOkQ9iZ++zWuK4Q2VJzUQuYzYy BqOVHVlQsGLVQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 772C6694C0; Sun, 18 Jan 2026 23:17:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:19 -0700 Message-ID: <20260119061529.3383191-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6FWIAMMQHA233QXPVFMF64TUV5NLC6KX X-Message-ID-Hash: 6FWIAMMQHA233QXPVFMF64TUV5NLC6KX 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/23] ext4l: Move PF_MEMALLOC flags to linux/sched.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 process flags (PF_MEMALLOC, PF_MEMALLOC_NOFS) to include/linux/sched.h where they belong with other task_struct-related definitions, matching Linux kernel organisation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 8 ++------ include/linux/sched.h | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 206bf4d784f..0a1b7406127 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -493,8 +493,7 @@ static inline int bdev_read_only(struct block_device *bdev) /* Forward declaration for swap */ struct swap_info_struct; -/* Process flags */ -#define PF_MEMALLOC 0x00000800 +/* PF_MEMALLOC is in linux/sched.h */ /* Forward declarations for inode operations */ struct inode_operations; @@ -1354,10 +1353,7 @@ static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, /* Nested inode locking stub */ #define inode_lock_nested(i, c) do { (void)(i); (void)(c); } while (0) -/* Process flags */ -#ifndef PF_MEMALLOC_NOFS -#define PF_MEMALLOC_NOFS 0x00040000 -#endif +/* PF_MEMALLOC_NOFS is in linux/sched.h */ /* generic_set_sb_d_ops, d_make_root are now in linux/dcache.h */ diff --git a/include/linux/sched.h b/include/linux/sched.h index ff36a6443c8..579468ee414 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -16,6 +16,10 @@ struct io_context { unsigned int ioprio; }; +/* Process flags */ +#define PF_MEMALLOC 0x00000800 /* Allocating memory */ +#define PF_MEMALLOC_NOFS 0x00040000 /* GFP_NOFS allocations */ + struct task_struct { int pid; char comm[16]; From patchwork Mon Jan 19 06:15: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: 1629 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=1768803447; bh=Ep4IkxSGSYvCfAtuCZIpqdGN9OhqzVLWXjcUrMyQiBQ=; 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=cZ91H3r7XbFYwY2EOx4TvZdgeWnak8Cb/IVOemIqzo+Kx+chcS3LnofL9wIfFpgaE tZ0KJjb8LQSuxZ1fZAxvM+ZSfI6e2oNRSA7RcH5XbSJtB3MXf13ovQpSZnzs/cPinZ Djo7LRYZpWJPVNDQGZ8+KueCE4qochO9b6F3cfMqiOt6amqpg4+0ZwApkrcBmI+Nm7 HynsWgDLP+vPHqtXYdNWUk5iU3pdEryscqX1m724pOe5mKjVSOO8pxjA6LeaWQUIVP Jv1iz/IEGf+uh29wegRXVrWQkdnt3nCyW96AXfzOiuetQqU7+/D0jAQFP8doakDNjj uJIUwvQMQkeBg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 34D34693AE for ; Sun, 18 Jan 2026 23:17: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 NIylVbzFdYFz for ; Sun, 18 Jan 2026 23:17:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803446; bh=Ep4IkxSGSYvCfAtuCZIpqdGN9OhqzVLWXjcUrMyQiBQ=; 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=WTgEjBaz3TPnB+7pRDYlfkT2+43CDKr4EvxTdwC0KOtyYhIqWlO0HCBHv53SH/LSA w/kNhbYakXhyExjZTk6W4lkRRfRdf8jwSBMGC9elVkI2BA8X1l05y8cikl2u/bSpId 7eDF+/koef5mlqnDYOmnIVusZRDNleAsWURLrWMxrMJKGlp195zET3wzCXsuFAbSvJ GzIj2hYXqivQ6QS4bLlC7GhrRoxGcLqyMRVXN2R81EPnoSSu6yg2SxGQUlGowgYUG4 0usjb2kQpwQoFrTIB9TuUz0LKt2kZOvKumuYZzy6cG4OF5Dw0Bsensv/dB9gnM4cfa CcNapm68Pnyfw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 27E07694CE for ; Sun, 18 Jan 2026 23:17:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803443; bh=HGS+3h+gXG47FDdfsvbwAQnjyxk9lNw9PQfTNe2ratc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dvy04fDAoBeh6BPBi+2U1LkgNr5nhkUsF4W33kgb9TH0h1UInhYOPQF+aVg/5TwHV 5kwm+JpZOcorM+B7Lm79xV08T+BL1LOiwwUyUGcv15B5nS35B5OFV/o8MxrdCw+q5F +KHfv7yLW1vNrgiqoAx5idwDR96VA7ZgvuCtg9AvO5Fw1G7QmsAbW0UbE3pKTn5UOo cNT+1pgvyy1MY6g3Vln2jR5rcJZprXKmEXqI354farpg1UE/lQbZCSyQOExZIxAasm cnLjMBlDvKjTeQFMuxvuPaNlJzR4QIFR0kWCJXEzfG9bujt9+0uLaNzoB14hokhMiq FY6dwq5p84TgA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8E23C694CE; Sun, 18 Jan 2026 23:17: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 10026) with ESMTP id T6HqB5kCTnOK; Sun, 18 Jan 2026 23:17:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803443; bh=nC4XrTdpzJd4nAdCUWKzUtAadmGTWaXojowLYTokH5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rWjMm2wRV5ohUjEnrxU8YXpBNKSqOj9jhEiTIFlG3ZWzWdUE75cNjakU7XHjM5N9t /ZdVQqH4+QrFFZQIoR4eR5ycvEMZ0GV8CBtuvcrXr2c+XPLm6QUYa68TzED2d8RkJP Z8TDURPqK+hmftcExLU4berFWq8y2naENeZHC85vMPZFra0SQetmcJwkz3Nj6m9Azx lAM+5I36Cacv2duwelV85x2nRzSGr39cZXj+UUXmjcb5SeZchfpjkLdqhimj0wlO0i mh6BWjpXyE7vBw2N5yuQ/Q5bBoMAqhPpecp7KTfmLt1qteA6k7KqT0cY9hvFHvkrew GGFBpy9a1Vf7w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0C231694C0; Sun, 18 Jan 2026 23:17:22 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:20 -0700 Message-ID: <20260119061529.3383191-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NDKJKZMNOMDK5WDPRR4XILNPU7GAHDEN X-Message-ID-Hash: NDKJKZMNOMDK5WDPRR4XILNPU7GAHDEN 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/23] ext4l: Move SECTOR_SHIFT to linux/blk_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 Add SECTOR_SHIFT and SECTOR_SIZE definitions to include/linux/blk_types.h where they belong with other block layer types, matching Linux kernel organisation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 +--- include/linux/blk_types.h | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 0a1b7406127..f3b1aaaa408 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1611,9 +1611,7 @@ int bh_read(struct buffer_head *bh, int flags); ({ (void)(bdev); (void)(s); (void)(n); (void)(gfp); 0; }) #define blkdev_issue_zeroout(bdev, s, n, gfp, f) \ ({ (void)(bdev); (void)(s); (void)(n); (void)(gfp); (void)(f); 0; }) -#ifndef SECTOR_SHIFT -#define SECTOR_SHIFT 9 -#endif +/* SECTOR_SHIFT, SECTOR_SIZE are in linux/blk_types.h */ /* mapping_max_folio_order is in linux/pagemap.h */ /* Memory allocation for journal.c */ diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index a842300ae64..1c3c7c99e48 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -12,6 +12,14 @@ #include +/* Sector size definitions */ +#ifndef SECTOR_SHIFT +#define SECTOR_SHIFT 9 +#endif +#ifndef SECTOR_SIZE +#define SECTOR_SIZE (1 << SECTOR_SHIFT) +#endif + /* Block I/O operation flags */ typedef __u32 __bitwise blk_opf_t; From patchwork Mon Jan 19 06:15: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: 1630 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=1768803451; bh=pG8iiFwaKbJnoBjLBW4oOrjvUZZ3jBRs5nDtxdYtsvE=; 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=Km5JVXPxNR1YW1tKFszU0d6INUA+xwZdq8TvnM7zXZpEZQccGJDPNHD7zNXcwMaBd FJkPB3zOaEGXqBDZ9nVQLST/nMC34qHulySb5E5iOt+/JQ8LNHauNVCAjbFGkSXQn5 Jup1SfYtoY6iZb4EjAY8YgrQNTwoUWtLzAqbINaN/Gn3Bauev/ylZ7mcnk6j6ewBb9 2GTcGRWNE3EN/bzaXDijscilrVNw7JPtZMKWYptcRs0QTN617Gj5YabDwSSM6QlmwK CvXCa6UiGFQZCHtEuxtmV4UlqppXInOpmWmU+JYS2k3Yp7Wp2uOW9+siS2JtT4OQ47 vq1Sr9d07cz1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1FD0694DD for ; Sun, 18 Jan 2026 23:17: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 O-7Erz5veo4J for ; Sun, 18 Jan 2026 23:17:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803451; bh=pG8iiFwaKbJnoBjLBW4oOrjvUZZ3jBRs5nDtxdYtsvE=; 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=Km5JVXPxNR1YW1tKFszU0d6INUA+xwZdq8TvnM7zXZpEZQccGJDPNHD7zNXcwMaBd FJkPB3zOaEGXqBDZ9nVQLST/nMC34qHulySb5E5iOt+/JQ8LNHauNVCAjbFGkSXQn5 Jup1SfYtoY6iZb4EjAY8YgrQNTwoUWtLzAqbINaN/Gn3Bauev/ylZ7mcnk6j6ewBb9 2GTcGRWNE3EN/bzaXDijscilrVNw7JPtZMKWYptcRs0QTN617Gj5YabDwSSM6QlmwK CvXCa6UiGFQZCHtEuxtmV4UlqppXInOpmWmU+JYS2k3Yp7Wp2uOW9+siS2JtT4OQ47 vq1Sr9d07cz1g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8FC6A694CE for ; Sun, 18 Jan 2026 23:17:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803449; bh=xAyBSa/Nj8x9Yu7145OxzYw3KdHYgYrreSoSlnDFCQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HOshhVfMoDuRreojQOX2t5fss3huAapHxa/gLdNs8nmQal5h0MP1kMoyWl8iYxsq7 ASUEAHIeLrqn+xS8zpFhu160NpZrY/qZCBlX/YHv0g704WdY4pvqvtUFONxqugGPkg qTL8Xls70Dh4AmoskqvIIE2wppvUt7McCSwoyZnD7bWypa+unBnDQlCy+VsQ6iHbp7 LrVx8fiGwVX6kyw+dRtzW3s9IM/IATUWHpQ8xZT2XgHhlLF9dNM5sM15QtxkLzwP74 Jc0QDiNdj5MMtX6E8/Vc5foHqM2JXau3kdenQv4iw7Q2mH2mo5G1neTQJKvtbSAvjg DbCpXbWroppIQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 82AA9693AE; Sun, 18 Jan 2026 23:17: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 w3pZ8Zm8HZY9; Sun, 18 Jan 2026 23:17:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803444; bh=I6oSCMhMoBrgA7qKptTDzPaj1stgHQezLCoFDey8R88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JEGQhowq4T/sx0Q1UBuAlT45fZvoGryeOebaF9YmIiF+csv1orYSmlsbv17RyWoVc fVDxOSWi4WEeJ/Y+O2eFmPdOCzGTVLoahPixqPdIHzswLwZK4KvSgL/BLEDF5x3dlD lAVSS6MAbioyVgM/1keuuEwbU7nnPIs1390/q2cT3GF6d9dmpSInI8q0x1ZPYr+URR e+k8nO5PJZobKTfX0U5Iecr370w8cWBJ1HY9kb9Odc7EftuyiPR0IdJbRnPcZ6xpia VIe/iKfVR1cHdmkaF9Z5lKbRM7k8TcYZWLTWFY7UvsSEbS2lB8P+Z1qRrMkj2davz+ O+77D9PD9Q+xQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D03B2694C0; Sun, 18 Jan 2026 23:17:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:21 -0700 Message-ID: <20260119061529.3383191-24-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: L22KJRZ7YJDRS27JSMKYTBPSSC76MF5D X-Message-ID-Hash: L22KJRZ7YJDRS27JSMKYTBPSSC76MF5D 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/23] ext4l: Move I_MUTEX_* constants 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 Add the inode mutex nesting classes (I_MUTEX_NORMAL, I_MUTEX_PARENT, I_MUTEX_CHILD, I_MUTEX_XATTR, etc.) to include/linux/fs.h where they belong with other filesystem-related definitions, matching Linux kernel organisation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 +----- include/linux/fs.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index f3b1aaaa408..ba462af45e4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1344,11 +1344,7 @@ static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, #define xattr_handler_can_list(h, d) ({ (void)(h); (void)(d); 0; }) #define xattr_prefix(h) ({ (void)(h); (const char *)NULL; }) -/* Inode lock mutex classes */ -#define I_MUTEX_XATTR 5 -#define I_MUTEX_CHILD 4 -#define I_MUTEX_PARENT 3 -#define I_MUTEX_NORMAL 2 +/* I_MUTEX_* inode lock classes are in linux/fs.h */ /* Nested inode locking stub */ #define inode_lock_nested(i, c) do { (void)(i); (void)(c); } while (0) diff --git a/include/linux/fs.h b/include/linux/fs.h index 28b57b59484..5c357cdacd2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -260,4 +260,14 @@ static inline bool dir_emit(struct dir_context *ctx, const char *name, int len, #define dir_relax_shared(i) ({ (void)(i); 1; }) +/* Inode mutex nesting classes */ +enum { + I_MUTEX_NORMAL, + I_MUTEX_PARENT, + I_MUTEX_CHILD, + I_MUTEX_XATTR, + I_MUTEX_NONDIR2, + I_MUTEX_PARENT2, +}; + #endif /* _LINUX_FS_H */