From patchwork Sat Dec 20 23:23:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1001 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=1766273079; bh=t5HGGxi7qITsMrJgRz2HDy4uoT5BPKkNi95hn/bfzZs=; 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=EN2FaQ6LWljHTAmBE7AqDE34vF2t1bYGAf4jwUGVmHhY7Q7qbCwBf3Bf//XI9lG6t IviCtM+i7Uo/K99z0T9GjqmhtrkDrPtkVeiniymu/Z+Om1nlIO8rXx3rRG4FQih8+8 5+oqcx2J4KkDiFRFI/uupGu58+nZJgbMZkxbPh7gj++dqvDa9hV2dTCmaygiKpPbJq lHTUtIhhg+EDlo0QH1AmV13Hvamz1MKfM59vik9tqKn61PHPUeU2c26QdC8+mZQgrW WXTQbiMlnQ9I2szxlewAptmXNxxazk/4e5EN0szXM9ELVrnYLe2G4+13GvV4U/nNDj Wi/lLxGA2E0Fw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2899D64C8E for ; Sat, 20 Dec 2025 16:24: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 x3id3qauWtAh for ; Sat, 20 Dec 2025 16:24:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766273079; bh=t5HGGxi7qITsMrJgRz2HDy4uoT5BPKkNi95hn/bfzZs=; 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=EN2FaQ6LWljHTAmBE7AqDE34vF2t1bYGAf4jwUGVmHhY7Q7qbCwBf3Bf//XI9lG6t IviCtM+i7Uo/K99z0T9GjqmhtrkDrPtkVeiniymu/Z+Om1nlIO8rXx3rRG4FQih8+8 5+oqcx2J4KkDiFRFI/uupGu58+nZJgbMZkxbPh7gj++dqvDa9hV2dTCmaygiKpPbJq lHTUtIhhg+EDlo0QH1AmV13Hvamz1MKfM59vik9tqKn61PHPUeU2c26QdC8+mZQgrW WXTQbiMlnQ9I2szxlewAptmXNxxazk/4e5EN0szXM9ELVrnYLe2G4+13GvV4U/nNDj Wi/lLxGA2E0Fw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1875E64C46 for ; Sat, 20 Dec 2025 16:24:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766273077; bh=R3PhcZez1zoyAWAo0YlgJHSihgwDxFzlMLqlcXU8GFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QByIviQwKZuYTt3GReFrXgRD5dajTGUp0lwUfdOYwWjO5J6yvQmM7RtxMYpQph0uG wT9xI+QKb1CRR77euWHwlHcW3pJnBsN5TnC9uLdDaRzVV3pMPsHj40JrK9GQfIWGal iPjND7zPu/o2pMAkJaWnek1OPCQAl6BiNKVR6DuyPOq6WTBQOLaF089MdySlOqwhPs 0HFAIX/ORx26N1lCNE1FAhQivZK+kOnf/IbKHiE1M4CQiagtYWVKcALKkhtsisulbB ILk3LNz3eAf549AP5rM+PCApn4exFHjJ7g9/xmEGQQnqopzxX/kyNLq1GeMsv5wBn8 YWh1m1ZgChMKA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A90D964C29; Sat, 20 Dec 2025 16:24: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 cfxt4mYy6SAK; Sat, 20 Dec 2025 16:24:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766273073; bh=6wTvnsb8faFDyoc2t1T7mPKKV/xedMW1UmCWsHFyDSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sll4alXe0MRer0o7uz3s8vhVyZAcKQoL6fEmB0ago+lz/Uk3NPcuMtgOWIwk75JZd lFR4/fpOrp9j/xAPkA78LcVjJ20KeAY4G/MaVczsZsCXSjtG9YJlNyDBORwPNXTGrn dnFLjDPAMpNQWyF2m8p9e5gGOMpnC1I3aMaT0fgqYBLnsKILHqMoMtdeCdbIJyRluV sJVWZ9hwUKDZtKBzgd8z1hzx+bbN6rjLKeVQ5JLaRqK8yWYnrF5VBAHiDjJsdIlwPz pXxkl0FViM8PxfkS09D5CYWsbRdpCn1Fbg+Xv56XOaC+qfajvrNarBf1PATWOBuNAJ W+NzNW/elSorA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 584B464C25; Sat, 20 Dec 2025 16:24:33 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 20 Dec 2025 16:23:47 -0700 Message-ID: <20251220232355.845414-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251220232355.845414-1-sjg@u-boot.org> References: <20251220232355.845414-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WP5HNVDBZ6WJ7KUNEWWP5QELKLZMEZCB X-Message-ID-Hash: WP5HNVDBZ6WJ7KUNEWWP5QELKLZMEZCB 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/10] ext4l: Add kiocb, iov_iter structures and IOCB_* constants 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 infrastructure needed for file.c and other VFS-integrated files: - Add struct kiocb (kernel I/O control block) - Add struct iov_iter forward declaration - Add IOCB_DIRECT, IOCB_NOWAIT, IOCB_ATOMIC constants - Add iov_iter_truncate, iov_iter_count, iov_iter_alignment stubs - Remove ext4_init_acl macro (provided by acl.h) Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 23 +++++++++++++++++++---- fs/ext4l/ialloc.c | 1 + 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 1d0c58c4f38..ea28d0fcc63 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -181,6 +181,24 @@ struct file_ra_state { /* struct file is defined in linux/fs.h */ +/* kiocb - kernel I/O control block */ +struct iov_iter; + +struct kiocb { + int ki_flags; + struct file *ki_filp; + loff_t ki_pos; +}; + +#define IOCB_DIRECT 0x0001 +#define IOCB_NOWAIT 0x0002 +#define IOCB_ATOMIC 0x0004 + +/* iov_iter stubs */ +#define iov_iter_truncate(i, count) do { } while (0) +#define iov_iter_count(i) 0 +#define iov_iter_alignment(iter) 0 + /* __counted_by attribute - not available in U-Boot */ #define __counted_by(x) @@ -378,10 +396,7 @@ extern struct user_namespace init_user_ns; #define fscrypt_prepare_new_inode(dir, i, e) ({ (void)(dir); (void)(i); (void)(e); 0; }) #define fscrypt_set_context(inode, handle) ({ (void)(inode); (void)(handle); 0; }) -/* ACL and security stubs - only if acl.h won't be included */ -#ifndef _FS_EXT4_ACL_H -#define ext4_init_acl(h, i, d) ({ (void)(h); (void)(i); (void)(d); 0; }) -#endif +/* ext4_init_acl is provided by acl.h */ /* xattr stubs for files that don't include xattr.h */ struct super_block; struct buffer_head; diff --git a/fs/ext4l/ialloc.c b/fs/ext4l/ialloc.c index d72204a5d02..5bbe8d6d359 100644 --- a/fs/ext4l/ialloc.c +++ b/fs/ext4l/ialloc.c @@ -17,6 +17,7 @@ #include "ext4.h" #include "ext4_jbd2.h" #include "xattr.h" +#include "acl.h" /* * ialloc.c contains the inodes allocation and deallocation routines