From patchwork Sun Jan 18 20:37:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1581 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=1768768726; bh=mD9h/ALesj0qTJJ/r208V+n+I1Iw5GQgcODW/cM+rBM=; 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=q0Vbb6fbrwr3hRpgdUz/GARQS+27NM2vSz4beCvFW2E/zEhGSltGGW/gEFVAK1UlE buKxkz1gFMnOGt5sn7lvlHgfsgmBSBKkdDbzoGiR8bVqdzq3vr4W8PZDXa2TujbCRO 5bwu2zi0XapiirtBwkZPnjZ2zHWDkXrTNIxPYidnv+KI5PgfVMZ/m/8tQ9kTjNIEqa ON1ukc3dXVw8G8w7IxitW+xTKiFkHvQ1HppbYN7OHnrd3o6Z3fLET+6l1jiHFwCS91 ZOXmuqe9FbG3TcWN94bwFATNjuzuB36uC4RZR+cUy9VVSSdWgfRh3NEyYrwL/SaOsI ZDyUtstZ/TJUQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 804E369487 for ; Sun, 18 Jan 2026 13:38: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 10024) with ESMTP id SRIEp_m7wPMQ for ; Sun, 18 Jan 2026 13:38:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768725; bh=mD9h/ALesj0qTJJ/r208V+n+I1Iw5GQgcODW/cM+rBM=; 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=w0mXR+QjhW6V4Cxbzj/QCi+8bzE/MCg1UlVc3T/Z+ym5UdyEgyFcUmQmYy7fzO82Q 4Hh87QzViXpRNzpbClSvTmfTdX8oQsVJw6zWzToe0+6jePtTLqWlyLcaMa6inSjZdx Ew1zHJanHrrNoz7dYrcKEOebYXRtxOP8l3FFPnm3ZGRlHVKad7R3z9/MzL2L6VXhLr kqA2yuCmTmx+6KF0MpzJWlNRNcrUg45LFbYnrYFEH8D+SH/5Z6/mAGpl9Rox3zU6c3 CpEhjr8+u12u7Jgp+kYYdYGx7O2FernuueOzBfN7zyq73u3+QdXrero4AiHkUYq4bG iS3mpmsJk6ZYQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 81AE369485 for ; Sun, 18 Jan 2026 13:38:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768723; bh=dfDMXWPCajcGuJr9dXbWK8Q2QKha1dUIfEj2ZxKwMYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H8rXGIogYaB79OETHnoquhNMTxPyNtW05w7VOE8e7OeJEAuSyYQhqnmuBbMXEeVHx Qq9yUlY0vLq48ZDBfMLtPyRHRSGvsAzyNlN1tVUPJ86NTb8F3HE2O5zKLVWBks8kpW Dt75d63jXgb7FESU+G4Tf0FU8wW5C3XhIC2E0O2sjMFb1A1oELA2wboCb/O2DWVTL6 nnGZSPRrfMnYXTRsxu8yG2wq+t+uCtNNWftjBLzds+kOQzSXM/3mRbYa6ojIHdFtKj zUzAxm56GOtpe75YEy/XFVyLCRoI4nXyoB1MI9CNKMJjq+6M3Px+wqIOpBOlW4Rj+0 sriq7K/VPwgrQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0274A69487; Sun, 18 Jan 2026 13:38: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 10026) with ESMTP id 8cJnZchGVuq8; Sun, 18 Jan 2026 13:38:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768722; bh=pS9WtZLknrwx2JyGFldaGaeCp9o0pzH7k0o+F/2tlR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pL2byDa9yqVC8aVPIAEewJTSJUlJd17PJ84QacrnU8WyzzoNpDcu+cHAwiw+NgyQY VvyTeGBMW21S9fmxLu9IvfbWi5RvmgIQD5/WIYCn3WTsPO0egCP4TRbwN5vx02NUBg 83NUP5hDw0BC3fKHJsO1OQH0khgvTpr/lvTxE6OdpvFxNUFn3Ga/Y//EFaEmEaKeIb UdtZ9BZr/qTYLwPbr7WW0CtOOHzGK7F78QwGQxgxpgYv6ejdUTziaRYeN/CAK0YIgv qm+3LMG+ALchrJPe7UjiRYt8sko6AbLtuzj3P/GZ3r8H04V0RvQGwKfwlKouvOAdwx ZwhIOLEh1HpUQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 512C769382; Sun, 18 Jan 2026 13:38:42 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 13:37:24 -0700 Message-ID: <20260118133734.2.861096498c0facf7fca51f6e79e6cd37a9c5e73d@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: X3TCDSY4OILRKMVG3NWAHDBYZ4C7DVDY X-Message-ID-Hash: X3TCDSY4OILRKMVG3NWAHDBYZ4C7DVDY 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/12] linux: uio: Add kiocb struct and IOCB_* 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 Add the kernel I/O control block (kiocb) structure and associated flags to uio.h, and update ext4_uboot.h to use the header instead of duplicating these definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 19 ++----------------- include/linux/uio.h | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 80a1c5c6bc9..937c819a3f0 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -164,23 +164,8 @@ typedef struct { unsigned int val; } kprojid_t; /* 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 +/* kiocb, iov_iter - use linux/uio.h */ +#include /* __counted_by attribute - not available in U-Boot */ #define __counted_by(x) diff --git a/include/linux/uio.h b/include/linux/uio.h index cb050705597..e347d318c60 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -63,4 +63,23 @@ static inline size_t iov_iter_alignment(const struct iov_iter *i) return 0; /* Stub - assume aligned */ } +/** + * struct kiocb - kernel I/O control block + * @ki_flags: I/O flags + * @ki_filp: file pointer + * @ki_pos: file position + * + * U-Boot stub for asynchronous I/O control. + */ +struct kiocb { + int ki_flags; + struct file *ki_filp; + loff_t ki_pos; +}; + +/* kiocb flags */ +#define IOCB_DIRECT 0x0001 +#define IOCB_NOWAIT 0x0002 +#define IOCB_ATOMIC 0x0004 + #endif /* __LINUX_UIO_H */