xref: /linux/fs/squashfs/xattr.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
168252eb5SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
201e5b4e4SPhillip Lougher /*
301e5b4e4SPhillip Lougher  * Squashfs - a compressed read only filesystem for Linux
401e5b4e4SPhillip Lougher  *
501e5b4e4SPhillip Lougher  * Copyright (c) 2010
6d7f2ff67SPhillip Lougher  * Phillip Lougher <phillip@squashfs.org.uk>
701e5b4e4SPhillip Lougher  *
801e5b4e4SPhillip Lougher  * xattr.h
901e5b4e4SPhillip Lougher  */
1001e5b4e4SPhillip Lougher 
11637d5c9aSPhillip Lougher #ifdef CONFIG_SQUASHFS_XATTR
1201e5b4e4SPhillip Lougher extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64,
13*f65c4bbbSPhillip Lougher 		u64 *, unsigned int *);
1401e5b4e4SPhillip Lougher extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *,
155f3b321dSPhillip Lougher 		unsigned int *, unsigned long long *);
1601e5b4e4SPhillip Lougher #else
squashfs_read_xattr_id_table(struct super_block * sb,u64 start,u64 * xattr_table_start,unsigned int * xattr_ids)1701e5b4e4SPhillip Lougher static inline __le64 *squashfs_read_xattr_id_table(struct super_block *sb,
18*f65c4bbbSPhillip Lougher 		u64 start, u64 *xattr_table_start, unsigned int *xattr_ids)
1901e5b4e4SPhillip Lougher {
20f37aa4c7SPhillip Lougher 	struct squashfs_xattr_id_table *id_table;
21f37aa4c7SPhillip Lougher 
22f37aa4c7SPhillip Lougher 	id_table = squashfs_read_table(sb, start, sizeof(*id_table));
23f37aa4c7SPhillip Lougher 	if (IS_ERR(id_table))
24f37aa4c7SPhillip Lougher 		return (__le64 *) id_table;
25f37aa4c7SPhillip Lougher 
26f37aa4c7SPhillip Lougher 	*xattr_table_start = le64_to_cpu(id_table->xattr_table_start);
27f37aa4c7SPhillip Lougher 	kfree(id_table);
28f37aa4c7SPhillip Lougher 
2901e5b4e4SPhillip Lougher 	ERROR("Xattrs in filesystem, these will be ignored\n");
3001e5b4e4SPhillip Lougher 	return ERR_PTR(-ENOTSUPP);
3101e5b4e4SPhillip Lougher }
3201e5b4e4SPhillip Lougher 
squashfs_xattr_lookup(struct super_block * sb,unsigned int index,int * count,unsigned int * size,unsigned long long * xattr)3301e5b4e4SPhillip Lougher static inline int squashfs_xattr_lookup(struct super_block *sb,
345f3b321dSPhillip Lougher 		unsigned int index, int *count, unsigned int *size,
35aa5b1894SStephen Hemminger 		unsigned long long *xattr)
3601e5b4e4SPhillip Lougher {
3701e5b4e4SPhillip Lougher 	return 0;
3801e5b4e4SPhillip Lougher }
3901e5b4e4SPhillip Lougher #define squashfs_listxattr NULL
4001e5b4e4SPhillip Lougher #define squashfs_xattr_handlers NULL
4101e5b4e4SPhillip Lougher #endif
42