From patchwork Tue Jan 20 23:43:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1717 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=1768952696; bh=DEwAl6koWB9AO5qQrdUFkbUnA5Rw75yVKgcyylL6XR4=; 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=ao6qUNQQE/+dtD6LF1O0XkmakeHzdqr2/PEzCWpomEd09Lqid8+bfqlpevmYHOLCs ESYwpNdZvTIVNqhp2ac3lU28Ur1U0b/J+9BhwIXICq1Ds68dayycxEB6d3gDBdAOiy vacysuD56CXkXil3dPmNqO6bFwUd3UbXkbz9MFjU8uSVhAWGmUiEpEIxALRTI4b133 ojV/etehdmQrMDi5pYSmg7q07hZyYdWqfMkjaJeUBkrEVnNlnPZY2KkL4fi7i7mFNf sIkibIsrd+fa7yr59jYEFl+tfQX3d5p9zwvHhiJ5pIBC/ys+6UUXv6yMQkAgLfDqzo sfP65FsWCH29g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A567A695AE for ; Tue, 20 Jan 2026 16:44:56 -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 bHBsvmk3i2ro for ; Tue, 20 Jan 2026 16:44:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952696; bh=DEwAl6koWB9AO5qQrdUFkbUnA5Rw75yVKgcyylL6XR4=; 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=ao6qUNQQE/+dtD6LF1O0XkmakeHzdqr2/PEzCWpomEd09Lqid8+bfqlpevmYHOLCs ESYwpNdZvTIVNqhp2ac3lU28Ur1U0b/J+9BhwIXICq1Ds68dayycxEB6d3gDBdAOiy vacysuD56CXkXil3dPmNqO6bFwUd3UbXkbz9MFjU8uSVhAWGmUiEpEIxALRTI4b133 ojV/etehdmQrMDi5pYSmg7q07hZyYdWqfMkjaJeUBkrEVnNlnPZY2KkL4fi7i7mFNf sIkibIsrd+fa7yr59jYEFl+tfQX3d5p9zwvHhiJ5pIBC/ys+6UUXv6yMQkAgLfDqzo sfP65FsWCH29g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 94C9A695A6 for ; Tue, 20 Jan 2026 16:44:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952694; bh=pYyFvRhz6bj6LXCU+Awg8Cge0OL+J9BUEEM9G07xB4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A3JIyTBxtv9AftmfAlLG0DXKPgCilXvCzUcy1irMsaR2oi/3AW3JOBbZIlXmk6sLZ hfJmdYjMVIRQJ9AfMrS3tFbswwkiLelZLLYBdoXkZ4OOM5bBiOn9ARysjvBaXd221D 3grnj7nkkV7dQqy10fJwbzbUtcDPBxLr8xAupW4v1xdsybm5OMmMv6o0ONX0xZ0F88 4u5+ezSXd75eLVqLgA2iiZbrcFflhpFIOybP2OAUviTj2KQ+umkcazwMOTJzR776DS AKIg8f6ASOKKxg9FyNmq9cLYJa+QPzavizIK2+Ki+ImKNUQwsCVKQYpGvB8QvkcoYn AadeIP4B+ZtoA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9538169597; Tue, 20 Jan 2026 16:44: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 qBNlng8e6hVz; Tue, 20 Jan 2026 16:44:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952690; bh=WoXXvTlXj05fOguo5y0j3xhFzv5K5Tag96UUpIE5IpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tqjf4795Uy7XmVzdXLdEFyXINCByh9LiUFsLY68h6SlfpD2V9+FTOJoXii0BaY0B8 8TodSa9Yco1xNYcutQfeu85HjQQRpDigz/Ffd46TQHp3xIJYb48lHOs8zxh4yIfshM nW6xihKHJWoQe5dVfF6zEmojGFbLl9f80L/QLGHJIqfne5AOwzbcVRt4BTJQlp2J+O K9wPLwUApDZneMFA4Ty9/36GBEMIBcvtDKwgRcSl4TbZ3dFLqB1YoChjcQQTJfIoZE NQ/8U538Vp00KkW1TQkgeAZJjRLqRmtiO9po2h+e1jZngs2HjA3tmEokY5soXfuLbb BAsIjw9qOsexg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 419FA69555; Tue, 20 Jan 2026 16:44:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 20 Jan 2026 16:43:28 -0700 Message-ID: <20260120234344.495605-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120234344.495605-1-sjg@u-boot.org> References: <20260120234344.495605-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3GSXMV6MQF2NNUH2EFQKJNN64XUXY4VH X-Message-ID-Hash: 3GSXMV6MQF2NNUH2EFQKJNN64XUXY4VH 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 08/17] ext4l: Move buffer and filesystem helpers to standard headers 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 several definitions to their canonical Linux header locations: - MAX_LFS_FILESIZE to linux/fs.h - end_buffer_read_sync() to linux/buffer_head.h This continues reducing ext4_uboot.h by placing these definitions in their proper locations in the Linux header hierarchy. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 13 ++----------- include/linux/buffer_head.h | 14 ++++++++++++++ include/linux/fs.h | 3 +++ 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index d1ec4a84b97..b44939bfe5a 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -979,15 +979,7 @@ static inline const char *simple_get_link(struct dentry *dentry, /* QFMT_VFS_* quota format constants are in linux/quotaops.h */ -/* Buffer read sync */ -static inline void end_buffer_read_sync(struct buffer_head *bh, int uptodate) -{ - if (uptodate) - set_buffer_uptodate(bh); - else - clear_buffer_uptodate(bh); - unlock_buffer(bh); -} +/* end_buffer_read_sync is in linux/buffer_head.h */ /* REQ_OP_READ is in linux/blk_types.h */ /* SB_ACTIVE is in linux/fs.h */ @@ -1103,8 +1095,7 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate); /* EXT4 magic number */ #define EXT4_SUPER_MAGIC 0xEF53 -/* Max file size for large files */ -#define MAX_LFS_FILESIZE ((loff_t)LLONG_MAX) +/* MAX_LFS_FILESIZE is in linux/fs.h */ /* blockgroup_lock - use linux/blockgroup_lock.h */ #include diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index a160b7d1a67..591f2ec1cbb 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -213,4 +213,18 @@ static inline bool noop_dirty_folio(struct address_space *mapping, return false; } +/* + * end_buffer_read_sync - completion handler for synchronous buffer reads + * @bh: buffer head that completed + * @uptodate: whether the read was successful + */ +static inline void end_buffer_read_sync(struct buffer_head *bh, int uptodate) +{ + if (uptodate) + set_buffer_uptodate(bh); + else + clear_buffer_uptodate(bh); + unlock_buffer(bh); +} + #endif /* _LINUX_BUFFER_HEAD_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 993985f88f3..5f1d702bab4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -318,6 +318,9 @@ enum { #define I_DIRTY_DATASYNC (1 << 2) #define I_DIRTY_TIME (1 << 3) +/* Maximum file size for large files */ +#define MAX_LFS_FILESIZE ((loff_t)LLONG_MAX) + /** * struct fstrim_range - fstrim ioctl argument * @start: first byte to trim