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