From 4baa975840d0efe4a482a0b0de04f736df9f348e Mon Sep 17 00:00:00 2001 From: xiane Date: Mon, 14 Oct 2024 12:53:20 +0900 Subject: [PATCH] ANDROID: ODROID-C5: aml_erofs: Avoid symbol fix. - generic_ro_fops, posix_acl_access_xattr_handler and posix_acl_default_xattr_handler. Change-Id: I556303d05d3f0b1058d5d2023084a8006875df78 Signed-off-by: xiane --- drivers/amfc/aml_erofs/inode.c | 2 +- drivers/amfc/aml_erofs/internal.h | 4 ---- drivers/amfc/aml_erofs/super.c | 4 ---- drivers/amfc/aml_erofs/utils.c | 3 --- drivers/amfc/aml_erofs/xattr.c | 13 +++++++------ drivers/amfc/aml_erofs/xattr.h | 20 +++++++++++--------- 6 files changed, 19 insertions(+), 27 deletions(-) diff --git a/drivers/amfc/aml_erofs/inode.c b/drivers/amfc/aml_erofs/inode.c index fbbadbdf6..95e2caaea 100644 --- a/drivers/amfc/aml_erofs/inode.c +++ b/drivers/amfc/aml_erofs/inode.c @@ -272,7 +272,7 @@ static int erofs_fill_inode(struct inode *inode, int isdir) case S_IFREG: inode->i_op = &erofs_generic_iops; if (erofs_inode_is_data_compressed(vi->datalayout)) { - inode->i_fop = generic_ro_fops_t; + inode->i_fop = &generic_ro_fops; } else { #ifdef CONFIG_FS_DAX erofs_file_fops.mmap = erofs_file_mmap; diff --git a/drivers/amfc/aml_erofs/internal.h b/drivers/amfc/aml_erofs/internal.h index 079d7b330..ad9462b9f 100644 --- a/drivers/amfc/aml_erofs/internal.h +++ b/drivers/amfc/aml_erofs/internal.h @@ -607,10 +607,6 @@ typedef const char *(*simple_get_link_t)(struct dentry *dentry, struct inode *in typedef int (*fs_param_is_enum_t)(struct p_log *log, const struct fs_parameter_spec *p, struct fs_parameter *param, struct fs_parse_result *result); -extern struct file_operations *generic_ro_fops_t; -extern struct xattr_handler *posix_acl_default_xattr_handler_t; -extern struct xattr_handler *posix_acl_access_xattr_handler_t; - extern __xa_cmpxchg_t f___xa_cmpxchg; extern fs_ftype_to_dtype_t f_fs_ftype_to_dtype; extern filemap_read_t f_filemap_read; diff --git a/drivers/amfc/aml_erofs/super.c b/drivers/amfc/aml_erofs/super.c index 141d70fa2..f88098778 100644 --- a/drivers/amfc/aml_erofs/super.c +++ b/drivers/amfc/aml_erofs/super.c @@ -702,10 +702,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_time_gran = 1; sb->s_op = &erofs_sops; -#if CONFIG_AMLOGIC_EROFS_POSIX_ACL - erofs_xattr_handlers[1] = posix_acl_access_xattr_handler_t; - erofs_xattr_handlers[2] = posix_acl_default_xattr_handler_t; -#endif sb->s_xattr = (const struct xattr_handler **)erofs_xattr_handlers; if (test_opt(&sbi->opt, POSIX_ACL)) diff --git a/drivers/amfc/aml_erofs/utils.c b/drivers/amfc/aml_erofs/utils.c index bc510b9c7..2555457fa 100644 --- a/drivers/amfc/aml_erofs/utils.c +++ b/drivers/amfc/aml_erofs/utils.c @@ -384,9 +384,6 @@ static struct ksymbol module_symbols[] = { KSYM_FUN(LZ4_decompress_safe), KSYM_FUN(LZ4_decompress_safe_partial), KSYM_FUN(out_of_line_wait_on_bit_lock), - KSYM_OBJ(generic_ro_fops), - KSYM_OBJ(posix_acl_default_xattr_handler), - KSYM_OBJ(posix_acl_access_xattr_handler), { /* * compiler always say symbol undefined if use KSYM_FUN macro * seems compiler have bug. diff --git a/drivers/amfc/aml_erofs/xattr.c b/drivers/amfc/aml_erofs/xattr.c index 169d1b7ea..466321a52 100644 --- a/drivers/amfc/aml_erofs/xattr.c +++ b/drivers/amfc/aml_erofs/xattr.c @@ -5,6 +5,7 @@ */ #include #include "xattr.h" +#include struct xattr_iter { struct super_block *sb; @@ -490,14 +491,14 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, return erofs_getxattr(inode, handler->flags, name, buffer, size); } -struct xattr_handler erofs_xattr_user_handler = { +const struct xattr_handler erofs_xattr_user_handler = { .prefix = XATTR_USER_PREFIX, .flags = EROFS_XATTR_INDEX_USER, .list = erofs_xattr_user_list, .get = erofs_xattr_generic_get, }; -struct xattr_handler erofs_xattr_trusted_handler = { +const struct xattr_handler erofs_xattr_trusted_handler = { .prefix = XATTR_TRUSTED_PREFIX, .flags = EROFS_XATTR_INDEX_TRUSTED, .list = erofs_xattr_trusted_list, @@ -505,18 +506,18 @@ struct xattr_handler erofs_xattr_trusted_handler = { }; #ifdef CONFIG_AMLOGIC_EROFS_SECURITY -struct xattr_handler __maybe_unused erofs_xattr_security_handler = { +const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix = XATTR_SECURITY_PREFIX, .flags = EROFS_XATTR_INDEX_SECURITY, .get = erofs_xattr_generic_get, }; #endif -struct xattr_handler *erofs_xattr_handlers[] = { +const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler, #ifdef CONFIG_AMLOGIC_EROFS_POSIX_ACL - NULL, //posix_acl_access_xattr_handler_t, - NULL, //posix_acl_default_xattr_handler_t, + &posix_acl_access_xattr_handler, + &posix_acl_default_xattr_handler, #endif &erofs_xattr_trusted_handler, #ifdef CONFIG_AMLOGIC_EROFS_SECURITY diff --git a/drivers/amfc/aml_erofs/xattr.h b/drivers/amfc/aml_erofs/xattr.h index 7064a0284..ed6e750f6 100644 --- a/drivers/amfc/aml_erofs/xattr.h +++ b/drivers/amfc/aml_erofs/xattr.h @@ -37,31 +37,33 @@ static inline unsigned int xattrblock_offset(struct erofs_sb_info *sbi, } #ifdef CONFIG_AMLOGIC_EROFS_XATTR -extern struct xattr_handler erofs_xattr_user_handler; -extern struct xattr_handler erofs_xattr_trusted_handler; +extern const struct xattr_handler erofs_xattr_user_handler; +extern const struct xattr_handler erofs_xattr_trusted_handler; #ifdef CONFIG_AMLOGIC_EROFS_SECURITY -extern struct xattr_handler erofs_xattr_security_handler; +extern const struct xattr_handler erofs_xattr_security_handler; #endif static inline const struct xattr_handler *erofs_xattr_handler(unsigned int idx) { - static struct xattr_handler *xattr_handler_map[] = { + static const struct xattr_handler *xattr_handler_map[] = { [EROFS_XATTR_INDEX_USER] = &erofs_xattr_user_handler, +#ifdef CONFIG_AMLOGIC_EROFS_POSIX_ACL + [EROFS_XATTR_INDEX_POSIX_ACL_ACCESS] = + &posix_acl_access_xattr_handler, + [EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = + &posix_acl_default_xattr_handler, +#endif [EROFS_XATTR_INDEX_TRUSTED] = &erofs_xattr_trusted_handler, #ifdef CONFIG_AMLOGIC_EROFS_SECURITY [EROFS_XATTR_INDEX_SECURITY] = &erofs_xattr_security_handler, #endif }; -#ifdef CONFIG_AMLOGIC_EROFS_POSIX_ACL - xattr_handler_map[EROFS_XATTR_INDEX_POSIX_ACL_ACCESS] = posix_acl_access_xattr_handler_t; - xattr_handler_map[EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = posix_acl_default_xattr_handler_t; -#endif return idx && idx < ARRAY_SIZE(xattr_handler_map) ? xattr_handler_map[idx] : NULL; } -extern struct xattr_handler *erofs_xattr_handlers[]; +extern const struct xattr_handler *erofs_xattr_handlers[]; int erofs_getxattr(struct inode *, int, const char *, void *, size_t); ssize_t erofs_listxattr(struct dentry *, char *, size_t);