From patchwork Mon Jan 19 06:15:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1620 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=1768803407; bh=U1Ma085zaDdfgGAHGDWVV4yQqJg5J48J+L724rPMBDQ=; 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=e7uN0MLFghEmzPVYtVUhXQ0kfzKEvE4xGpp5yTcafSNfbg0oElRq9AU0kdYW0y9dO Atqbe9vVLGnEKfn4Thw3n1PyK0M7mW18X1yiLQf4rr594FzCLuJ5a5HAlRh09rufrg qbawK9JeupuPmBbOowuv4SsmzP/DS3E3rH+IN+T+V6cOJYHKZ3FdaPrVVUc3sd7Ltb DXtYnYX3E+CY6nY1VMlFUIZ+kKK0eA2sZN2A/bCuspRAnprxMXYIEiLDf51i7JXWfM chSnuXuxFlXVYbJkAtO/g51zWZPV6FMIgebNM4aKQvu3U3Xgu3m8Ya+n38QkoYvF2q mCDv6Nc0xVUIw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A22B5694DD for ; Sun, 18 Jan 2026 23:16:47 -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 OtaWgaGv01dz for ; Sun, 18 Jan 2026 23:16:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803407; bh=U1Ma085zaDdfgGAHGDWVV4yQqJg5J48J+L724rPMBDQ=; 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=e7uN0MLFghEmzPVYtVUhXQ0kfzKEvE4xGpp5yTcafSNfbg0oElRq9AU0kdYW0y9dO Atqbe9vVLGnEKfn4Thw3n1PyK0M7mW18X1yiLQf4rr594FzCLuJ5a5HAlRh09rufrg qbawK9JeupuPmBbOowuv4SsmzP/DS3E3rH+IN+T+V6cOJYHKZ3FdaPrVVUc3sd7Ltb DXtYnYX3E+CY6nY1VMlFUIZ+kKK0eA2sZN2A/bCuspRAnprxMXYIEiLDf51i7JXWfM chSnuXuxFlXVYbJkAtO/g51zWZPV6FMIgebNM4aKQvu3U3Xgu3m8Ya+n38QkoYvF2q mCDv6Nc0xVUIw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8F679694CE for ; Sun, 18 Jan 2026 23:16:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803406; bh=Kj0u102o8GAotek+YQOBXaNgQ27bV7NEf1cWn3gejas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YunGCHwA/J84Ucr6yWHlfoFCfCQiChTm54OYLbPq1vu6u5fCFCXV1QqKBVplQv9q1 H50PjLM5IJOMFCQRyFhgg6+lkN/zyTZXQcHdALImbjLvbE+ame5c/+02qKqpIfmN1q X5k6dU67A4VVo5PC9NPSH1gmLg+ciCeGqGLfMBD67Cj1zNbbKbsAW2EA72sh7pW0uS rZNGWO0hxX05Mb7W9KbP/47onxb5KYypMiSHZaYkWcMHihEV7bu06QOqvPtxmqCALr Ff6qemzKFAAIrJjMNmdKhOw4yRHMN+7uGlt4YmG+F5R/ArhPqWfpkyNwQO3cx45GFM eGElGy0fYm/uQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 32F94693AE; Sun, 18 Jan 2026 23:16: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 10026) with ESMTP id uBXq4kh4wAl2; Sun, 18 Jan 2026 23:16:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803402; bh=Sy9epVVDC8QY1aXhz0ZR7n+x1qwtnz88d7Wb3P1yOmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qk3P6BdBecXCtGFgU0ljyKN15FBgEbSTRzcDPOXSDWjmlzClP0OFQijv3t3EOHYpS fG0QdRcgX398gd8f2VlC8HKwMC4LnG1R64ml/olAo03ikOjJzmCvcKP9HEFR97jopP 3g/BK0Fsq8IjQvDrBjjkFUir/j9lpeAFrCMH4hht3tN+Alf/4TtzwY+G5zZ4zqXNdh 3T4luzcItBal6AmHIU84YH0nbFRl/RNy0lO5iIwlYI/YTbzDJ76CyCIN8DB5w9lsVf jioBfifqx/9Ohw62oMNYA9hIeRK+8uidReyGFcGC2JxD1sGCt8SUlpzbpYqeX3eydA ZCjJLmUZLvnfA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DC817694C0; Sun, 18 Jan 2026 23:16:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:11 -0700 Message-ID: <20260119061529.3383191-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RN4HQE33KQPF6BMW52MN32QB3RU4PO2F X-Message-ID-Hash: RN4HQE33KQPF6BMW52MN32QB3RU4PO2F 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 13/23] ext4l: Move REQ_OP and SLAB flags to proper 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 block I/O request operation codes and flags (REQ_OP_READ, REQ_OP_WRITE, REQ_OP_MASK, REQ_SYNC, REQ_FUA) to include/linux/blk_types.h where they belong with other block layer types. Move slab cache creation flags (SLAB_RECLAIM_ACCOUNT, SLAB_ACCOUNT) to include/linux/slab.h with other slab definitions. This matches Linux kernel header organisation and reduces duplication in ext4_uboot.h Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 14 +++----------- include/linux/blk_types.h | 9 +++++++++ include/linux/slab.h | 4 ++++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index d017d86247b..1622fec4e64 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1106,8 +1106,8 @@ static inline void end_buffer_read_sync(struct buffer_head *bh, int uptodate) clear_buffer_uptodate(bh); unlock_buffer(bh); } -#define REQ_OP_READ 0 +/* REQ_OP_READ is in linux/blk_types.h */ /* SB_ACTIVE is in linux/fs.h */ /* Part stat - not used in U-Boot. Note: sectors[X] is passed as second arg */ @@ -1127,9 +1127,7 @@ static u64 __attribute__((unused)) __ext4_sectors[2]; #define DUMP_PREFIX_ADDRESS 0 #define print_hex_dump(l, p, pt, rg, gc, b, len, a) do { } while (0) -/* Slab flags */ -#define SLAB_RECLAIM_ACCOUNT 0 -#define SLAB_ACCOUNT 0 +/* SLAB_RECLAIM_ACCOUNT, SLAB_ACCOUNT are in linux/slab.h */ /* Forward declarations for super_operations and export_operations */ struct kstatfs; @@ -1214,13 +1212,7 @@ void ext4_unregister_li_request(struct super_block *sb); #define BLK_OPEN_WRITE (1 << 1) #define BLK_OPEN_RESTRICT_WRITES (1 << 2) -/* Request operation (bits 0-7) and flags (bits 8+) */ -#define REQ_OP_WRITE 1 -#define REQ_OP_MASK 0xff - -/* ensure these values are outside the operations mask */ -#define REQ_SYNC (1 << 8) -#define REQ_FUA (1 << 9) +/* REQ_OP_*, REQ_SYNC, REQ_FUA are in linux/blk_types.h */ /* blk_holder_ops for block device */ struct blk_holder_ops { diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index aa7ea50d233..9d770f4bd6e 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -15,4 +15,13 @@ /* Block I/O operation flags */ typedef __u32 __bitwise blk_opf_t; +/* Block operation codes (bits 0-7) */ +#define REQ_OP_READ 0 +#define REQ_OP_WRITE 1 +#define REQ_OP_MASK 0xff + +/* Block request flags (bits 8+) */ +#define REQ_SYNC (1 << 8) /* Synchronous I/O */ +#define REQ_FUA (1 << 9) /* Forced unit access */ + #endif /* _LINUX_BLK_TYPES_H */ diff --git a/include/linux/slab.h b/include/linux/slab.h index 4f413f93fa3..1b212ca0e4a 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -46,6 +46,10 @@ #define GFP_NOIO ((gfp_t)0) #endif +/* Slab cache creation flags */ +#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Track pages reclaimed */ +#define SLAB_ACCOUNT 0x00000000UL /* Account to memcg (no-op) */ + void *kmalloc(size_t size, gfp_t flags); static inline void *kzalloc(size_t size, gfp_t flags)