From patchwork Sun Jan 18 20:37:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1583 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=1768768737; bh=LVyJV7XCboQAyRA5SwMaiWVzYErFKEJL5IohykzCojY=; 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=MpJrffG93IiN1Mnyy4MvHzO4fSe7Sf7pb52qLOQ87Zpsi+17m0iuuXyXOLA6z+ek/ I9wPXiVICJLvinrboBDP2QIPB5+K994Q2umNxTnHxDahk+GD3UQKFrjWiCvtf790Z6 aFvphA26o+qvAaUGsWlYH8CW9dG0quEWBzq5rh1pViqiik3hWVTDfyb3Cx388oBC2m vx2uJ9A6vK/LjcLu/GJuCO7TCN2OC9loeglIsKzaAKHLmyvCfY/zsgIA7rUaYY5o7g Ee+OsqMRC42EN3fC/vQ4e86NhoGC4/MeBnEzHiTebpDNuy3FmoUKriKGEqXsfJXTLd 7iZdlunl42cIA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9F4CC69489 for ; Sun, 18 Jan 2026 13:38: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 DZbYIY9mEJV1 for ; Sun, 18 Jan 2026 13:38:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768737; bh=LVyJV7XCboQAyRA5SwMaiWVzYErFKEJL5IohykzCojY=; 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=MpJrffG93IiN1Mnyy4MvHzO4fSe7Sf7pb52qLOQ87Zpsi+17m0iuuXyXOLA6z+ek/ I9wPXiVICJLvinrboBDP2QIPB5+K994Q2umNxTnHxDahk+GD3UQKFrjWiCvtf790Z6 aFvphA26o+qvAaUGsWlYH8CW9dG0quEWBzq5rh1pViqiik3hWVTDfyb3Cx388oBC2m vx2uJ9A6vK/LjcLu/GJuCO7TCN2OC9loeglIsKzaAKHLmyvCfY/zsgIA7rUaYY5o7g Ee+OsqMRC42EN3fC/vQ4e86NhoGC4/MeBnEzHiTebpDNuy3FmoUKriKGEqXsfJXTLd 7iZdlunl42cIA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7236769487 for ; Sun, 18 Jan 2026 13:38:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768734; bh=salPETtqg1yDUvZ1ASWXu0V4TPJFWMQZC1duC+56Kxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nc4iH3bfHm9hAYEw6hwvUU0oL7MhNO0nzXgnZIzd+zbJde6x6DD6HU+fljJsj5bDr BLu3TKGOnL0g2dNEh4yXo/1H5sQLkCPoeEKdxbR1Emy13jSRblGlxBd72X4b5JuNTs MdAFfBsPnoPYWwqj4+yKLDno3mlBjCO1gBJRUZPXWcHQB+TbOrX3Slrq1FvnT+G1YU oRXpMQki1sAZgcryrw2zwMCH8D7EqG3A8PS5W8gSjNk174Qv44IN4MyZ4BfUmwlUC5 N2UDcnXkD9MbfnlgJiMuBEn2wGIuY/++wGTPFO3LDmkn1xxvm5mfVYrfR1sWdrwc+f In678m5HpnkJA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0057C69476; Sun, 18 Jan 2026 13:38:54 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id HIOxjY42TqZP; Sun, 18 Jan 2026 13:38:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768728; bh=CFT0ZWjQFKpKdVq0BiOXMr2IvCX/51e2jOlHOazdwOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t2EY/HrzApkMbm26S+k/QXynf7mxh476rfiLGAgDTFopxxAbVWjqE8G16s+oPQIgO 7g6eMdRUcikFyiVv80mjYa5oqdT1VSqsunx4XDGVOHvOWwF3I7m2mCNTSH7jut54Uj +txHU4knI02KHamNYVsx97osK9dbUK+YXXSNlvKG1J6qeiMEmkqEcuH7h5cLhzATpi LeKFIqsFKm7KvR1WWeCnnheDExD+EzHh9wrDbfX++23SSsDGFG1HxMzGRDf+Au4XVT lAATBY2M/y94xWelF5qdhip1CRKahgCH2sP1VyiejpZghYDWeMwihSLtkYjktAG1bd +dY9x0a1eCCOw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CF49A6919C; Sun, 18 Jan 2026 13:38:47 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 13:37:26 -0700 Message-ID: <20260118133734.4.796271526d07541b732e7b97de733563613fa131@changeid> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260118203739.1974323-1-sjg@u-boot.org> References: <20260118203739.1974323-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4LPNYQIF2WAY4RZVH5EZC3HIRPCJX67L X-Message-ID-Hash: 4LPNYQIF2WAY4RZVH5EZC3HIRPCJX67L 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/12] linux: Add statfs.h header with kstatfs struct 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/statfs.h with the kstatfs structure for filesystem statistics reporting. Update ext4_uboot.h to use the new header instead of duplicating the structure definition. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 17 ++--------------- include/linux/statfs.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 include/linux/statfs.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 185951ac4c1..f686364a761 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1300,21 +1300,8 @@ static inline __kernel_fsid_t uuid_to_fsid(const u8 *uuid) return fsid; } -/* kstatfs for statfs */ -struct kstatfs { - long f_type; - long f_bsize; - u64 f_blocks; - u64 f_bfree; - u64 f_bavail; - u64 f_files; - u64 f_ffree; - __kernel_fsid_t f_fsid; - long f_namelen; - long f_frsize; - long f_flags; - long f_spare[4]; -}; +/* kstatfs - use linux/statfs.h */ +#include /* struct seq_file is in linux/seq_file.h */ diff --git a/include/linux/statfs.h b/include/linux/statfs.h new file mode 100644 index 00000000000..bdc3f9b9e87 --- /dev/null +++ b/include/linux/statfs.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Filesystem statistics definitions for U-Boot + * + * Based on Linux statfs.h + */ +#ifndef _LINUX_STATFS_H +#define _LINUX_STATFS_H + +#include + +/** + * struct kstatfs - kernel filesystem statistics + * @f_type: filesystem type + * @f_bsize: optimal transfer block size + * @f_blocks: total data blocks in filesystem + * @f_bfree: free blocks in filesystem + * @f_bavail: free blocks available to unprivileged user + * @f_files: total file nodes in filesystem + * @f_ffree: free file nodes in filesystem + * @f_fsid: filesystem ID + * @f_namelen: maximum length of filenames + * @f_frsize: fragment size + * @f_flags: mount flags + * @f_spare: spare for later + */ +struct kstatfs { + long f_type; + long f_bsize; + u64 f_blocks; + u64 f_bfree; + u64 f_bavail; + u64 f_files; + u64 f_ffree; + __kernel_fsid_t f_fsid; + long f_namelen; + long f_frsize; + long f_flags; + long f_spare[4]; +}; + +#endif /* _LINUX_STATFS_H */