2 * Copyright (c) International Business Machines Corp., 2000-2002
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12 * the GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * jfs_ea_list describe the on-disk format of the extended attributes.
24 * I know the null-terminator is redundant since namelen is stored, but
25 * I am maintaining compatibility with OS/2 where possible.
28 u8 flag; /* Unused? */
29 u8 namelen; /* Length of name */
30 __le16 valuelen; /* Length of value */
31 char name[0]; /* Attribute name (includes null-terminator) */
32 }; /* Value immediately follows name */
35 __le32 size; /* overall size */
36 struct jfs_ea ea[0]; /* Variable length list */
39 /* Macros for defining maxiumum number of bytes supported for EAs */
40 #define MAXEASIZE 65535
41 #define MAXEALISTSIZE MAXEASIZE
44 * some macros for dealing with variable length EA lists.
47 (sizeof (struct jfs_ea) + (ea)->namelen + 1 + \
48 le16_to_cpu((ea)->valuelen))
49 #define NEXT_EA(ea) ((struct jfs_ea *) (((char *) (ea)) + (EA_SIZE (ea))))
50 #define FIRST_EA(ealist) ((ealist)->ea)
51 #define EALIST_SIZE(ealist) le32_to_cpu((ealist)->size)
52 #define END_EALIST(ealist) \
53 ((struct jfs_ea *) (((char *) (ealist)) + EALIST_SIZE(ealist)))
55 extern int __jfs_setxattr(struct inode *, const char *, const void *, size_t,
57 extern int jfs_setxattr(struct dentry *, const char *, const void *, size_t,
59 extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t);
60 extern ssize_t jfs_getxattr(struct dentry *, const char *, void *, size_t);
61 extern ssize_t jfs_listxattr(struct dentry *, char *, size_t);
62 extern int jfs_removexattr(struct dentry *, const char *);
64 #endif /* H_JFS_XATTR */