From patchwork Wed Jan 14 22:56: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: 1528 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=1768431560; bh=QmykCc/o1m1N5c3AuP5BT0PsvNr/xM2HIRiG4i7BWA4=; 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=TrGSZF9mOUSOeWAs+OOQlnebJL2BKZ25C9BrOAip4HjxafOWPYqQZScpUA6sMEvAB Fdg4BfLtCJ4L3CbEbefmiIs4gcBasfemj3KC4VCwEX7Q+q6tycQ2HPeReGhAfbapJP af3g+/OI6SGFNDh/yiLHEotdXMSw7I7a1hW/AIsQuwuvviuv/TKrofOaF7Wvn4LV6Q x9xcp3WBGOJoLYvKhIl2PSgfNuHy1IBsrhW1IEC1183+nfjmNwThzgzIxKPkUAgtRE RwKxc1LKmm0wYy7OLjF9FC0l9HhLxCs9DvQsETzBos/7/qD27k/FgkAq4hJWicnr8/ iN/OssZuwvvZQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AF50869361 for ; Wed, 14 Jan 2026 15:59:20 -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 aJWNw3qgzChF for ; Wed, 14 Jan 2026 15:59:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431560; bh=QmykCc/o1m1N5c3AuP5BT0PsvNr/xM2HIRiG4i7BWA4=; 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=TrGSZF9mOUSOeWAs+OOQlnebJL2BKZ25C9BrOAip4HjxafOWPYqQZScpUA6sMEvAB Fdg4BfLtCJ4L3CbEbefmiIs4gcBasfemj3KC4VCwEX7Q+q6tycQ2HPeReGhAfbapJP af3g+/OI6SGFNDh/yiLHEotdXMSw7I7a1hW/AIsQuwuvviuv/TKrofOaF7Wvn4LV6Q x9xcp3WBGOJoLYvKhIl2PSgfNuHy1IBsrhW1IEC1183+nfjmNwThzgzIxKPkUAgtRE RwKxc1LKmm0wYy7OLjF9FC0l9HhLxCs9DvQsETzBos/7/qD27k/FgkAq4hJWicnr8/ iN/OssZuwvvZQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9D4C86935F for ; Wed, 14 Jan 2026 15:59:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431558; bh=wHgKvFoUlfloFwEsQKh7Rv07Lwhw+3JIFyR4MnRa07s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jzr/UbeztlvFF9M8jTJEMfu9lYQclzukWvayraJK6NNYN9TBYZCzttPDuNN7OKf4K HF5qPo5iz690jsVGWllqrjpTb53DJwaGNrfNnlNT4yjXt5Q+NS1/v6dNwjuajw8x6v twBViCHWHpPPN5vR/DofedzZdgJqDACTb5TWkLs5uRX3za51whRNs2hSrYNCnE8lMf HTt6NRqYBJFwR3U4X4w2KsNRoCgIdFIZzbCn6hJlz1/TpTDCk6MgQvKVZyKFclYo02 yMS1jY2AnATqBmdLVGuzOpZajtYDwXObFxIPtM/pg7c6y55XoGnaytItbnBTbDczws kUPdewttBOv0g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8A8DE6913F; Wed, 14 Jan 2026 15:59:18 -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 r7_egZjZR0YV; Wed, 14 Jan 2026 15:59:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431553; bh=XQyxRQV0j6e7KrCgJRjnPkRVbrAQMlXAb2ljZnRj1YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CK0OzAFexLwZvxieY/zmhe7AMOsJyYD56M5ZCu0yJ/e+leRKCLTEGxughz3WcCHjQ NE+Jp+X+19ZFZMS6mABcZpqskBvR9mmM+T5xap65/8q2djVcBNZooJVe3HinzNkqNk i2Em/KHv3MdVJOIW751qosU9hxUt3Ww9j52XGMeZZ0v4nMIbxuAFiZZL/AkboxVD+6 /7T39/ysR2UKOpoLj8tFkZtNUq+U+nDIlSHBBln67ICnJIRmX9x07YORdD84T203x+ tUMOk/t7fmmi/+AlrwM+ncqDDRtAGVikpl+1jbpPhf2gWSgNsd0yhero0BdbgY0Xdh JLHQWpJrAHtAg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4D2E36935F; Wed, 14 Jan 2026 15:59:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:24 -0700 Message-ID: <20260114225635.3407989-35-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: DH5OWFQNW3Z32DSKXAZWWLDHK5QUFWRL X-Message-ID-Hash: DH5OWFQNW3Z32DSKXAZWWLDHK5QUFWRL 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 34/34] ext4l: Move buffer migration 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 buffer and folio migration stubs from ext4_uboot.h to linux/buffer_head.h where they belong: - buffer_migrate_folio(): folio migration stub (returns -EOPNOTSUPP) - buffer_migrate_folio_norefs(): no-refs folio migration stub - noop_dirty_folio(): no-op dirty folio handler U-Boot doesn't support memory migration, so these remain as stubs. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 22 +--------------------- include/linux/buffer_head.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 87cc561538e..91e0ce95467 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1142,27 +1142,7 @@ struct readahead_control { #define readahead_length(rac) ({ (void)(rac); 0UL; }) /* address_space_operations is in linux/fs.h */ - -/* Stub for buffer_migrate_folio */ -static inline int buffer_migrate_folio(struct address_space *mapping, - struct folio *dst, struct folio *src, int mode) -{ - return -EOPNOTSUPP; -} - -/* Stub for buffer_migrate_folio_norefs */ -static inline int buffer_migrate_folio_norefs(struct address_space *mapping, - struct folio *dst, struct folio *src, int mode) -{ - return -EOPNOTSUPP; -} - -/* Stub for noop_dirty_folio */ -static inline bool noop_dirty_folio(struct address_space *mapping, - struct folio *folio) -{ - return false; -} +/* buffer_migrate_folio, buffer_migrate_folio_norefs, noop_dirty_folio are in linux/buffer_head.h */ /* Stub implementations for address_space_operations callbacks */ static inline bool block_is_partially_uptodate(struct folio *folio, diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 94bd2bab96a..a160b7d1a67 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -12,6 +12,7 @@ #include #include #include +#include #include enum bh_state_bits { @@ -186,4 +187,30 @@ void __brelse(struct buffer_head *bh); #define unlock_buffer(bh) clear_buffer_locked(bh) #define test_clear_buffer_dirty(bh) ({ (void)(bh); 0; }) +/* + * Folio migration stubs - U-Boot doesn't support memory migration + */ +static inline int buffer_migrate_folio(struct address_space *mapping, + struct folio *dst, struct folio *src, + int mode) +{ + return -EOPNOTSUPP; +} + +static inline int buffer_migrate_folio_norefs(struct address_space *mapping, + struct folio *dst, + struct folio *src, int mode) +{ + return -EOPNOTSUPP; +} + +/* + * noop_dirty_folio - no-op dirty folio handler + */ +static inline bool noop_dirty_folio(struct address_space *mapping, + struct folio *folio) +{ + return false; +} + #endif /* _LINUX_BUFFER_HEAD_H */