From patchwork Sat Dec 20 23:23:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 998 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=1766273064; bh=d8xk8MX/zSxYmVDEMO+VCD3cl1yn0A5ZXjZrgbOjs5U=; 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=Kczia5BEI4mlPJ561JiRlnd8E1we3VkadEhJjZbPaFGQvDpxqLXRqVsXDJmk/pgNh aSIiBQY9Ijc39z6XEwOMgpAU3MAfbBthMF0hCzMdd4gRDHFOfqq/Et8EqKMZ6GoxOU YjmjNabel5TLK25uQXhuyjopbSGOceysSeFPu/CoA9k2kIRcoCiuQTxSPvrahp+zPj 0c8yT+xo6/3vXUkPVOPfH3ROaPz7VqcuMr88VM0gkQ7c4ssvqUZWqclWTqZqPXU6o9 XrpxESvonfxKPyqYdJJufH7aFDB6oPW12HkIbQF4+ZBOs1ZaODryDO11KRN3RonBZI CZ51jF/Q/N99w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8AD0064C8F for ; Sat, 20 Dec 2025 16:24:24 -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 eO0UI8k4NYso for ; Sat, 20 Dec 2025 16:24:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766273064; bh=d8xk8MX/zSxYmVDEMO+VCD3cl1yn0A5ZXjZrgbOjs5U=; 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=Kczia5BEI4mlPJ561JiRlnd8E1we3VkadEhJjZbPaFGQvDpxqLXRqVsXDJmk/pgNh aSIiBQY9Ijc39z6XEwOMgpAU3MAfbBthMF0hCzMdd4gRDHFOfqq/Et8EqKMZ6GoxOU YjmjNabel5TLK25uQXhuyjopbSGOceysSeFPu/CoA9k2kIRcoCiuQTxSPvrahp+zPj 0c8yT+xo6/3vXUkPVOPfH3ROaPz7VqcuMr88VM0gkQ7c4ssvqUZWqclWTqZqPXU6o9 XrpxESvonfxKPyqYdJJufH7aFDB6oPW12HkIbQF4+ZBOs1ZaODryDO11KRN3RonBZI CZ51jF/Q/N99w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7A29264C60 for ; Sat, 20 Dec 2025 16:24:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766273063; bh=7yswGqVaX2E07jdNMRSTBpQh9IUjy75EP2/GMyfnibM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l+ajUtTpkouTa8wHnQhuPPNc8XSJwQiyvspkVEpQXvEKjflhpgmG4/81PjiYkGtGv QexkjU6CsBdGii5kb9gHdNDmaPE3IcWtwcZNn1DYrYSFkxoHe90Ao5IpMvvxLe8pJ0 19J1JrhKO5cu8isBR0Wk5l23qcudGsfMEiemhboBKIzEko/ktovHkToduw/2/jJdYS aQlUzIVDQPDy1PEKqaRUqiUGAHEjJmkR9FrGI9ajM8MeI/afBB7451Gkiebroyx/Bl F4cZF/I0vnw30okeMSF/j4ZGlxFjHcgwxWXmlpyBvwA1foQAXoMM8GyeyU/Qp6d4DM DMAadF8LiqkyA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CF01E64C45; Sat, 20 Dec 2025 16:24:23 -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 3A3WosD_Hozb; Sat, 20 Dec 2025 16:24:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766273059; bh=Oufj3F6Q1+fWzNVZ61LHU4gEF9SQFUyGDQX8WAE1CK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IJ8a9TV9NllIb4nqvFL3D9bQNro9270uVTTXqWv9wEjxjfWWrkgzg+vVfFDXk1zxQ mIDlMxOKCi/UtF8pS72sKrpq95sS8aqAzBQWSvGeMltR2oXHxDf76fDTNw+jcMULBT mLRHwgzk+QwioQ9LbaTuvi36Qvj/QNaxCkWwk84BEaArNFa1Z8KLqY9qCY/dylydvB GY9hhjvuhEuCTWOlvR5SDSppaQU9WHvC1/xSFRhRF5oqxhpvfTmyIIbYQs9h2t7guv F6AhpvSVGFA1V+GtIFoJAzImQTATNA+n1rNsHgjRubsFaL+YhlSsZrU46En8bm6jyj WrekD8GN6QFyA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 75B5264C25; Sat, 20 Dec 2025 16:24:19 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 20 Dec 2025 16:23:44 -0700 Message-ID: <20251220232355.845414-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251220232355.845414-1-sjg@u-boot.org> References: <20251220232355.845414-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QKDTD7X55W7GPV5M55HU73LP3UR7A5CT X-Message-ID-Hash: QKDTD7X55W7GPV5M55HU73LP3UR7A5CT 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 04/10] ext4l: Add xattr_trusted.c 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 xattr_trusted.c to the ext4l build with necessary changes: - Update xattr_trusted.c includes to use ext4_uboot.h - Add xattr.h include to ialloc.c for ext4_init_security - Remove duplicate ext4_init_security declaration from ext4_uboot.h (now provided by xattr.h inline stub) - Add ext4_xattr_get and ext4_xattr_set stubs Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Makefile | 4 +++- fs/ext4l/ext4_uboot.h | 7 +------ fs/ext4l/ialloc.c | 1 + fs/ext4l/stub.c | 17 +++++++++++++---- fs/ext4l/xattr_trusted.c | 3 +-- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index c5adb121f77..cfb1413ba30 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -6,5 +6,7 @@ obj-y := interface.o stub.o obj-y += balloc.o bitmap.o block_validity.o ext4_jbd2.o extents.o \ - extents_status.o hash.o ialloc.o indirect.o \ + extents_status.o hash.o ialloc.o \ + indirect.o \ + xattr_trusted.o \ orphan.o diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 6c328a5abf1..32b497deadc 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -390,12 +390,7 @@ struct qstr; int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, struct buffer_head *block_bh, size_t value_len, bool is_create); -/* ext4_init_security - stub for files that don't include xattr.h */ -static inline int ext4_init_security(void *handle, struct inode *inode, - struct inode *dir, const struct qstr *qstr) -{ - return 0; -} +/* ext4_init_security is provided by xattr.h */ /* inode state stubs */ #define is_bad_inode(inode) (0) diff --git a/fs/ext4l/ialloc.c b/fs/ext4l/ialloc.c index 3d9edbcc1c3..d72204a5d02 100644 --- a/fs/ext4l/ialloc.c +++ b/fs/ext4l/ialloc.c @@ -16,6 +16,7 @@ #include "ext4_uboot.h" #include "ext4.h" #include "ext4_jbd2.h" +#include "xattr.h" /* * ialloc.c contains the inodes allocation and deallocation routines diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 5a3eda0ad2e..41550bc48bc 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -388,12 +388,21 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, return 0; } -struct qstr; +/* ext4_init_security stub is provided by xattr.h */ -int ext4_init_security(void *handle, struct inode *inode, struct inode *dir, - const struct qstr *qstr) +/* + * Stubs for xattr_trusted.c + */ +int ext4_xattr_get(struct inode *inode, int name_index, const char *name, + void *buffer, size_t buffer_size) { - return 0; + return -1; +} + +int ext4_xattr_set(struct inode *inode, int name_index, const char *name, + const void *value, size_t value_len, int flags) +{ + return -1; } /* diff --git a/fs/ext4l/xattr_trusted.c b/fs/ext4l/xattr_trusted.c index 9811eb0ab27..57ef5caa588 100644 --- a/fs/ext4l/xattr_trusted.c +++ b/fs/ext4l/xattr_trusted.c @@ -7,8 +7,7 @@ */ #include -#include -#include +#include "ext4_uboot.h" #include "ext4_jbd2.h" #include "ext4.h" #include "xattr.h"