From patchwork Wed Jan 14 22:56:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1508 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=1768431477; bh=WG8WT3L1ThXyrebTbHSMhvsZCN9xksWrFyAedLFRnkA=; 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=fyDjoJUl9SqrFvAPylPuf/Cut6PyXOuFCnJb2TPvluQN2SedeUhN1+tcZcPMs38rz TuoYdUTegURqXPz3J4IJPe9B0YKuPeetGQ4v6D3FnlH75UmASZ7/PY6RimVUD+Fbsv lauGbk9EjX+wq9E9xDSbe3xa7/z9aiM94YrMWbs1e4F+iIffiiEn3BehV9eOTLMZRZ mKAW50rrEgQnpP5UtE1bLGNVJ/Apn93G8uevNo3F0zv52uVbiQrlTv7apRk2HOrNig d7n2tzLlsgIk/HDP2vpnGli9gnX63ERE2lV0oXEfmYgu+qCNc8DKWHsfZFSZLqoAQD Ppai7a/UwmZqg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2717F6935F for ; Wed, 14 Jan 2026 15:57: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 sl3iFZ-f6c1O for ; Wed, 14 Jan 2026 15:57:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431477; bh=WG8WT3L1ThXyrebTbHSMhvsZCN9xksWrFyAedLFRnkA=; 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=fyDjoJUl9SqrFvAPylPuf/Cut6PyXOuFCnJb2TPvluQN2SedeUhN1+tcZcPMs38rz TuoYdUTegURqXPz3J4IJPe9B0YKuPeetGQ4v6D3FnlH75UmASZ7/PY6RimVUD+Fbsv lauGbk9EjX+wq9E9xDSbe3xa7/z9aiM94YrMWbs1e4F+iIffiiEn3BehV9eOTLMZRZ mKAW50rrEgQnpP5UtE1bLGNVJ/Apn93G8uevNo3F0zv52uVbiQrlTv7apRk2HOrNig d7n2tzLlsgIk/HDP2vpnGli9gnX63ERE2lV0oXEfmYgu+qCNc8DKWHsfZFSZLqoAQD Ppai7a/UwmZqg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1309169345 for ; Wed, 14 Jan 2026 15:57:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431474; bh=50jS5eSxQKLMmVuTbC1kxnBD79GxWiG6v83YdPX1Kyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bJMDo7iQYxc/WaPP0aemB+98veVjxv1nbu+W8UTLcbWiMud2eu+Aya3UT7AG0H7v/ rddPJaO4BmFK8x0RGbgmsBSk9ve8sWGrtQ5tsg4gElADxW0sxsSpcRLGqNLXa2R13w BFhOaHoD/7cMGuZlBFCxAiKVZLMIiDq8fSxKnjWogQ1HkCtnACmK8N+g4SqYtLTaBq xDU/r3e/+/0Xy4xKqX8pnoXq/GCW59rpaZkRKrIOs0TKp5R+N8pi9xB6aYGFNUWvjM a3/ojKMC41e/noeCZxxp3dYTEVD9jgmU918CKRmq3gxeyaBT0FUT56U413cL9xVAN+ l899oiCOPRP3g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0F0F69342; Wed, 14 Jan 2026 15:57: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 o7ocqjwnfLFP; Wed, 14 Jan 2026 15:57:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431469; bh=2aoXk/tFTlN70PUSrmp/whOXSozm2TD5Z+uSAygtvRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UOGcLKP1N+eTpJqxJwNBQmPUuseNqf3e6aCU5fSGQRPrYbL7KVOVVI8X1koMcFhVi m4pdho/JP3S47Pt4HjSBhzssd5vCy/JqSVbJy9OGzKBESJyKuFvzN7OF9yXVpqvfrq P9M021Naoy3B5wEW8A3gsiCKXxLMQA6GuAZeuT3S6XpgKsJmgDnP2FpjVNdnXXE6eP t9M9xUWElxiS6pE2mLMXF5VOQewX8dWFW2e4dc+z2xlMf32RxJ1JsAR3BPJhPGBVOg hnhpgjkksprTA2RNiPYlCp8ci9oihvJCDu8OcWn/wVHlT3mNxI9AcYu5BaV7lExjHN ut+iQIHrDUjyg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B9A2569345; Wed, 14 Jan 2026 15:57:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:04 -0700 Message-ID: <20260114225635.3407989-15-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: YET3JGB6S7UQVYQKBEGBHQ4DHEH2KGX2 X-Message-ID-Hash: YET3JGB6S7UQVYQKBEGBHQ4DHEH2KGX2 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 14/34] ext4l: Move buffer operation stubs to linux/buffer_head.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 simple buffer operation stubs to include/linux/buffer_head.h where they belong. These operations are no-ops in single-threaded U-Boot: - wait_on_buffer: no waiting needed - __bforget: no buffer cache to forget from - lock_buffer: uses set_buffer_locked (already in header) - unlock_buffer: uses clear_buffer_locked (already in header) - test_clear_buffer_dirty: always returns 0 The mark_buffer_dirty macros remain in ext4_uboot.h as they depend on sync_dirty_buffer which is defined later in ext4l. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 +------ include/linux/buffer_head.h | 9 +++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index e09f5c31ebe..9329d854bd3 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -260,15 +260,10 @@ extern struct user_namespace init_user_ns; /* Trace stubs are now in ext4_trace.h */ -/* Buffer operations - stubs */ -#define wait_on_buffer(bh) do { } while (0) -#define __bforget(bh) do { } while (0) +/* Buffer operations - wait_on_buffer, lock_buffer, unlock_buffer etc are in linux/buffer_head.h */ #define mark_buffer_dirty_inode(bh, i) sync_dirty_buffer(bh) #define mark_buffer_dirty(bh) sync_dirty_buffer(bh) -#define lock_buffer(bh) set_buffer_locked(bh) -#define unlock_buffer(bh) clear_buffer_locked(bh) struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); -#define test_clear_buffer_dirty(bh) ({ (void)(bh); 0; }) #define wait_on_bit_io(addr, bit, mode) do { (void)(addr); (void)(bit); (void)(mode); } while (0) /* inode_needs_sync - stub */ diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index b22df564119..94bd2bab96a 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -177,4 +177,13 @@ static inline void put_bh(struct buffer_head *bh) void brelse(struct buffer_head *bh); void __brelse(struct buffer_head *bh); +/* + * Buffer operation stubs - U-Boot is single-threaded + */ +#define wait_on_buffer(bh) do { } while (0) +#define __bforget(bh) do { } while (0) +#define lock_buffer(bh) set_buffer_locked(bh) +#define unlock_buffer(bh) clear_buffer_locked(bh) +#define test_clear_buffer_dirty(bh) ({ (void)(bh); 0; }) + #endif /* _LINUX_BUFFER_HEAD_H */