From patchwork Thu Apr 16 16:56:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2203 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=1776358745; bh=nC2Zo3/toKVHHaZyF9hhWP/utjEs3uvS7wYDO/iGmlw=; 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=N3HFQAYJ3ohGj+eVYfwo4ZyL7pr4U9iIzC6qYWrYEO5h4BjLnb37NXU+VePjkj4WF Jwhc1JhmGALYLLzdHZXqjkBX6ek8dv2Q6KjyHhdiV+FtrqDMeJZxdwNST1vTeublwA chzXu4im7gATd2mTuHc4hFIyYrQs6xHLOyhY44i8= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CF7266A4ED for ; Thu, 16 Apr 2026 10:59:05 -0600 (MDT) 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 T-GrOXrz0I61 for ; Thu, 16 Apr 2026 10:59:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776358744; bh=nC2Zo3/toKVHHaZyF9hhWP/utjEs3uvS7wYDO/iGmlw=; 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=AEEFrFyGHbKd0oXO1ABqsV8nhy3TkGxMsWu39v8vUUFvGoOTW8HvprAAJvmWXcXes UQWYMEF1Ohbo5TlM7XEQ3ZOSADjzBpSmjaOLtut7FE5pXDHuTq4hH6OpPj5i1jSvaT dK1Z+aflvW97HkT59lV1pBSdQZ/kvRKtSI5wvA8U= Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8FDE56A4DE for ; Thu, 16 Apr 2026 10:59:04 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776358742; bh=B8Uqp11Dhk7p559mu59RozRmm0johytLPmDE4UWahw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jWlt+F2gM2Sg7nhxmcFe6AKafdzN8TO98/WO9VaNQgMsGAGtYVgnu28zKpDVjs16K wvWLc4bPQU2fQMKwJRToqu/LmraLxqmGpckwvpvmkdJO7rFGheXpJ+MvYzjAArYBkb nlxXKyWX3+RFATUKah7eikWpwY3EKJidlGDfpRWo= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 90E856A4A5; Thu, 16 Apr 2026 10:59:02 -0600 (MDT) 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 i0GBz7gEEEI7; Thu, 16 Apr 2026 10:59:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776358742; bh=NmNPoLvyMX4bF8xFeNrr9QatlJf159NzR8PjBUNRNl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PtjpKeF2OtEl5+2tHriCdcheQnESEl9zcNs+e9HCMxmc7f++qbmvgYV/Xj8qk4cCb NDN2T1gKKNY2HaUTYKkr17qp5HF/2G+Dav0KDr6cZFVjBHV8ec3jH1YTvjlcvjPirX 4sI4qbNJTH3GiRnKOZJkKx7FtVwEeYGAi0R0Cx+8= Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1235F6A4D8; Thu, 16 Apr 2026 10:59:02 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 16 Apr 2026 10:56:57 -0600 Message-ID: <20260416165733.2923423-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260416165733.2923423-1-sjg@u-boot.org> References: <20260416165733.2923423-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2GHTFYTK5DZQVQZ27LRSJECT2GCHLQTB X-Message-ID-Hash: 2GHTFYTK5DZQVQZ27LRSJECT2GCHLQTB 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 07/21] linux: fs: Add shared VFS function declarations 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 Declare the common VFS helpers shared across Linux-ported filesystem drivers: dir_emit_dot(), dir_emit_dotdot(), generic_ro_fops and page_symlink_inode_operations. Update the source-file comments on generic_read_dir() and generic_check_addressable() to point at fs/linux_fs.c, where the implementations move in a follow-up patch. Signed-off-by: Simon Glass --- include/linux/fs.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 1bc50d46281..c8b95528013 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -472,6 +472,10 @@ static inline bool dir_emit(struct dir_context *ctx, const char *name, int len, return ctx->actor(ctx, name, len, ctx->pos, ino, type) == 0; } +/* dir_emit_dot/dotdot - implemented in fs/linux_fs.c */ +bool dir_emit_dot(struct file *file, struct dir_context *ctx); +bool dir_emit_dotdot(struct file *file, struct dir_context *ctx); + #define dir_relax_shared(i) ({ (void)(i); 1; }) /* Inode mutex nesting classes */ @@ -729,11 +733,17 @@ struct inode_operations { /* Case-insensitive name validation - not supported */ #define generic_ci_validate_strict_name(d, n) ({ (void)(d); (void)(n); 1; }) -/* Generic directory read - implemented in ext4l/stub.c */ +/* Generic directory read - implemented in fs/linux_fs.c */ ssize_t generic_read_dir(struct file *f, char __user *buf, size_t count, loff_t *ppos); -/* Block addressability check - implemented in ext4l/stub.c */ +/* Block addressability check - implemented in fs/linux_fs.c */ int generic_check_addressable(unsigned int blocksize_bits, u64 num_blocks); +/* Read-only file operations stub - implemented in fs/linux_fs.c */ +extern const struct file_operations generic_ro_fops; + +/* Symlink inode operations stub - implemented in fs/linux_fs.c */ +extern const struct inode_operations page_symlink_inode_operations; + #endif /* _LINUX_FS_H */