1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun * Squashfs - a compressed read only filesystem for Linux
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * Copyright (c) 2010
6*4882a593Smuzhiyun * Phillip Lougher <phillip@squashfs.org.uk>
7*4882a593Smuzhiyun *
8*4882a593Smuzhiyun * xattr.h
9*4882a593Smuzhiyun */
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun #ifdef CONFIG_SQUASHFS_XATTR
12*4882a593Smuzhiyun extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64,
13*4882a593Smuzhiyun u64 *, int *);
14*4882a593Smuzhiyun extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *,
15*4882a593Smuzhiyun unsigned int *, unsigned long long *);
16*4882a593Smuzhiyun #else
squashfs_read_xattr_id_table(struct super_block * sb,u64 start,u64 * xattr_table_start,int * xattr_ids)17*4882a593Smuzhiyun static inline __le64 *squashfs_read_xattr_id_table(struct super_block *sb,
18*4882a593Smuzhiyun u64 start, u64 *xattr_table_start, int *xattr_ids)
19*4882a593Smuzhiyun {
20*4882a593Smuzhiyun struct squashfs_xattr_id_table *id_table;
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun id_table = squashfs_read_table(sb, start, sizeof(*id_table));
23*4882a593Smuzhiyun if (IS_ERR(id_table))
24*4882a593Smuzhiyun return (__le64 *) id_table;
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun *xattr_table_start = le64_to_cpu(id_table->xattr_table_start);
27*4882a593Smuzhiyun kfree(id_table);
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun ERROR("Xattrs in filesystem, these will be ignored\n");
30*4882a593Smuzhiyun return ERR_PTR(-ENOTSUPP);
31*4882a593Smuzhiyun }
32*4882a593Smuzhiyun
squashfs_xattr_lookup(struct super_block * sb,unsigned int index,int * count,unsigned int * size,unsigned long long * xattr)33*4882a593Smuzhiyun static inline int squashfs_xattr_lookup(struct super_block *sb,
34*4882a593Smuzhiyun unsigned int index, int *count, unsigned int *size,
35*4882a593Smuzhiyun unsigned long long *xattr)
36*4882a593Smuzhiyun {
37*4882a593Smuzhiyun return 0;
38*4882a593Smuzhiyun }
39*4882a593Smuzhiyun #define squashfs_listxattr NULL
40*4882a593Smuzhiyun #define squashfs_xattr_handlers NULL
41*4882a593Smuzhiyun #endif
42