From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C81F823EAA0 for ; Mon, 29 Dec 2025 09:30:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.113 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767000610; cv=none; b=RZlWu8sVGcA+p3ZOZ8/112c/JwNwcC96cFzjMJsXjqAhBjbCzrCn8M7+LIkGrwSLMDhkbvmRTbqoZ1akRGTo43ztqcqq6mDCQ5TDA+H4xOIWUYzs/DQJ/BA3DyRWSIF9Z9jvg9O4PYnE2nw1ljYRfNXaumZsruHtHsydVrgXybs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767000610; c=relaxed/simple; bh=TIv1nX6oHuYmcS9q6+n3tuiVQq6uXhq9oX7JSD7L4KQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NeDFooLb/rK5xL93gft/wS7ZGOxXmKUlhNpwkAkJQYEPoMuAIJKaHEJBewj0gRZQZD8m1bxrzHRp1VxQLZfhVrqtAXWRON/64lSWR2S+XZvL87uqrsMXmaJDUSTRwXvJjrr3DbfApHChQzQdWuMEA9Zhmuu/F1bh/21/17lIoKk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=ozHQNYAw; arc=none smtp.client-ip=115.124.30.113 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="ozHQNYAw" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1767000597; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=zzU0fFMiBI6Btba2fQszSuRuhXNAVv5WzkyTFe9Hlhs=; b=ozHQNYAwOSikn5IZlj1YFCPDApGhkpw2njzeLATpd6HSGlRsj2btXZJgyLYeHjAGpvC46l3S7ePg4SccaOa1XQeWLfDaQALcpTpjuAI50QFl37DqFfEqHaY6AGGjPkvX6gvLda+gW8NJ/9rNiBsA0DRHJ15vTZ8/sTEPrXY275k= Received: from x31i01179.sqa.na131.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WvqzdtL_1767000595 cluster:ay36) by smtp.aliyun-inc.com; Mon, 29 Dec 2025 17:29:56 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org Cc: LKML , Gao Xiang Subject: [PATCH 4/4] erofs: unexport erofs_xattr_prefix() Date: Mon, 29 Dec 2025 17:29:49 +0800 Message-ID: <20251229092949.2316075-4-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20251229092949.2316075-1-hsiangkao@linux.alibaba.com> References: <20251229092949.2316075-1-hsiangkao@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit It can be simply in xattr.c due to no external users. Signed-off-by: Gao Xiang --- fs/erofs/xattr.c | 27 +++++++++++++++++++++++++++ fs/erofs/xattr.h | 30 ------------------------------ 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c index 972941ecb71c..d25c1cc1940c 100644 --- a/fs/erofs/xattr.c +++ b/fs/erofs/xattr.c @@ -25,6 +25,8 @@ struct erofs_xattr_iter { struct dentry *dentry; }; +static const char *erofs_xattr_prefix(unsigned int idx, struct dentry *dentry); + static int erofs_init_inode_xattrs(struct inode *inode) { struct erofs_inode *const vi = EROFS_I(inode); @@ -462,6 +464,31 @@ const struct xattr_handler * const erofs_xattr_handlers[] = { NULL, }; +static const char *erofs_xattr_prefix(unsigned int idx, struct dentry *dentry) +{ + const struct xattr_handler *handler = NULL; + + static const struct xattr_handler * const xattr_handler_map[] = { + [EROFS_XATTR_INDEX_USER] = &erofs_xattr_user_handler, +#ifdef CONFIG_EROFS_FS_POSIX_ACL + [EROFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access, + [EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default, +#endif + [EROFS_XATTR_INDEX_TRUSTED] = &erofs_xattr_trusted_handler, +#ifdef CONFIG_EROFS_FS_SECURITY + [EROFS_XATTR_INDEX_SECURITY] = &erofs_xattr_security_handler, +#endif + }; + + if (idx && idx < ARRAY_SIZE(xattr_handler_map)) + handler = xattr_handler_map[idx]; + + if (!xattr_handler_can_list(handler, dentry)) + return NULL; + + return xattr_prefix(handler); +} + void erofs_xattr_prefixes_cleanup(struct super_block *sb) { struct erofs_sb_info *sbi = EROFS_SB(sb); diff --git a/fs/erofs/xattr.h b/fs/erofs/xattr.h index ee1d8c310d97..36f2667afc2d 100644 --- a/fs/erofs/xattr.h +++ b/fs/erofs/xattr.h @@ -11,36 +11,6 @@ #include #ifdef CONFIG_EROFS_FS_XATTR -extern const struct xattr_handler erofs_xattr_user_handler; -extern const struct xattr_handler erofs_xattr_trusted_handler; -extern const struct xattr_handler erofs_xattr_security_handler; - -static inline const char *erofs_xattr_prefix(unsigned int idx, - struct dentry *dentry) -{ - const struct xattr_handler *handler = NULL; - - static const struct xattr_handler * const xattr_handler_map[] = { - [EROFS_XATTR_INDEX_USER] = &erofs_xattr_user_handler, -#ifdef CONFIG_EROFS_FS_POSIX_ACL - [EROFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access, - [EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default, -#endif - [EROFS_XATTR_INDEX_TRUSTED] = &erofs_xattr_trusted_handler, -#ifdef CONFIG_EROFS_FS_SECURITY - [EROFS_XATTR_INDEX_SECURITY] = &erofs_xattr_security_handler, -#endif - }; - - if (idx && idx < ARRAY_SIZE(xattr_handler_map)) - handler = xattr_handler_map[idx]; - - if (!xattr_handler_can_list(handler, dentry)) - return NULL; - - return xattr_prefix(handler); -} - extern const struct xattr_handler * const erofs_xattr_handlers[]; int erofs_xattr_prefixes_init(struct super_block *sb); -- 2.43.5