From patchwork Wed Jan 14 22:56:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1509 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=1768431481; bh=jcMgIMTEZpjp9IJlY+gmvUJxqOAMFLOXJ9UfNSyWCKk=; 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=pBAW72op+gAVb7BaG0sQ3cYXxhYvh/hsJY2+D/AqQv1nxpLHltL3A0jS78S4EQqZq uJLhWfapon1pouk2qxhnNuRU9E633q0WY42XovI2WC6u6rkWj3GDiiDe6+r/lMpxPR KEk4bEYbeRiHdpVQcXToAwD7BoWtZ7oVppcCJh7UYNWwKIVhyBOe856Ktcmq57jK0u sotf9/BMa5slqtTdfgb1r64/UehhRtAe++1QUkhfiItys/gGMLUGtkMjftvAVFROHx ZUc/O4GtE2ZqpSYZMiKGXKKu0x1aYgfEkMH19Kld6M6pWJUsqV9pZWXa/9iFs3vOX/ 0c7M6q4V6jqGg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1DC3692EF for ; Wed, 14 Jan 2026 15:58:01 -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 1WN7MHo-vg7q for ; Wed, 14 Jan 2026 15:58:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431481; bh=jcMgIMTEZpjp9IJlY+gmvUJxqOAMFLOXJ9UfNSyWCKk=; 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=pBAW72op+gAVb7BaG0sQ3cYXxhYvh/hsJY2+D/AqQv1nxpLHltL3A0jS78S4EQqZq uJLhWfapon1pouk2qxhnNuRU9E633q0WY42XovI2WC6u6rkWj3GDiiDe6+r/lMpxPR KEk4bEYbeRiHdpVQcXToAwD7BoWtZ7oVppcCJh7UYNWwKIVhyBOe856Ktcmq57jK0u sotf9/BMa5slqtTdfgb1r64/UehhRtAe++1QUkhfiItys/gGMLUGtkMjftvAVFROHx ZUc/O4GtE2ZqpSYZMiKGXKKu0x1aYgfEkMH19Kld6M6pWJUsqV9pZWXa/9iFs3vOX/ 0c7M6q4V6jqGg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 906D269345 for ; Wed, 14 Jan 2026 15:58:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431479; bh=ieOdLOk5Mg6onND50e5mpFVDGtv6gtmxjDwUzBpkQkc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P9d3op5KDKn8F9YtBz1zMK7u0mV36HEF7uapd7ZPX6HRtrJWxzjHb1LHf+qiSEGLI xhzhgc95ok/ad6hLrSoqFxcWruRcnv6KX36kH6ZYB5i8FBHd6+o+pihns7PNzeI/S/ QGRUJSfcLb9gUHfJaLxWFUI52qk6pFIyaAbZwQSV5T0YrOwoqljg3DQ39x8wJ0RpsX nAbvwSzpJdLgY0Lyh+3eangp6G3BaG0OlpZnS749UJi0vUJSnUBGFR0M7z1iRz8pku pfjGxCuFhll/xWvYjjQAfbYt9U0Z3MYFfeV2AykWkeCw6ZsyaQBurYe/MoRCXU6bjd VLTdyC/AFf8zQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9009D69345; Wed, 14 Jan 2026 15:57:59 -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 QMm2ZREy5Md8; Wed, 14 Jan 2026 15:57:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431473; bh=DhYO0N5saOoJ2AH+6QOi9nBekgZHolrWDatqEXMDh9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDIfhrjuAYwXb1Fp2tasjXZ2y4wm/4tvAvUtsPiUa6rlgGeWhhVeMA91jmG3jqscX +rjG6IgwQQkWUZq1RgO+9hDPMMpqKFG+vyjuFoowWDMjkwD6iv9LQR8p993MtokdIO VQ9HEpdZNQlgf7tyRjsObXWdekeEXtH8ug7/XjnOFtdpW1l1Ok18apes9sugBFFGtd P+nUmgup9WKKMd79IST/4Tyc/NJzUILyOTB+p0QlTi8DJrjBW5xzeUhXpYprOuXzyP QZGL7UkW3mE8XwGHlDHQbEVb/fDbbx8jcYNbVKReyuKgUm8+nZimGfmWaVhP5CuZeW YAJNRKaZmQrWQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 55657692EF; Wed, 14 Jan 2026 15:57:53 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:05 -0700 Message-ID: <20260114225635.3407989-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6ZF5FPPDZAU57DOJR77SP6HMJWLXN34B X-Message-ID-Hash: 6ZF5FPPDZAU57DOJR77SP6HMJWLXN34B 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 15/34] ext4l: Move address_space_operations 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 struct address_space_operations from ext4_uboot.h to linux/fs.h where it belongs alongside struct address_space. This matches the Linux kernel structure where both are defined in include/linux/fs.h. Add necessary forward declarations for types used in the function pointers (struct file, struct folio, struct readahead_control, etc.). Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 21 +-------------------- include/linux/fs.h | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 9329d854bd3..715407b83d8 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1224,26 +1224,7 @@ struct readahead_control { #define readahead_pos(rac) ({ (void)(rac); 0LL; }) #define readahead_length(rac) ({ (void)(rac); 0UL; }) -/* Forward declarations for address_space_operations */ -struct writeback_control; -struct swap_info_struct; - -/* address_space_operations stub */ -struct address_space_operations { - int (*read_folio)(struct file *, struct folio *); - void (*readahead)(struct readahead_control *); - sector_t (*bmap)(struct address_space *, sector_t); - void (*invalidate_folio)(struct folio *, size_t, size_t); - bool (*release_folio)(struct folio *, gfp_t); - int (*write_begin)(const struct kiocb *, struct address_space *, loff_t, unsigned, struct folio **, void **); - int (*write_end)(const struct kiocb *, struct address_space *, loff_t, unsigned, unsigned, struct folio *, void *); - int (*writepages)(struct address_space *, struct writeback_control *); - bool (*dirty_folio)(struct address_space *, struct folio *); - bool (*is_partially_uptodate)(struct folio *, size_t, size_t); - int (*error_remove_folio)(struct address_space *, struct folio *); - int (*migrate_folio)(struct address_space *, struct folio *, struct folio *, int); - int (*swap_activate)(struct swap_info_struct *, struct file *, sector_t *); -}; +/* address_space_operations is in linux/fs.h */ /* Stub for buffer_migrate_folio */ static inline int buffer_migrate_folio(struct address_space *mapping, diff --git a/include/linux/fs.h b/include/linux/fs.h index 54c0148ee72..241711eded1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -15,7 +15,12 @@ struct inode; struct super_block; struct buffer_head; -struct address_space_operations; +struct file; +struct folio; +struct readahead_control; +struct kiocb; +struct writeback_control; +struct swap_info_struct; /* errseq_t - error sequence type */ typedef u32 errseq_t; @@ -55,6 +60,9 @@ struct path { #define FOLIO_CACHE_MAX 64 #endif +/* address_space_operations - forward declare for address_space */ +struct address_space_operations; + /* address_space - extended for inode.c */ struct address_space { struct inode *host; @@ -70,6 +78,27 @@ struct address_space { #endif }; +/* address_space_operations - filesystem address space methods */ +struct address_space_operations { + int (*read_folio)(struct file *, struct folio *); + void (*readahead)(struct readahead_control *); + sector_t (*bmap)(struct address_space *, sector_t); + void (*invalidate_folio)(struct folio *, size_t, size_t); + bool (*release_folio)(struct folio *, gfp_t); + int (*write_begin)(const struct kiocb *, struct address_space *, + loff_t, unsigned, struct folio **, void **); + int (*write_end)(const struct kiocb *, struct address_space *, + loff_t, unsigned, unsigned, struct folio *, void *); + int (*writepages)(struct address_space *, struct writeback_control *); + bool (*dirty_folio)(struct address_space *, struct folio *); + bool (*is_partially_uptodate)(struct folio *, size_t, size_t); + int (*error_remove_folio)(struct address_space *, struct folio *); + int (*migrate_folio)(struct address_space *, struct folio *, + struct folio *, int); + int (*swap_activate)(struct swap_info_struct *, struct file *, + sector_t *); +}; + /* block_device - minimal stub */ struct block_device { struct address_space *bd_mapping;