From patchwork Wed Jan 21 22:08:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1732 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=1769033376; bh=iO99h1Rpb+vax7XwgGHHVZXOc2T4P4ghi9iibbk+uns=; 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=guaJzuXJgrsTxMvrNH08mQ9rD/lXEimHWhiFpFoFCRar6h23t35aBS/zdRyhLLLmL hRxjuoiVLCZ/YL5TaXPjiTXQ35yKZzwILqdl7K59px7gMydECYbRolYw/cjP9dHtDd orYfXlQACeWC/xsS36MbkpDpT0oBEZCtEw/0FuGe6WYDR9tbZuPJiN1hViX5soqX4M bqnec096ot81fThU9yM+CAFybTH59ECVEtkbbosFgff31mC+yt5iAVmqE5kixoTbMK WPo05EsUawxEQL4nz7xsLQwtvBs4CV6M4ss1T0OjhVfKh4k/TViJORx3FmSovqUPut VfsK1Xw72ZppA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 50D62695FF for ; Wed, 21 Jan 2026 15:09:36 -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 W9h5So6bCP8r for ; Wed, 21 Jan 2026 15:09:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033376; bh=iO99h1Rpb+vax7XwgGHHVZXOc2T4P4ghi9iibbk+uns=; 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=guaJzuXJgrsTxMvrNH08mQ9rD/lXEimHWhiFpFoFCRar6h23t35aBS/zdRyhLLLmL hRxjuoiVLCZ/YL5TaXPjiTXQ35yKZzwILqdl7K59px7gMydECYbRolYw/cjP9dHtDd orYfXlQACeWC/xsS36MbkpDpT0oBEZCtEw/0FuGe6WYDR9tbZuPJiN1hViX5soqX4M bqnec096ot81fThU9yM+CAFybTH59ECVEtkbbosFgff31mC+yt5iAVmqE5kixoTbMK WPo05EsUawxEQL4nz7xsLQwtvBs4CV6M4ss1T0OjhVfKh4k/TViJORx3FmSovqUPut VfsK1Xw72ZppA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3ED28695F7 for ; Wed, 21 Jan 2026 15:09:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033373; bh=qlMiv1Et73b5KLFTiCpOlShrN0mXKac0oe2/66f/9VY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qjwrPXBEt0rILfYlsG1QlPupMpAR4S1alL4Q37JL1mY57dTc+VHafBSK3PZXfV5G0 JyJ9wlMP3nroHIuXN0ZUjFqJ6QKzGt0CfPH56Ycx0E+8NI6pEGirHAcHW69JdH8HAn jjepL5UGzYm784sLNvtzgLC3DE9jQVyHbWrXEZNt7lOlVPzv7/Qn0T7MkP0Xr48RIg ZsAo0YOR5UjC//UUi/7N7OAQwzXMw7/MpqjP/XoRbKWsp4K+JJ5EL6BLe3ml1YTZGj L5Sk0nrPuZDvhgkgWAcYaxIAvM/f7rUpgPG+vXyFKRGrRZsrO+sU5Y7BbEDRb9DPcW 4nBEw5aDFtEbA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C03BC695F2; Wed, 21 Jan 2026 15:09:33 -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 G2ftYYGKKT9I; Wed, 21 Jan 2026 15:09:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033368; bh=JyDic1YiImbB+Dq6tcD40YPchTHnekirymnNQ7Y9dQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I83FTsWCu5fXIp5AGT0F7x6A1YpCZQK1H/kvNq1NxcOJnF/JiRCrZG1OI2Z57/izz NMg9EKLZTCF522IJ4CWkrAH/YUYs4KkWSbWAunUBRreQlmcQ1R/5tepzN3EOihoFfk 3rhZD0wONSgG+GAjc3ZSs7nHtIn/+8CYSsYjL8zOpe1afXwxcCbsHjS2U5GM65PXXR x4DtEYLX8ZbOKUtvcsg/psqOgPZn9XQE53tdYAv1qBp0tnl/K1l3Wmwi/FJTb4fzVU HMzhffVenc8iNHpU0+Mb62dM8agQTnNXFEcUrIqg132Nx+sSvHd0cuEzzaOtl4zyPo c9y+4kBjQOuSw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1AF77695F7; Wed, 21 Jan 2026 15:09:28 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:19 -0700 Message-ID: <20260121220857.2137568-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WUP4A7E3GFOJ44ASMDSBXLW2HP3HI475 X-Message-ID-Hash: WUP4A7E3GFOJ44ASMDSBXLW2HP3HI475 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/33] ext4l: Move sb_ functions and SB_ macros to super_types.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 superblock-related functions and macros from ext4_uboot.h to include/linux/fs/super_types.h where struct super_block is defined. This includes: - sb_start_intwrite(), sb_end_intwrite(), sb_start_intwrite_trylock() - sb_start_pagefault(), sb_end_pagefault() - sb_set_blocksize(), sb_min_blocksize(), sb_bdev_nr_blocks() - sb_issue_zeroout(), sb_issue_discard() - sb_is_blkdev_sb(), sb_no_casefold_compat_fallback() - super_set_uuid() - SB_I_CGROUPWB, SB_I_ALLOW_HSM Co-developed-by: Claude (Anthropic) Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 42 -------------------------------- include/linux/fs/super_types.h | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 6f4ebd7e68b..0cddc46cf98 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -132,7 +132,6 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, #endif /* Block device operations - stubs */ -#define sb_issue_zeroout(sb, blk, num, gfp) ({ (void)(sb); (void)(blk); (void)(num); (void)(gfp); 0; }) #define blkdev_issue_flush(bdev) ({ (void)(bdev); 0; }) #include @@ -281,7 +280,6 @@ struct dx_hash_info { #define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) -#define sb_no_casefold_compat_fallback(sb) ({ (void)(sb); 1; }) #define generic_ci_validate_strict_name(d, n) ({ (void)(d); (void)(n); 1; }) #include @@ -343,14 +341,6 @@ struct dx_hash_info { #define dax_zero_range(i, p, l, d, op) ({ (void)(i); (void)(p); (void)(l); (void)(d); (void)(op); -EOPNOTSUPP; }) #define dax_break_layout_inode(i, m) ({ (void)(i); (void)(m); 0; }) -/* Superblock freezing stubs */ -#define sb_start_intwrite(sb) do { (void)(sb); } while (0) -#define sb_end_intwrite(sb) do { (void)(sb); } while (0) -#define sb_start_intwrite_trylock(sb) ({ (void)(sb); 1; }) -#define sb_start_pagefault(sb) do { (void)(sb); } while (0) -#define sb_end_pagefault(sb) do { (void)(sb); } while (0) - -/* d_path, path_put - use linux/path.h */ #include #include @@ -465,9 +455,6 @@ void ext4_unregister_li_request(struct super_block *sb); /* I/O priority classes - use linux/ioprio.h */ #include -#define SB_I_CGROUPWB 0 /* Not supported in U-Boot */ -#define SB_I_ALLOW_HSM 0 /* Not supported in U-Boot */ - /* blk_holder_ops for block device */ struct blk_holder_ops { void (*mark_dead)(struct block_device *, bool); @@ -531,32 +518,9 @@ void free_page(unsigned long addr); void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, void *holder); -/* Superblock blocksize - declaration for stub.c */ -int sb_set_blocksize(struct super_block *sb, int size); - -/* Superblock min blocksize - stub */ -static inline int sb_min_blocksize(struct super_block *sb, int size) -{ - return sb_set_blocksize(sb, size); -} - /* Block device size - declarations for stub.c */ int generic_check_addressable(unsigned int blocksize_bits, u64 num_blocks); -u64 sb_bdev_nr_blocks(struct super_block *sb); unsigned int bdev_max_discard_sectors(struct block_device *bdev); - -/* Superblock identity functions */ -static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, - unsigned len) -{ - if (len > sizeof(sb->s_uuid.b)) - len = sizeof(sb->s_uuid.b); - memcpy(sb->s_uuid.b, uuid, len); -} - -/* super_set_sysfs_name_bdev is now in linux/kobject.h */ - -/* mb_cache - use linux/mbcache.h */ #include /* xattr helper stubs for xattr.c */ @@ -595,10 +559,6 @@ struct buffer_head *__bread(struct block_device *bdev, sector_t block, unsigned /* Block device properties */ #define bdev_nonrot(bdev) ({ (void)(bdev); 0; }) -/* sb_issue_discard - issue discard request (no-op in U-Boot) */ -#define sb_issue_discard(sb, sector, nr_sects, gfp, flags) \ - ({ (void)(sb); (void)(sector); (void)(nr_sects); (void)(gfp); (void)(flags); 0; }) - /* raw_cpu_ptr - get pointer to per-CPU data for current CPU */ #define raw_cpu_ptr(ptr) (ptr) @@ -650,8 +610,6 @@ void ext4l_print_msgs(void); struct blk_desc *ext4l_get_blk_dev(void); struct disk_partition *ext4l_get_partition(void); -#define sb_is_blkdev_sb(sb) ({ (void)(sb); 0; }) - /* DEFINE_WAIT stub - creates a wait queue entry */ #define DEFINE_WAIT(name) int name = 0 diff --git a/include/linux/fs/super_types.h b/include/linux/fs/super_types.h index c575d268c43..189a40dd123 100644 --- a/include/linux/fs/super_types.h +++ b/include/linux/fs/super_types.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -98,4 +99,47 @@ static inline bool sb_rdonly(const struct super_block *sb) #define sb_end_write(sb) do { (void)(sb); } while (0) #define sb_start_write_trylock(sb) ({ (void)(sb); 1; }) +/* Superblock internal write operations */ +#define sb_start_intwrite(sb) do { (void)(sb); } while (0) +#define sb_end_intwrite(sb) do { (void)(sb); } while (0) +#define sb_start_intwrite_trylock(sb) ({ (void)(sb); 1; }) + +/* Superblock pagefault operations */ +#define sb_start_pagefault(sb) do { (void)(sb); } while (0) +#define sb_end_pagefault(sb) do { (void)(sb); } while (0) + +/* Superblock internal flags */ +#define SB_I_CGROUPWB 0 /* Not supported in U-Boot */ +#define SB_I_ALLOW_HSM 0 /* Not supported in U-Boot */ + +/* Superblock block size operations - sb_set_blocksize in stub.c */ +int sb_set_blocksize(struct super_block *sb, int size); + +static inline int sb_min_blocksize(struct super_block *sb, int size) +{ + return sb_set_blocksize(sb, size); +} + +/* Superblock block device operations */ +u64 sb_bdev_nr_blocks(struct super_block *sb); +#define sb_is_blkdev_sb(sb) ({ (void)(sb); 0; }) + +/* Superblock discard/zeroout operations - no-op in U-Boot */ +#define sb_issue_zeroout(sb, blk, num, gfp) \ + ({ (void)(sb); (void)(blk); (void)(num); (void)(gfp); 0; }) +#define sb_issue_discard(sb, sector, nr_sects, gfp, flags) \ + ({ (void)(sb); (void)(sector); (void)(nr_sects); (void)(gfp); (void)(flags); 0; }) + +/* Case-folding - not supported in U-Boot */ +#define sb_no_casefold_compat_fallback(sb) ({ (void)(sb); 1; }) + +/* Superblock identity functions */ +static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, + unsigned len) +{ + if (len > sizeof(sb->s_uuid.b)) + len = sizeof(sb->s_uuid.b); + memcpy(sb->s_uuid.b, uuid, len); +} + #endif /* _LINUX_FS_SUPER_TYPES_H */