1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) International Business Machines Corp., 2000-2002
9 #include <linux/xattr.h>
12 * jfs_ea_list describe the on-disk format of the extended attributes.
13 * I know the null-terminator is redundant since namelen is stored, but
14 * I am maintaining compatibility with OS/2 where possible.
17 u8 flag; /* Unused? */
18 u8 namelen; /* Length of name */
19 __le16 valuelen; /* Length of value */
20 char name[]; /* Attribute name (includes null-terminator) */
21 }; /* Value immediately follows name */
24 __le32 size; /* overall size */
25 struct jfs_ea ea[]; /* Variable length list */
28 /* Macros for defining maximum number of bytes supported for EAs */
29 #define MAXEASIZE 65535
30 #define MAXEALISTSIZE MAXEASIZE
33 * some macros for dealing with variable length EA lists.
36 (sizeof (struct jfs_ea) + (ea)->namelen + 1 + \
37 le16_to_cpu((ea)->valuelen))
38 #define NEXT_EA(ea) ((struct jfs_ea *) (((char *) (ea)) + (EA_SIZE (ea))))
39 #define FIRST_EA(ealist) ((ealist)->ea)
40 #define EALIST_SIZE(ealist) le32_to_cpu((ealist)->size)
41 #define END_EALIST(ealist) \
42 ((struct jfs_ea *) (((char *) (ealist)) + EALIST_SIZE(ealist)))
44 extern int __jfs_setxattr(tid_t, struct inode *, const char *, const void *,
46 extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t);
47 extern ssize_t jfs_listxattr(struct dentry *, char *, size_t);
49 extern const struct xattr_handler *jfs_xattr_handlers[];
51 #ifdef CONFIG_JFS_SECURITY
52 extern int jfs_init_security(tid_t, struct inode *, struct inode *,
55 static inline int jfs_init_security(tid_t tid, struct inode *inode,
56 struct inode *dir, const struct qstr *qstr)
62 #endif /* H_JFS_XATTR */