From patchwork Sun Dec 21 11:38:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1006 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=1766317126; bh=bWqlTzVuwMJUDV3RgtfRa3riEbRWkjgmee0dlL1RhTo=; 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=gq2+8uWfmuaOSlyBNWl/otsUV5IX5JUBDrku1+qWLbU+aCKtv1PrGNNfi27O5F3oH VZn2GsOjBYf4cNSFKPJpIzC2uJ96tK8CGGFMiAWy+ukiJ/DMVshSt47km7Ci5vX3Ij rlphVNn+JTr0OhenUqyZOj5DLiBtqLbqhVhh3obsDvZKsZdvox0WmMBDDMatROBU/t jULUi2K3rE1NnlPWAiltZuc2aiL9YfiS9gA9idsjyCqMiVqAaXQ/c3pt9soKGyqVS0 X72O5IGnLm5b3yMV8x6GLYml6/peEEUnDz/n/zrc/6dLhQ2unqxt+3AGhLYOAlnGD4 qEz384hTcj2qg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D47D864CF3 for ; Sun, 21 Dec 2025 04: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 lcVddA4-2w_k for ; Sun, 21 Dec 2025 04:38:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766317126; bh=bWqlTzVuwMJUDV3RgtfRa3riEbRWkjgmee0dlL1RhTo=; 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=gq2+8uWfmuaOSlyBNWl/otsUV5IX5JUBDrku1+qWLbU+aCKtv1PrGNNfi27O5F3oH VZn2GsOjBYf4cNSFKPJpIzC2uJ96tK8CGGFMiAWy+ukiJ/DMVshSt47km7Ci5vX3Ij rlphVNn+JTr0OhenUqyZOj5DLiBtqLbqhVhh3obsDvZKsZdvox0WmMBDDMatROBU/t jULUi2K3rE1NnlPWAiltZuc2aiL9YfiS9gA9idsjyCqMiVqAaXQ/c3pt9soKGyqVS0 X72O5IGnLm5b3yMV8x6GLYml6/peEEUnDz/n/zrc/6dLhQ2unqxt+3AGhLYOAlnGD4 qEz384hTcj2qg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C2CF964CEC for ; Sun, 21 Dec 2025 04:38:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766317124; bh=gxOkmTg0w05COTY2SV4/tMtgAjJO7cKmy0ELek0JV9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r1IErQzo6U2gfGvHpj6Puwu3ov7m+ZfzdUskNXHDEKuGBOia3HUM3wQX8KFoXTc+e 1n1soO3p2+uO1Oxisbyfxfh4efe+fZNhd/mLol4VRGjyHP1xe50o8J1j69B/MfxvzJ i0CB/OxjcmH0W2q2ETSF4UzZBT0FW+umFckThIb/hlpYhSLD9SSoQ+JXRL3cLUFK9b 5R2BC2YRIwclauQZiKfN54v93U1YLBvdD70WLteeY7oXVcTzXQj9lPSz3o2aWWBrpm US73B3a77jbqJvfmVj6Vgtri7k10IOAMs/i0amF67JD2edj8nF07toj3gvKYyvptPL OX3r/CtRb7Wrg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5F90864CC8; Sun, 21 Dec 2025 04:38:44 -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 Om3iazk7QuNr; Sun, 21 Dec 2025 04:38:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766317120; bh=0LoAS8iI/kGRTRlD2FKhRu1pGtNJ0Z3trICWpkR7Jeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DkSqWayH6aQv/4Up2J//remeeRLY+VbOnqaXhmUnn4XuIjrwn+wjtvFHUooxTyAU2 nLCnvjgcU1CZCWL4lVbRHWCSr/soWtQeyrma7OB4nADTufyekwLifyoOmdUjv4BAi1 YMTxWhv4NFbp/Tr+pH25Qvq1Vddm7QvJ+bhyoFemzcUqoYL12o7ONs5UwRUka42DdO wbv5WP6naQkVOKB2cKmAq1dMy8R5lbljxgz5LuLoWsbrvJHjItQAHaZIqlJFGq2Rw5 TyQX1GspI4AsSm9BlL2XSyf7qZ3IJn3WbMkVQqSAO6FxUhENKujmmCDACs3RLn2zi9 dyr2Vw+qiROxw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0724664CEC; Sun, 21 Dec 2025 04:38:39 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 21 Dec 2025 04:38:08 -0700 Message-ID: <20251221113820.812060-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251221113820.812060-1-sjg@u-boot.org> References: <20251221113820.812060-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZS7PLVT2JBGCC2VI3RBZ5FV6GGBNR3TQ X-Message-ID-Hash: ZS7PLVT2JBGCC2VI3RBZ5FV6GGBNR3TQ 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/10] ext4l: Add fsync.c to build 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 fsync.c which provides filesystem sync operations. Changes needed: - Add ext4_uboot.h include to fsync.c - Remove redundant Linux header includes - Add trace_ext4_sync_file_enter/exit stubs - Add dentry operation stubs (d_find_any_alias, dget_parent) - Add sync operation stubs (sync_mapping_buffers, sync_inode_metadata, generic_buffers_fsync_noflush, file_write_and_wait_range, file_check_and_advance_wb_err) - Add jbd2_trans_will_send_data_barrier stub - Remove ext4_sync_file stub from stub.c (now in fsync.c) Co-developed-by: Claude Signed-off-by: Simon Glass --- fs/ext4l/Makefile | 2 +- fs/ext4l/ext4_uboot.h | 13 +++++++++++++ fs/ext4l/fsync.c | 9 +-------- fs/ext4l/stub.c | 10 ++++++---- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index 73083e82cd8..96caa289be0 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -6,7 +6,7 @@ obj-y := interface.o stub.o obj-y += balloc.o bitmap.o block_validity.o dir.o ext4_jbd2.o extents.o \ - extents_status.o file.o hash.o ialloc.o \ + extents_status.o file.o fsync.o hash.o ialloc.o \ indirect.o inode.o \ super.o xattr_hurd.o xattr_trusted.o \ xattr_user.o orphan.o diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 5f466dbf005..0f0e9c91a12 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1289,6 +1289,19 @@ typedef unsigned int projid_t; #define trace_ext4_write_begin(...) do { } while (0) #define trace_ext4_write_end(...) do { } while (0) #define trace_ext4_journalled_write_end(...) do { } while (0) +#define trace_ext4_sync_file_enter(...) do { } while (0) +#define trace_ext4_sync_file_exit(...) do { } while (0) + +/* Dentry operations - stubs */ +#define d_find_any_alias(i) ({ (void)(i); (struct dentry *)NULL; }) +#define dget_parent(d) ({ (void)(d); (struct dentry *)NULL; }) + +/* Sync operations - stubs */ +#define sync_mapping_buffers(m) ({ (void)(m); 0; }) +#define sync_inode_metadata(i, w) ({ (void)(i); (void)(w); 0; }) +#define generic_buffers_fsync_noflush(f, s, e, d) ({ (void)(f); (void)(s); (void)(e); (void)(d); 0; }) +#define file_write_and_wait_range(f, s, e) ({ (void)(f); (void)(s); (void)(e); 0; }) +#define file_check_and_advance_wb_err(f) ({ (void)(f); 0; }) /* DAX stubs - DAX not supported in U-Boot */ #define IS_DAX(inode) (0) diff --git a/fs/ext4l/fsync.c b/fs/ext4l/fsync.c index e476c6de307..42a9e2bdbff 100644 --- a/fs/ext4l/fsync.c +++ b/fs/ext4l/fsync.c @@ -23,18 +23,11 @@ * we can depend on generic_block_fdatasync() to sync the data blocks. */ -#include -#include -#include -#include -#include -#include +#include "ext4_uboot.h" #include "ext4.h" #include "ext4_jbd2.h" -#include - /* * If we're not journaling and this is a just-created file, we have to * sync our parent directory (if it was freshly created) since diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index b378eab97a3..4dac514340c 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -107,6 +107,11 @@ int jbd2__journal_restart(void *handle, int nblocks, int revoke_records, return 0; } +int jbd2_trans_will_send_data_barrier(journal_t *journal, unsigned long tid) +{ + return 0; +} + /* * Stubs for balloc.c */ @@ -512,10 +517,7 @@ int ext4_dirblock_csum_verify(struct inode *inode, struct buffer_head *bh) /* ext4_ioctl is now in super.c */ -int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) -{ - return 0; -} +/* ext4_sync_file is now in fsync.c */ /* * Stubs for super.c