18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Squashfs - a compressed read only filesystem for Linux 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2010 68c2ecf20Sopenharmony_ci * Phillip Lougher <phillip@squashfs.org.uk> 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * xattr.h 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifdef CONFIG_SQUASHFS_XATTR 128c2ecf20Sopenharmony_ciextern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64, 138c2ecf20Sopenharmony_ci u64 *, unsigned int *); 148c2ecf20Sopenharmony_ciextern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *, 158c2ecf20Sopenharmony_ci unsigned int *, unsigned long long *); 168c2ecf20Sopenharmony_ci#else 178c2ecf20Sopenharmony_cistatic inline __le64 *squashfs_read_xattr_id_table(struct super_block *sb, 188c2ecf20Sopenharmony_ci u64 start, u64 *xattr_table_start, unsigned int *xattr_ids) 198c2ecf20Sopenharmony_ci{ 208c2ecf20Sopenharmony_ci struct squashfs_xattr_id_table *id_table; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci id_table = squashfs_read_table(sb, start, sizeof(*id_table)); 238c2ecf20Sopenharmony_ci if (IS_ERR(id_table)) 248c2ecf20Sopenharmony_ci return (__le64 *) id_table; 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci *xattr_table_start = le64_to_cpu(id_table->xattr_table_start); 278c2ecf20Sopenharmony_ci kfree(id_table); 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci ERROR("Xattrs in filesystem, these will be ignored\n"); 308c2ecf20Sopenharmony_ci return ERR_PTR(-ENOTSUPP); 318c2ecf20Sopenharmony_ci} 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_cistatic inline int squashfs_xattr_lookup(struct super_block *sb, 348c2ecf20Sopenharmony_ci unsigned int index, int *count, unsigned int *size, 358c2ecf20Sopenharmony_ci unsigned long long *xattr) 368c2ecf20Sopenharmony_ci{ 378c2ecf20Sopenharmony_ci return 0; 388c2ecf20Sopenharmony_ci} 398c2ecf20Sopenharmony_ci#define squashfs_listxattr NULL 408c2ecf20Sopenharmony_ci#define squashfs_xattr_handlers NULL 418c2ecf20Sopenharmony_ci#endif 42