Linux Audio

Check our new training course

Loading...
v6.9.4
 1/* SPDX-License-Identifier: GPL-2.0-or-later */
 2/*
 3 *   Copyright (C) International Business Machines Corp., 2000-2002
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 4 */
 5
 6#ifndef H_JFS_XATTR
 7#define H_JFS_XATTR
 8
 9#include <linux/xattr.h>
10
11/*
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.
15 */
16struct jfs_ea {
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 */
22
23struct jfs_ea_list {
24	__le32 size;		/* overall size */
25	struct jfs_ea ea[];	/* Variable length list */
26};
27
28/* Macros for defining maximum number of bytes supported for EAs */
29#define MAXEASIZE	65535
30#define MAXEALISTSIZE	MAXEASIZE
31
32/*
33 * some macros for dealing with variable length EA lists.
34 */
35#define EA_SIZE(ea) \
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)))
43
44extern int __jfs_setxattr(tid_t, struct inode *, const char *, const void *,
45			  size_t, int);
 
 
46extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t);
 
47extern ssize_t jfs_listxattr(struct dentry *, char *, size_t);
 
48
49extern const struct xattr_handler * const jfs_xattr_handlers[];
50
51#ifdef CONFIG_JFS_SECURITY
52extern int jfs_init_security(tid_t, struct inode *, struct inode *,
53			     const struct qstr *);
54#else
55static inline int jfs_init_security(tid_t tid, struct inode *inode,
56				    struct inode *dir, const struct qstr *qstr)
57{
58	return 0;
59}
60#endif
61
62#endif	/* H_JFS_XATTR */
v3.15
 
 1/*
 2 *   Copyright (C) International Business Machines Corp., 2000-2002
 3 *
 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.
 8 *
 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.
13 *
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
17 */
18
19#ifndef H_JFS_XATTR
20#define H_JFS_XATTR
21
 
 
22/*
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.
26 */
27struct jfs_ea {
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 */
33
34struct jfs_ea_list {
35	__le32 size;		/* overall size */
36	struct jfs_ea ea[0];	/* Variable length list */
37};
38
39/* Macros for defining maxiumum number of bytes supported for EAs */
40#define MAXEASIZE	65535
41#define MAXEALISTSIZE	MAXEASIZE
42
43/*
44 * some macros for dealing with variable length EA lists.
45 */
46#define EA_SIZE(ea) \
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)))
54
55extern int __jfs_setxattr(tid_t, struct inode *, const char *, const void *,
56			  size_t, int);
57extern int jfs_setxattr(struct dentry *, const char *, const void *, size_t,
58			int);
59extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t);
60extern ssize_t jfs_getxattr(struct dentry *, const char *, void *, size_t);
61extern ssize_t jfs_listxattr(struct dentry *, char *, size_t);
62extern int jfs_removexattr(struct dentry *, const char *);
63
64extern const struct xattr_handler *jfs_xattr_handlers[];
65
66#ifdef CONFIG_JFS_SECURITY
67extern int jfs_init_security(tid_t, struct inode *, struct inode *,
68			     const struct qstr *);
69#else
70static inline int jfs_init_security(tid_t tid, struct inode *inode,
71				    struct inode *dir, const struct qstr *qstr)
72{
73	return 0;
74}
75#endif
76
77#endif	/* H_JFS_XATTR */