From patchwork Mon Jan 19 06:15:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1609 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=1768803357; bh=xYFXuMF7udvPZf+h5Y/1vk1mqEFOdCwQ5QR7pg8g3BA=; 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=DL9BtD4hf0NQD2bPSxdh+5TxvyvRplJ+Vp4jvpMZ4UgsEROeimtKIxpKYGaU12OSn nkJjdvleoWCCFJst4gxgQWP3A60uvS9UnJ2NMOLPdiAInjWHyKtiqOddCnw6vVqV+5 ONQN9li6MZiEK4k6a25Lzpgu9nFqdlR4Ox3eVvN+LXwby5uSgKkhcXNAN2P8DlGzRs CKrsuCKSJzwwpwTiQ83waqyGn5snPE3hiI/js8iVwKviSbulj+8JOLY2rUj4Sfkpjb piD9BM8Xryhrjnxs+j8sOGtBDDM6jAo/2zzbda1G+dI6D8Wrdh/cZbgy59GUPHKwQp OZ4UI9mMaJTQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2C4FE693AE for ; Sun, 18 Jan 2026 23:15:57 -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 vjhHhWJqgKkq for ; Sun, 18 Jan 2026 23:15:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803357; bh=xYFXuMF7udvPZf+h5Y/1vk1mqEFOdCwQ5QR7pg8g3BA=; 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=DL9BtD4hf0NQD2bPSxdh+5TxvyvRplJ+Vp4jvpMZ4UgsEROeimtKIxpKYGaU12OSn nkJjdvleoWCCFJst4gxgQWP3A60uvS9UnJ2NMOLPdiAInjWHyKtiqOddCnw6vVqV+5 ONQN9li6MZiEK4k6a25Lzpgu9nFqdlR4Ox3eVvN+LXwby5uSgKkhcXNAN2P8DlGzRs CKrsuCKSJzwwpwTiQ83waqyGn5snPE3hiI/js8iVwKviSbulj+8JOLY2rUj4Sfkpjb piD9BM8Xryhrjnxs+j8sOGtBDDM6jAo/2zzbda1G+dI6D8Wrdh/cZbgy59GUPHKwQp OZ4UI9mMaJTQw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 128E1694CE for ; Sun, 18 Jan 2026 23:15:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803355; bh=EU2Rc9CK/POpPq+9p7V9zjQsJWfVwr/jPQs4wYPIsJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gG77b/A21l8DNb9NGpLvU0K/4Yc3uepmKTqk+oSkDinTMGoJ5EIBpiol0IC9FgglT rM53PReJT1EhZv9ykkGN7CwgMhKRRolzs86jxPbTQe0jWFwYaYlTiFN8tqnFPM7lc5 HVYvlwykBxkbX8VLBqGC/HrfwjYLmyOkJhq8+WiuB45crbNEEB8De0884IJdaAtVbT JBlovDVh+0JM1HhplF50d2x2EoMWbHrRzi9DqDEm7HB7GUYaGXP/dN0iWm7bzT6Dds dn/CY1w8M1bwSu8GxrTvgwL9bBag8Tx07f4SyTBGwkKZIL42X0Wv67Z+8SreeUcJyW +mMACEeU5SSUA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 18ACD693AE; Sun, 18 Jan 2026 23:15:55 -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 TVWRBF6zxJXC; Sun, 18 Jan 2026 23:15:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803351; bh=TJ76MO+jeEmPiLTaxa9EN7kCEmhl1pFgXCPbSsbQRoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u0/Hvgv5I3mRILGhpqbsdHA+MW20uSD6n7D2A3Ia+XDSiuIa0hqi8dChATG4p0sjp cxTHpw01RHBiTIvcuYZ7lQisfFEgJLIBNFCFN/UXieHsmEg0tWmP9uVcYJjcoCBa/8 lnjLTSXlMdVKfw9u9TEaof71D+63V38ZPf5GJ6oHfewCslos8bf0OfIC9sPcA18k/b QG0bbG5q+7W7oW1qrZ2AftD9YH/LPdaNa1G4xCM/hy1wLOF4a2dxcd7/yFxGd/lFtH diidGtyKItoYYT0Ce0KV0C8/KdFOxdcFgPFTImT5WYkkpYZZUX2fkXMIjvQWlOBjBi iIj6C9pEhet7Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BF272694CE; Sun, 18 Jan 2026 23:15:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:00 -0700 Message-ID: <20260119061529.3383191-3-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: QTUQUKSLDNR2A4AMI7L6KMZNHE7MKQKL X-Message-ID-Hash: QTUQUKSLDNR2A4AMI7L6KMZNHE7MKQKL 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 02/23] linux: path: Add path_put and d_path stubs 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 path_put() macro and d_path() stub function to linux/path.h for filesystem code that uses path operations. Update linux/fs.h to include linux/path.h instead of duplicating the struct path definition. Update ext4_uboot.h to use linux/path.h instead of duplicating these definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 12 +++--------- include/linux/fs.h | 7 ++----- include/linux/path.h | 31 +++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4fb8f9111b0..7ad24732cf4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -928,13 +928,8 @@ void mapping_clear_folio_cache(struct address_space *mapping); #define sb_start_pagefault(sb) do { (void)(sb); } while (0) #define sb_end_pagefault(sb) do { (void)(sb); } while (0) -/* d_path - get pathname - stub returns empty path */ -static inline char *d_path(const struct path *path, char *buf, int buflen) -{ - if (buflen > 0) - buf[0] = '\0'; - return buf; -} +/* d_path, path_put - use linux/path.h */ +#include /* fscrypt_file_open is in ext4_fscrypt.h */ #define fsverity_file_open(i, f) ({ (void)(i); (void)(f); 0; }) @@ -1379,8 +1374,7 @@ int inode_generic_drop(struct inode *inode); /* NFS export helpers are now in linux/exportfs.h */ -/* Path operations */ -#define path_put(p) do { } while (0) +/* Path operations - path_put, d_path are in linux/path.h */ /* I/O priority - declaration for stub.c */ int IOPRIO_PRIO_VALUE(int class, int data); diff --git a/include/linux/fs.h b/include/linux/fs.h index 7393fd0d316..28b57b59484 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -51,11 +51,8 @@ struct vfsmount { struct dentry *mnt_root; }; -/* path - pathname components */ -struct path { - struct vfsmount *mnt; - struct dentry *dentry; -}; +/* path - use linux/path.h */ +#include /* Buffer operations are in buffer_head.h */ diff --git a/include/linux/path.h b/include/linux/path.h index 27cc071026a..3ebcb16e3c7 100644 --- a/include/linux/path.h +++ b/include/linux/path.h @@ -1,4 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Path definitions for U-Boot + * + * Based on Linux path.h - filesystem path operations. + */ #ifndef _LINUX_PATH_H #define _LINUX_PATH_H @@ -10,4 +15,30 @@ struct path { struct dentry *dentry; }; +/** + * path_put() - release a path reference + * @path: path to release + * + * U-Boot stub - no reference counting. + */ +#define path_put(path) do { (void)(path); } while (0) + +/** + * d_path() - get pathname from path structure + * @path: path to convert + * @buf: buffer for pathname + * @buflen: size of buffer + * + * U-Boot stub - returns empty string. + * + * Return: pointer to pathname in buffer + */ +static inline char *d_path(const struct path *path, char *buf, int buflen) +{ + (void)path; + if (buflen > 0) + buf[0] = '\0'; + return buf; +} + #endif /* _LINUX_PATH_H */