From patchwork Wed Jan 21 22:08: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: 1734 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=1769033383; bh=00kvfHFNZoizeiHkQhrqP3PvFPLtOFrqnqqAcE5dtm4=; 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=GHnvf1mWKaBOAFXWyh+fROl4YBfazw0dsFHy/ebvf7iCM84U4IxdLg3ZT0HWlDxPF g//2+vqjbCVF1IszB8a8nXiR1T2hLlp3WYsRFTVhwc9BFNQSTdFFpkrb7IaYkKiz/k nM+pzaaroY7k0GVMIlwuRx5IWstbVDIKI+3zF1vu2kjjyF/MWouaykY+IDjPod4foi KuflH2ZdfLCP141UbYSRbMq0Zp6pJI304Z2FftAF8C1qfgRaijmtW7p3+iqyU/+m0x HjGhDYp9QaCOZ49Cx+EbRfNFjnnSGruNA2meUOPNzgaYazqlm0dp6XqQhhxCYDp6Ul QA+G3MpTshvSw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E51C669605 for ; Wed, 21 Jan 2026 15:09:43 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 4vrcShMYopoi for ; Wed, 21 Jan 2026 15:09:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033383; bh=00kvfHFNZoizeiHkQhrqP3PvFPLtOFrqnqqAcE5dtm4=; 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=GHnvf1mWKaBOAFXWyh+fROl4YBfazw0dsFHy/ebvf7iCM84U4IxdLg3ZT0HWlDxPF g//2+vqjbCVF1IszB8a8nXiR1T2hLlp3WYsRFTVhwc9BFNQSTdFFpkrb7IaYkKiz/k nM+pzaaroY7k0GVMIlwuRx5IWstbVDIKI+3zF1vu2kjjyF/MWouaykY+IDjPod4foi KuflH2ZdfLCP141UbYSRbMq0Zp6pJI304Z2FftAF8C1qfgRaijmtW7p3+iqyU/+m0x HjGhDYp9QaCOZ49Cx+EbRfNFjnnSGruNA2meUOPNzgaYazqlm0dp6XqQhhxCYDp6Ul QA+G3MpTshvSw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D2D82695F7 for ; Wed, 21 Jan 2026 15:09:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033381; bh=FOB9hjqLSfO6jzGKq/Iy9zNc+2jAvX0/vMXvW5QlbvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/qlswZ8WqJLJ/h/gQGTTNGjhUADAr6Xr3RWY0/cgFGglWMk401m9P1YJeb9AEbqw VzOugCLJtzkzuFu6OXw/8AeV6+KbKZc4PVkRfyi4qVtFBCs9+ktH5tCKcu6HSo+J3L sxx+uHqXdGH9cTB4xeY5JiU4kTWOfNYTe/Ylfk/+/oajQlxoZcvcb3gJzPjofQSBFJ vpIByjINxZEiA9UK1RUCw1OcIsVvyg6XFnRCh4Vv4w+bM/v0KtdToR1okVJl+I1MQi u7GjNAJ+kX2Foxy76F5uXE0KLjxrTGgpTG1cvOGkSzjr0M8EB8pnhqhcxrUXo4MDBM mb1g40FHYdbzQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AC375695F7; Wed, 21 Jan 2026 15:09: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 KP8DQNQdRhyz; Wed, 21 Jan 2026 15:09:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033377; bh=eqnqwuqgoO/gga32Q3m1WGk0SwZwJp9+jbZdsCRPSak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mnw7UE2J83RMWRmThRdctpsZL7NyLexqSyhmSCnl/F+YQYfO6GxJZLWIz3aUlLQ9M I9lNZowm4LLu7egyo5S/GAbDWLLwfy7J0EOwpjqrq1V4N0R0w33XygCmA0ZHbMEBG9 8sKP0GiEtvsrJCL2FhYYbOz4/fBbHh3xbXMvKyne15vwv9QA5/XPt2OTfBFRLdFj9c 1xwN4XVhb68mjJujGjveUGWQRTbnnVmPKLhaF1c5H9fh32xGFLLuVzQ78reerlbGdt L5GFJKqPSHvbCpPcaktY6Oe2KHKPVdtDGQOCqoQpni4lnm0hT/1jIgAB7Fv6SZJ/uP hhRJUG1kmkAfA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 530BF695FD; Wed, 21 Jan 2026 15:09:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:21 -0700 Message-ID: <20260121220857.2137568-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RU2TYVVS4EPRGRZCSLTTJ4OLDWIFYOJ4 X-Message-ID-Hash: RU2TYVVS4EPRGRZCSLTTJ4OLDWIFYOJ4 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/33] ext4l: Move inode state accessors to linux/fs.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the inode state accessor functions from ext4_uboot.h to include/linux/fs.h where struct inode is defined. This includes: - inode_state_read_once(), inode_state_read() - inode_state_set_raw(), inode_state_set() - inode_state_clear_raw(), inode_state_clear() - inode_state_assign_raw(), inode_state_assign() Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 46 ------------------------------------------- include/linux/fs.h | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 278351a9fef..d3ad76f2618 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -183,52 +183,6 @@ static inline int bdev_read_only(struct block_device *bdev) #define WHITEOUT_DEV 0 #define WHITEOUT_MODE 0 -/* - * Inode state accessors - simplified for single-threaded U-Boot. - * Linux uses READ_ONCE/WRITE_ONCE and lockdep assertions; we use direct access. - */ -static inline unsigned long inode_state_read_once(struct inode *inode) -{ - return inode->i_state; -} - -static inline unsigned long inode_state_read(struct inode *inode) -{ - return inode->i_state; -} - -static inline void inode_state_set_raw(struct inode *inode, unsigned long flags) -{ - inode->i_state |= flags; -} - -static inline void inode_state_set(struct inode *inode, unsigned long flags) -{ - inode->i_state |= flags; -} - -static inline void inode_state_clear_raw(struct inode *inode, - unsigned long flags) -{ - inode->i_state &= ~flags; -} - -static inline void inode_state_clear(struct inode *inode, unsigned long flags) -{ - inode->i_state &= ~flags; -} - -static inline void inode_state_assign_raw(struct inode *inode, - unsigned long flags) -{ - inode->i_state = flags; -} - -static inline void inode_state_assign(struct inode *inode, unsigned long flags) -{ - inode->i_state = flags; -} - /* QSTR_INIT and dotdot_name are now in linux/dcache.h */ /* diff --git a/include/linux/fs.h b/include/linux/fs.h index e78ac5f7284..f50a081b32b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -227,6 +227,52 @@ static inline unsigned int i_gid_read(const struct inode *inode) return inode->i_gid.val; } +/* + * Inode state accessors - simplified for single-threaded U-Boot. + * Linux uses READ_ONCE/WRITE_ONCE and lockdep assertions; we use direct access. + */ +static inline unsigned long inode_state_read_once(struct inode *inode) +{ + return inode->i_state; +} + +static inline unsigned long inode_state_read(struct inode *inode) +{ + return inode->i_state; +} + +static inline void inode_state_set_raw(struct inode *inode, unsigned long flags) +{ + inode->i_state |= flags; +} + +static inline void inode_state_set(struct inode *inode, unsigned long flags) +{ + inode->i_state |= flags; +} + +static inline void inode_state_clear_raw(struct inode *inode, + unsigned long flags) +{ + inode->i_state &= ~flags; +} + +static inline void inode_state_clear(struct inode *inode, unsigned long flags) +{ + inode->i_state &= ~flags; +} + +static inline void inode_state_assign_raw(struct inode *inode, + unsigned long flags) +{ + inode->i_state = flags; +} + +static inline void inode_state_assign(struct inode *inode, unsigned long flags) +{ + inode->i_state = flags; +} + /* block_device - minimal stub */ struct block_device { struct address_space *bd_mapping;